0% found this document useful (0 votes)
62 views17 pages

Tracer Perpetual Swaps

The document proposes a generalized perpetual swap protocol called Tracer Perpetual Swaps that allows for the permissionless deployment of new perpetual swap markets without third party approval or support. It aims to address issues with existing offerings such as governance approval requirements, developer support needs for new markets, and reliance on third parties that can cause censorship or downtime. The protocol features a novel liquidation mechanism that aims to make liquidation risk-free and low-cost for traders. It also includes market-specific automated market makers and insurance funds to support trading.

Uploaded by

Tanush Gautam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views17 pages

Tracer Perpetual Swaps

The document proposes a generalized perpetual swap protocol called Tracer Perpetual Swaps that allows for the permissionless deployment of new perpetual swap markets without third party approval or support. It aims to address issues with existing offerings such as governance approval requirements, developer support needs for new markets, and reliance on third parties that can cause censorship or downtime. The protocol features a novel liquidation mechanism that aims to make liquidation risk-free and low-cost for traders. It also includes market-specific automated market makers and insurance funds to support trading.

Uploaded by

Tanush Gautam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Tracer: Perpetual Swaps

Ryan Garner, Lachlan Webb


Mycelium

Jason Potts, Chris Berg, Sinclair Davidson


RMIT University

Version 1.3
June 28, 2021

Abstract

To date no platform offers permissionless market deployment of perpetual swaps. Exist-


ing offerings require governance approval and/or developer support to deploy new markets.
Herein we propose a generalised perpetual swap protocol that avoids all third party require-
ments. The Tracer Perpetual Swap system is a Factory compatible template that offers cus-
tomised market deployment without permissions. The smart contracts contain mechanisms
that allow markets to operate at significantly lower cost to participants. We have designed
a riskless liquidation mechanism via a slippage reimbursement receipt, rendering the act of
liquidation risk-free and the cost to liquidated traders competitively inexpensive. As a result,
users can trade at higher leverage and open positions with minuscule investment sizes. The
Tracer Perpetual Swap is a piece of financial infrastructure that can be accessed by anybody
with an internet connection. Using this infrastructure, any graphical user interface, financial
institution or individual can access global market exposure in the decentralised economy.

1
Contents
Introduction 3

Factory Template 4
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Trading 5
Going Long or Short . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Margin and Leverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
The Funding Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Premium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Automated Market Makers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Market Specific Automated Market Makers . . . . . . . . . . . . . . . . . . . 8
Providing Liquidity to an AMM . . . . . . . . . . . . . . . . . . . . . . . . . 8

Liquidation and Insurance 9


The Need for Liquidation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Liquidating a Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Liquidation Mechanism Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Market-Specific Insurance Funds . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Capitalising the Insurance Fund . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Funding Source 1: Insurance Funding Rate . . . . . . . . . . . . . . . . . . . 11
Funding Source 2: Direct Deposits - iTokens . . . . . . . . . . . . . . . . . . . 12
Insurance Buffer Account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Withdrawing from the Insurance Fund . . . . . . . . . . . . . . . . . . . . . . . . . 13

Oracles 14

Factory Deployment and Market Economics 15

Tracer DAO 15

Reputation 16
Individual Traders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Individual Markets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Conclusion 16

2
Introduction
A perpetual swap contract is a derivative that enables counterparties to gain long or short expo-
sure to an underlying asset for any amount of time. This contract closely replicates the payoffs
of purchasing, or selling short, an asset in the spot market. Perpetual swaps provide broad mar-
ket access, permitting exposure to global markets without excessive international brokerage fees
or licensing. Most current perpetual swap offerings, or similar contract for difference (CFD) of-
ferings, rely on third parties to function. Perpetual swaps offered by third parties are vulnerable
to censorship and system downtime. Where perpetual swaps are trustless, their design is still
limited by either managed insurance funds, poorly engineered liquidation functions or insecure
oracle frameworks. New markets cannot easily be deployed and require third party permission.
For the perpetual swap to become a widely adopted and scalable contract type, a secure and
trustless alternative must be engineered.

The Tracer Perpetual Swap is a generalised smart contract design that will serve as a universal
standard for engaging in perpetual swap agreements. Tracer Perpetual Swaps coordinate all mar-
ket agents in a manner that is permissionless, low cost and most importantly trustless. Anyone
may deploy a Tracer Perpetual Swap market from the Tracer Factory. If the contract deployer
permits market-based DAO governance, governors can interact with the live market contract
to optimise the contract details without market down-time. Long and short traders, as well as
liquidity providers, have the option to trade through an order-book mechanism or through an
Automated Market Maker (AMM).

Tracer Perpetual Swaps have a novel interaction between the liquidator and the insurance fund.
The liquidation mechanism eliminates flat liquidation costs and is instead competitively inex-
pensive. A riskless liquidation design incentivises liquidations to occur at the smallest profitable
margin. Thus, the cost of liquidation to a trader’s margin is so small that it enables smaller
minimum investment sizes for traders and higher leverage ratios. Where a trader’s margin can-
not cover the cost of liquidation, a market specific insurance fund reimburses liquidators. The
market specific insurance fund has capital-efficient funding targets and an insurance funding
rate that adjusts in response to the insurance fund deficit. As such, insurance funds no longer
endlessly grow until parameters are adjusted by centralised intervention. The contract design
can be leveraged for all markets globally.

3
Factory Template
Features

The Tracer Perpetual Swap is a Factory compatible template which anyone may customise and
deploy from the Factory once installed. The contract mechanisms incentivise all market agents
to perform their specific functions without requiring governance. Live markets can have stand-
alone economies that operate indefinitely without intervention. Notably, the template has the
capacity to implement 24/7 trading for assets with irregular price updates.

The template format supports the input of any feasible market pair. If a price feed exists for
the base asset (BTC/USDC), a market supported by a tokenised quote asset (BTC/USDC) can
be deployed. Note the quote asset is used to settle and clear the agreement. With an oracle
that reports off-chain prices, a perpetual swap can be a derivative of any off-chain asset without
requiring a trusted party to hold that asset as collateral.

Factory SC

Perpetual Swap SC

Deploys

AUD/USD TSLA/ETH XAU/AUD


Perpetual Perpetual Perpetual
Swap SC Swap SC Swap SC

F IGURE 1: The Tracer Perpetual Swap smart contract (SC) template held within the Factory. This template can deploy
limitless Perpetual Swap markets in the form of smart contracts (SC).

Applications
The Tracer Perpetual Swap is capable of supporting markets for:

• Localised commodities such as a city’s fuel prices. Users can hedge against increasing
fuel price (by taking a long position) for any given quantity of fuel that they intend to
consume.
• Hedging exposure to deflating property markets by taking a short position on a local real-
estate index.
• Gaining leveraged exposure to a piece of art, music, or other intellectual property repre-
sented by a NFT, where fractions of the NFT are traded in a liquid spot market.
• Going long on a bundled package (or an ETF) that consists of a combination of stock,
commodities, ecosystem credits and other assets that are considered ‘environmentally
friendly’.

4
Trading
Going Long or Short
A perpetual swap is a financial contract between two parties which allows agents to be long
or short on an underlying asset without the need to purchase it. When the contract is estab-
lished both parties agree on a price. The contracts’ payoffs simulate holding the underlying
asset—where the profit/loss from holding is the change in size of the user’s position. The size of
the user’s position is known as notional value and the profits/loss can be calculated as notional
value multiplied by the percentage difference between the current market price and the initial
market price. The change in value of a trader’s account following a movement in the price of
the asset they hold can be given by:

Long-Value-change(t) = Notional Value(t − 1) · Price(t)−Price(t−1)


Price(t−1)

Short-Value-change(t) = Notional Value(t − 1) · Price(t−1)−Price(t)


Price(t−1)

Counterparties enter into a long or short position in accordance with their beliefs (long if they
believe the price of the asset will rise, and short if they believe it will fall). The long and short
agents are speculators or hedgers. Speculators are trading in order to profit (seeking financial
upside), whereas hedgers are betting that something bad will happen to their net worth (insuring
against downside risk).

Traders can either interact in an entirely peer-to-peer fashion though an order-book mechanism
or in a peer-to-contract fashion through an Automated Market Maker (AMM). When trading
through an order-book, a trader can either take an order or make an order. Taking an order is
choosing to match with an order that is already placed and publicly broadcast. Making an order
is publicly broadcasting your order at a fixed quantity and price, waiting for it to be taken by
another trader. Makers and takers can either be matched by on-chain contract logic or through
an oracle network that aggregates and gossips their order-book before submitting an answer
on-chain [1]. The alternative to trading through an order-book mechanism is by trading with
an on-chain AMM. The role of AMMs in the Tracer Perpetual Swap contract are outlined in a
separate section.

Once two counter-orders have been matched the agreement is considered live. An agent that
wants to exit their position can sell it to another trader or to an AMM. Selling a position transfers
the position to another party without cancelling the original agreement. The counterparty to the
original agreement remains in a perpetual position regardless of position transfers. A trader
taking a large position can also be matched with multiple counterparties who can then trade in
and out of the position.

Margin and Leverage


As the conviction of their belief increases, so does an agent’s appetite for risk. A trader may be
so certain of their belief that they will borrow funds to increase exposure in their chosen position
in order to magnify their prospective gains. Agents have to hold collateral in order to borrow
funds. The collateral that is held against these borrowed funds is called margin.

A margin account allows agents to apply leverage to their position. Leverage is a trading mecha-
nism which allows a trader to finance their investment through a combination of borrowed funds
(debt) and margin. Leverage is the ratio of an agent’s notional value to their margin [2]. A trader
who trades at 1x leverage is funding the position completely via margin. A trader who trades at
2x leverage funds 50% of the position via borrowing. The Tracer Perpetual Swap implements a

5
maintenance margin that requires borrowers to maintain at least a certain level of margin as col-
lateral against their borrowings. Note the Tracer Perpetual Swap system does not have an initial
margin requirement higher than the maintenance margin. A contract-compatible user interface
may, however, display a warning advising a margin deposit greater than the maintenance margin
to prevent instant liquidation in the event of price movements.

Perpetual Swap
SC

AUD / USD
Long Margin Account Margin Account Short

F IGURE 2: An agreement between two traders with trader’s margin accounts. These margin accounts are specific to a
single Perpetual Swap market’s smart contract (SC).

Traders can allocate margin to a position in two ways. An individual agent can have multiple
margin accounts for the single market, which is known as having isolated margins, or they can
utilise one margin account for the market. Isolated margin allows an agent to specify a different
margin base for every position they take in the market while a single margin account holds all
of the margin, for all market trades.

The Funding Rate


A funding rate is a monetary transfer between counterparties which ensures that the perpetual
swap derivative accurately simulates the experience of holding the base asset. In the case where
the funding rate is positive, it means that the long agent pays the short agent. Conversely, when
the funding rate is negative, it means that short agents must pay the long agent.The funding rate
is calculated by:

Funding rate = Premium · Sensitivity

Premium
Premium (%) is the time-weighted difference between the mark price and the fair price. Fair
price is the index price (the price provided by the oracle) adjusted by a time-value component
(the average premium over the last 3 months). Mark price is the price of the perpetual swap
derivative. The time-weighted difference is computed by calculating the sum of each individual
hour (for the last 8 hours), then multiplying it by (8 - t), where t is the hours of difference
between each hour and the current hour. The average is then calculated after factoring in this
scale.

Sensitivity
Sensitivity is a multiplying factor applied to Premium. The sensitivity of the funding rate is best
designed so that it is low when the derivative price is historically volatile; indicating a volatile
underlying asset and/or low derivative liquidity. The default sensitivity is determined by the
classification of the market. This is noted in the table below.

6
Market Sensitivity
Cryptocurrency 0.1
Stock 0.5
Forex & Stablecoin 3

Funding payments ensure that the price of the perpetual swap derivative tends toward the price
of the underlying asset. A positive premium indicates excess long demand for the derivative and
requires long to pay short. Likewise, a negative premium indicates excess short demand and
requires short pay long. Agents are incentivised to sell their positions when they have to pay
funding while demand increases for positions receiving funding, bringing the fair price toward
the mark price. This mechanism ensures that individuals are able to buy and sell the perpetual
swap derivative at a price close to the fair price. The funding is continuously paid, with the rate
of payment changing once every 8 hours (i.e. it is quoted as an 8 hour rate and recalculated
every 8 hours).

Mark Price
Price

Fair Price

Time

F IGURE 3: A potential relationship between the fair price (thick blue line) and the mark price (thin black line). The
green areas indicate mark price is greater than fair price. When mark > fair, the premium is positive and thus the funding
rate positive. The red areas indicate mark price is less than fair price. When mark < fair, the premium is negative and
thus funding rate negative. This representation has been generalised for simplicity. In practice the funding rate will
slightly lag behind the premium movements as it is a backwards looking calculation.

7
Automated Market Makers
Market Specific Automated Market Makers
Users can also trade within a perpetual swap market through an on-chain peer-to-contract mech-
anism called an Automated Market Maker (AMM). The AMM is a trading mechanism that was
applied to, and widely adopted by, Uniswap and has since been applied to perpetual swaps [3,4].
Perpetual swap AMMs buy and sell a derivative to traders at a price determined by a fixed pricing
equation (otherwise called a bonding curve). AMMs act as standalone traders within a market
and compete with one another by varying their on-chain fee rates. Each Tracer Perpetual Swap
market has the ability to host an AMM, or multiple AMMs. While any AMM is compatible with
the contract, agents may only deploy Factory approved AMMs. The addition of a new AMM
pricing function requires a proposal to Tracer DAO. If a function is accepted, it is ’whitelisted’
for deployment.

The Tracer Perpetual Swap template includes a novel AMM design named the Delta Neutral
AMM (dnAMM). It is the first Factory template compatible AMM. The Tracer dnAMM is
explained in a separate paper.

Providing Liquidity to an AMM


AMMs within the perpetual swap system work the same as a trader’s account. The AMM uses
the quote asset of the market as margin. For a given asset pairing, liquidity providers can deposit
quote assets into the AMM in exchange for a share of the pool’s returns. This deposit increases
the AMM’s quote holdings, and correspondingly, the overall number of pool tokens (these are
proportional to one another - e.g. 1% more quote mints 1% more pool tokens). Pool tokens are
sent to the liquidity provider that deposited. The AMM’s fees grow the pool holdings over time
(more quote), increasing the value of existing pool tokens. Returns can be realised when the
liquidity provider burns pool tokens in exchange for their share of the quote token holdings.

Liquidity
Provider

AUD / USD
AMM

Provides
Quote Tokens Margin: Quote Tokens

Pool Tokens Minted: Pool Tokens


Receives

F IGURE 4: The interaction of a liquidity provider depositing into an AMM contract.

8
Liquidation and Insurance
The Need for Liquidation
The Tracer Perpetual Swap contract utilises a maintenance margin that requires leveraged traders
to maintain at least a certain level of margin as collateral against their borrowings. The calcula-
tion that determines the maintenance margin is:

Notional value
Maintenance margin = Maximum leverage + 6 · (Liquidation gas cost)

Where the (notional value/ maximum leverage) component of the maintenance margin considers
potential order-book slippage and is deemed a sufficient buffer amount. The second component,
6x liquidation gas cost of the last position, is included to partially protect the insurance fund
from gas cost increases.

A maintenance margin is required as leveraged trading introduces significant risk. The risk
is that an agent will become bankrupt and not be able to pay the counterparty who they are
effectively in debt to. To minimise counterparty default, positions that fall below the required
maintenance margin are deemed eligible for liquidation. Liquidation is the process in which a
position is repossessed by a trader or agent that has adequate margin requirements. The agent
liquidating (purchasing) the position is known as the liquidator.

Liquidating a Position
Positions below their maintenance margin can be acquired by anyone at a discount equal to the
amount the position is below maintenance margin. If this discount is greater than the gas cost of
liquidation, the position can be purchased for a profit. To ensure the ability to fund this discount,
the trader’s remaining margin is placed in margin escrow to cover liquidation costs (the discount,
and any slippage costs). The margin escrow account ensures the trader does not exit the position
prior to compensating the liquidator. If the margin in the escrow account is insufficient to pay
this discount amount, the insurance fund will instantly cover the amount.

After the liquidator agent has purchased the position, they can do one of two things. The liq-
uidator can now either hold the position or sell it back to the market. In the case where they sell
it back to the market, they bear the risk that the entire position can not be sold at the market price
due to insufficient market liquidity. This is known as slippage, or market liquidity risk. If this
occurs to a liquidator during the allowed time to claim slippage reimbursement (∼10 minutes),
liquidators are guaranteed to be reimbursed for any losses they incur, with the exception of gas
cost, from the time they acquire a below-margin position to the time they sell it. Liquidators are
paid an initial amount equal to the amount a position was below its maintenance margin. If they
sell the position within 10 minutes, receive an additional amount equal to the losses from briefly
holding and selling the position. These payments to the liquidator first come out of the trader’s
remaining margin stored in margin escrow, if this is exhausted, then from the insurance fund. If
there is any margin remaining in escrow after this process it is returned to the trader.

9
F IGURE 5: Aspects of the margin account. Above the maintenance margin equity is available to withdraw. Below
the maintenance margin the position is eligible for liquidation. Liquidation is profitable when margin falls below the
maintenance margin by the gas cost to liquidate. As the margin account approaches bankruptcy, profits from liquidation
increase.

Liquidation Mechanism Design


The liquidation design outlined above is competitively inexpensive. Virtually all existing perpet-
ual swap liquidation mechanisms charge traders a significant fixed portion or the entirety of their
remaining margin. Fixed fees for liquidation cause high leverage positions to be prohibitively
expensive. By charging competitively inexpensive liquidation fees, the Tracer Perpetual Swap
contract enables traders to take on high levels of leverage with reasonable margin requirements.
The slippage reimbursement receipt mechanism allows the insurance fund to cover slippage
costs in excess of the remaining trader margin in escrow. In effect, the risk that a liquidator
may lose money as a result of liquidating a position is eliminated. The only cost incurred by
the liquidator during any liquidation transaction is the current gas price. Riskless liquidation
encourages positions below their maintenance margin by any amount more than the current fast
gas price to be liquidated—these positions represent risk-free profit.
Scenarios where the insurance fund covers liquidation expenses generally occur when a small
position is liquidated after a huge spike in the gas cost, or when the slippage on a large position
is greater than the maintenance margin. The amount that the insurance fund has to cover in
both of these cases is often small, especially in markets with low volatility. As a result of
mitigated insurance expenses, the insurance funding rate charged to leveraged traders is low.
Low insurance funding fees and inexpensive competitive liquidation combine to let traders take
greater leverage with lower minimum investment size. Margin requirements in Tracer Perpetual
Swap contracts are as small as 6x the gas cost for liquidation.

Market-Specific Insurance Funds


Tracer Perpetual Swap’s insurance funds are market-specific, meaning that there is an insurance
fund for each individual market. In periods of high volatility, mass liquidations in one market
do not affect other markets which minimises global protocol risk.

10
Capitalising the Insurance Fund
The insurance fund accrues capital in two ways:

1. Insurance funding payments from leveraged traders.


2. Individuals directly depositing into the fund in return for a proportion of the insurance
funding payments.

Funding Source 1: Insurance Funding Rate


A variable insurance funding rate is paid from leveraged agents into the insurance fund. Each
market-specific insurance fund sets a funding target. The funding target is set as a percentage
of the total borrowed by traders (i.e. the market debt). The target is 1% in the default template,
however, the market creator can specify any fixed percent or variable percent as optimized by
the market’s designated governance. It is necessary that the ratio of the insurance fund target to
the total borrowed be positively correlated with the derivative price volatility, and typical order
book slippage for larger trades. 1% of the total amount borrowed will be the default value in
the template because it is a few times the amount needed to survive the largest market crashes
observed in the past few years, based on research from existing perpetual swaps [5].

Derivatives with high volatility require higher insurance funding targets to prevent socialised
loss. Socialised loss occurs when the insurance fund is emptied as the result of one or more
large liquidations that cost more than the margin in escrow, requiring the funds to compensate
liquidators be sourced via involuntary acquisition of other agents’ margin. As leveraged traders
are the sole reason for the insurance fund existing, they capitalise the fund. These agents pay
a variable insurance funding rate based on how far the insurance fund is from the target size
(insurance fund deficit). When the insurance fund is fully capitalised, the insurance funding rate
is zero.
The insurance funding rate will update every 8 hours in order to achieve an insurance fund size
that is equal to the insurance fund target. When the insurance fund is above target, the insurance
funding rate is set to zero, otherwise, it is set to whatever amount would cause the insurance
fund to reach its target in 3 months from collecting every 8 hours. 8 hours divided by 3 months
is 0.0036523 giving a formula of:

Insurance Funding rate = Max(0.0036523 · Insurance Leveraged


Fund Target−Insurance Fund holdings
Notional Amount , 0)

Like the funding payments discussed above, the insurance funding payment is paid continuously
and is quoted as an 8 hour rate. The insurance funding is paid by leveraged traders to the
insurance fund accounts. The below formula calculates the total funding paid to the insurance
fund over an 8 hour period. Note that the total borrowed from the system is updated every 8
hours.

Insurance Funding = Insurance funding rate · total borrowed from the system

11
Funding Source 2: Direct Deposits - iTokens
Agents may voluntarily capitalise an insurance fund through a direct deposit into the public in-
surance account. In exchange for earning a proportion of the insurance funding rate payments,
private individuals deposit their funds and take on the risk that all or part of their deposit will
be lost covering liquidations that cost more than the remaining margin. Any user may deposit
funds into an insurance pool to earn a proportion of insurance funding rate payments relative
to their total share of the insurance fund, increasing the speed at which the fund is capitalised.
The insurance funding rate is based on how far the insurance fund is from its target causing the
return to depositors to approach zero as the fund nears it’s target, approaching infinity as the
insurance fund nears empty.

F IGURE 6: The relationship between APR (%) and the insurance fund deficit. As the deficit reaches 100%, the APR
(%) goes to infinity. As the deficit reaches 0%, the APR approaches 0%. An insurance fund deficit of 25% corresponds
to an APR of 133%, an insurance fund deficit of 50% corresponds to an APR of 400%, and an insurance fund deficit of
75% corresponds to an APR of 1200%.

When a user deposits funds into the insurance account, they are granted an ERC20 iToken, a
fungible claim to their insurance position. An insurance fund depositor will deposit the market’s
quote asset to fund the insurance account and receive iTokens in return. For example, a user
funding the insurance account with DAI will be granted iDAI that can be used to redeem their
DAI deposit. The iTokens represent a proportional share of the public insurance account. As
the public insurance account accrues capital via insurance funding payments, the value of the
iToken increases. Note the insurance funding is paid in the quote asset. When the iTokens are
redeemed for the deposit (in a process known as burning), insurers can realise potential returns.
Insurers can sell their iTokens in a secondary market to reduce their exposure to the insurance
fund without paying the withdrawal fee for redeeming their deposit. Conversely, buyers can
gain exposure to an insurance fund by purchasing iTokens on a secondary market. Purchasing
iTokens rather than directly depositing does not change the composition of the underlying fund,
which may be desirable—the risk profile of the insurance fund remains unchanged.

12
iTokens will trade anywhere from the amount the system currently pays for burning (after with-
drawal fee), to the amount the system would pay for burning in the future if the fund reaches its
target and thus has no withdrawal fee. The price will tend to be higher if traders expect the fund
to reach target soon, and lower if the public insurance fund is small and the chance of expenses
high.

Insurer Liquidator
AUD / DAI
iDAI Insurance SC Slippage
Receipt

Public Insurance Account


Account DAI DAI Margin
Insurance Buffer Account

F IGURE 7: Two types of agents interacting with the insurance fund. On the left, an insurer deposits DAI into the
AUD/DAI smart contract and in return gets minted iDAI. This is in addition to the insurance funding rate capitalising
the accounts. On the right, a liquidator submits a slippage reimbursement receipt to the insurance contract and is
compensated with DAI. The liquidator is first compensated by the insurance buffer account, as explained below, and
then by the public insurance account.

Insurance Buffer Account


Each market specific insurance fund has an insurance buffer account. The insurance buffer ac-
count serves a specific purpose—it has priority for insurance expenses, providing a layer of
protection for private depositors. Once the buffer account is depleted, expenses are shared by
all depositors proportional to the size of their deposit. The insurance buffer account’s margin
increases via its share of insurance funding rate payments. The insurance buffer account’s hold-
ings make a return through the same yield that private investors make.
The insurance buffer account receives insurance funding payments the same as a public insur-
ance account, however, it has two main differences. It has priority for insurance expenses and
it receives 100% of the withdrawal fee from the public insurance account. At the start of the
insurance fund, with no depositors, all of the funding rate would be paid to the insurance buffer
account by default, however, anyone can deposit any amount to the public insurance account
to collect 100% of the insurance revenue, which is likely to occur. As deposits increase, the
withdrawal fee decreases. The initial withdrawal fee goes to the insurance buffer account, boot-
strapping the account.

Withdrawing from the Insurance Fund


Agents can withdraw their funds at any time. Depending on the capitalisation level of the insur-
ance fund, users may need to pay a fee to withdraw. Agents are charged a deposit withdrawal
fee paid to the insurance buffer account equal to the percent the fund would be below target af-
ter the withdrawal has occurred. Time-locks can be enforced on withdrawals to further prevent
insurance fund depletion in volatile market conditions.

13
For example, assume the fund target is $6000 and the fund currently contains $5000. A depositor
wishes to withdraw $500. The withdrawal fee will be:

Insurance fund deficit after the withdrawal


Withdrawal fee = Insurance fund target

The insurance fund deficit after the withdrawal = (6000 − 5000) + 500 = $1500

1500
Withdrawal fee = 6000 = 25%

Oracles
Oracles are utilised in the Tracer Perpetual Swap contract for several purposes:

• Oracles provide the contracts with price inputs. The index price (and by extension, the
funding rate) rely on a spot market price in order to update.

• Oracles can be utilised to match orders. The order-matching logic should be kept on-
chain. However, in high cost circumstances oracles are required to match orders. Repu-
tation is a key factor in selecting order-book oracles and order logic should be verifiable
and posted on-chain where possible.
• Oracles are used to determine the fair price when calculating if a position is eligible for
liquidation and how far below maintenance margin it was at the time of liquidation.

• Oracles are used by the dnAMM to price correctly and incentivise a return to a delta
neutral state.
• The liquidation function can be automated through an oracle call. External initiators can
be used to monitor the blockchain and recognise when a position has fallen under its
maintenance margin. An oracle can then automate this liquidation given they have a
margin account set up, and automate a sale to the AMM or another trader if there is
existing liquidity.

A price input oracle is set and customisable for each Tracer market. If no oracle solution exists
for a specific asset pairing, it is possible that Tracer’s governors can agree to finance the creation
of an oracle solution. Oracle financing can occur for markets that wish to leverage spot market
data that is difficult and expensive to acquire.

To protect the system against oracle failure, the perpetual swap smart contracts can be engi-
neered to mitigate the damage caused by oracle failure. If there is an error with the oracle input
that is detected on-chain, the smart contracts autonomously failover to another oracle solution.
Governance can replace or change an oracle solution via timely proposal for a specific market
if it has chosen to be governed by the DAO. Each market can have a built-in stop mechanism
to activate final settlement and prevent new positions being opened. This mechanism may be
activated by Tracer DAO vote and used in extreme cases where either an oracle feed has failed,
and/or protocol manipulation is occurring. This function is only available to Tracer Perpetual
Swap markets that have governance.

14
Factory Deployment and Market Economics
A Tracer Perpetual Swap template requires multiple variable inputs to be deployed. The market
creator must select an oracle address for the funding rate, specify a fee rate or fee rate function,
select a quote asset, base asset, and specify contract ownership. As previously mentioned, con-
tracts can be deployed as either owner-less, privately owned, or Tracer DAO governed. Other
factors such as funding rate, insurance funding rate, insurance pool target, and liquidation in-
centives can be customised at deployment.

Unless DAO governance or private ownership is specified, individual perpetual swap markets
will be economically independent and will therefore require appropriate fee structuring for or-
acles and incentive alignment for market agents at the time of deployment. The benefit of de-
ploying an owner-less perpetual swap contract is that there is zero third-party risk. The trade-off
of being entirely permission-less is that the contract may not sufficiently incentivise all agents
within the system and require redeployment. A portion of the fees collected by a perpetual
swap smart contract can be used to incentivise market participants such as oracles and liquidity
providers over time. Oracles can be subsidised and financed via governance, but it is unlikely
that markets will survive unless they can directly incentivise and pay oracles.

Tracer DAO
When Tracer Perpetual Swap contracts are deployed, they are not necessarily under the purview
of Tracer DAO and its governance. The deployer of the contract must elect Tracer DAO to
govern the contract. Electing Tracer DAO to govern the perpetual swap contract allows DAO
governors to customise any aspect of the market while it is live. DAO governance can, for
example:

• Change a fee rate in order to increase the market’s competitive advantage. Liquidity
providers are incentivised to participate in markets with the lowest fees.
• Change an oracle address if it is failing, or is under threat from malicious actors, to prevent
mass liquidation.

• Change a market’s insurance funding target to address the appropriate volatility of the
market.

The motivations for a deployer to specify governance could be to increase market efficiency, in-
crease competitiveness, limit the actions of malicious actors, or to reduce unnecessary risk. With
no embedded governance structure, markets are unable to make pivotal changes to contracts once
they are initially deployed. When markets become large and require their own governance and
incentive rights, they can foreseeably vote to engineer market-specific governance rights. This
would separate markets to be governed by the individual market participants.

15
Reputation
Tracer implements a Reputation System aiming to identify, measure, and convey relevant risk
to all market participants. Reputation scores will be developed for individual markets and in-
dividual traders. See Tracer: Peer-to-Peer Finance [6] for more detail. Below we include a
non-exhaustive list of metrics that are verifiable and on-chain, that reputation scores can be
based on:

Individual Traders
• Liquidation frequency
• Average leverage ratio
• Average time deposited within insurance fund
• Deposit withdrawal from insurance fund in times of volatility

Individual Markets
• Time that insurance fund is below target

• Oracle downtime
• Notional value of all trades
• Number of transactions

Conclusion
In this paper, we discuss the Tracer Perpetual Swap. Tracer Perpetual Swap is a set of smart
contracts that coordinates all market participants in a way that is low cost, trustless, and has
zero reliance on a third party. This contract system is a Tracer Factory compatible template
that grants permissionless deployment of markets for any viable asset pairing. Traders can
either trade via an order-book mechanism or through an Automated Market Maker contract.
A novel liquidation mechanism is introduced that is competitively inexpensive and riskless for
the liquidator. Market specific insurance pools with funding targets and insurance funding rates
isolate risk to individual markets and ensure that counterparty risk is minimised. The liquidation
and insurance mechanisms are capital optimised, granting traders higher leverage and lower
minimum trade sizes. Tracer Perpetual Swaps provide the individual with broad market access
and capital efficient exposure to global asset classes.

16
References
[1] Ari Juels, Lorenz Breidenbach, and Florian Tramèr. Fair Sequencing Services:
Enabling a Provably Fair DeFi Ecosystem. 2020. URL: https://blog.chain.link/
chainlink-fair-sequencing-services-enabling-a-provably-fair-defi-ecosystem/.
[2] Hasu and Avi Felman. Leverage 101 – A Short Primer. 2021. URL: https : / /
insights.deribit.com/market-research/leverage-101-a-short-primer/.
[3] Hayden Adams, Noah Zinsmeister, and Dan Robinson. 2020. URL: https : / /
uniswap.org/whitepaper.pdf.
[4] Liu Jie. MCDEX: DeFi Platform for Trading Perpetuals. 2020. URL: https : / /
mcdex.io/references/#/en-US/white-paper?id=references.
[5] Omkar Godbole. Bitcoin’s Crash Triggers Over $700M in Liquidations on Bit-
MEX. 2020. URL: https://www.coindesk.com/bitcoins-crash-triggers-over-700m-
in-liquidations-on-bitmex.
[6] Ryan Garner et al. Tracer: Peer-to-Peer Finance. 2021. URL: https : / / tracer .
finance/whitepaper/.

17

You might also like