[THORFI] Perpetual Contracts (Perps)
Perps
A perpetual contract "perps" allows a user to bet on the future price of an asset, with leverage.
There are 4 things normally required:
- A Spot Price: "the true price of the asset"
- A Perps Market where users post collateral to borrow derivatives of the asset (not the true asset). This market has a Perp Price; this can decouple from (1).
- A Funding Rate (and cycle), where if the Perp Price decouples from the Spot Price, users on the wrong side pay interest to users on the right side. This forces a correction, to push the Perp Price back to the Spot Price. Typically every 8 to 12 hours, with the interest as a function of the price diff. Additionally, the Funding Rate ensures that the market is PvP and not ExchangevP (ie, users play off against each other and don't push risk onto the Exchange)
- A Liquidation Engine, where holders of the derivatives have their collateral liquidated if the asset they hold goes below the collateral they posted.
They are 2 types of users:
- Users who are betting on the market. Users who bet correctly are paid from the liquidated collateral of the users who bet incorrectly.
- Users who collect the funding rate opportunistically to make yield. If the Funding Rate is non-zero, then by holding a hedged position (on another market) users can get paid to help restore Perp Price back to Spot Price. They collect money from the users paying interest on the other side of the market.
Open Questions
- Is a separate market required? Can the Perp market use the BTC L1 pool as its price, with no Funding Rate required? This would take away a lot of complexity. In addition, THORChain already offers a Yield product.
- Are liquidations needed? Similiar to THORFi lending, since the markets are all derived assets, can the collateral be held as network equity (RUNE), thus the collateral becomes a liability and doesn't need to be liquidated if collateral < debt?
- Can the protocol always "take the other side" but win the house on selling collateral as network equity?
THORFi Perps should try and do something special: no liquidations, no funding rate, or no separate market.
Possible Design - No Liquidations, No Separate Market, Funding Rate
BTC Perp Market (any leverage possible)
BTC Price: $15k.
3xLong
Users post $15k collateral, which buys 1.0 THOR.BTC (by buying and burning RUNE). User has a new position stored. If BTC goes up 33%, to $20k, TC will allow them to mint enough RUNE to buy 2.0 BTC. (1.0 * 1.33 * 3 / 2 = 2.0)
If BTC goes down 33% to $10k, the user should have $0 claimable (1.0 * 0.66 * 3 / 2)-1.0 = 0
. They are not liquidated, but the system owes them nothing until BTC goes back above $10k again.
3xShort
Users post 1.0 BTC collateral, which buys $15k TOR (by buying and burning RUNE). User has a new position stored. If BTC goes down 33% (TOR goes up 33%), to $10k, TC will allow them to mint enough RUNE to buy $30k TOR. (15000 * 1.333 * 3 / 2) = 30,000
If BTC goes up 33%, the user should have $0 claimable (15000 * 0.66 * 3 / 2)-15000 = 0
. They are not liquidated, but the system owes them nothing until BTC goes back below $20k again.
Protocol Benefits
- The collateral is always stored as equity (burnt RUNE). So the more order interest, the more equity.
- The pools receive swap fees for all positions open-close
Separate Market?
Since the Perp Market settles to the L1 pool, there is no separate market. All Order Interest goes thru the L1 pool and the derived asset.
Liquidations?
Since the claims are held as network equity, they don't ever need to be liquidated. A user can rescue their claim by doubling down if the price moves against them, increasing the size of their position. This is good for the network. Interestingly, you can hypothesise that by not liquidating, a user is more likely to double down and keep participating, than if they had been liquidated (nothing to rescue).
Funding Rate?
A funding rate is not needed for the purposes of correcting Perp Markets back to Spot Markets. However, it is still required to control risk. In the above examples, the protocol becomes "the other side". If the market is too bullish on BTC, the protocol becomes bearish on BTC, and vice versa.
Protocol Risks
In a balanced market (equal shorts to longs), where BTC goes up 33%:
- The protocol is storing $15k + 1.0 BTC in equity ($30k, or 2.0 BTC in RUNE burnt).
- The protocol has to pay 2.0 BTC back to the longer, but nothing to the shorter.
- Net burn/mint is 0
✅
In a favourable bullish market, (twice as many longs to shorts), where BTC goes up 33%:
- The protocol is storing $15k + 2.0 BTC in equity ($45k, or 3.0 BTC in RUNE burnt).
- The protocol has to pay 4.0 BTC back to the longer, but nothing to the shorter.
- Net mint is 1.0 BTC
🚨
In an unfavourable bearish market, (twice as many shorts to longs), where BTC goes down 33%:
- The protocol is storing $30k + 1.0 BTC in equity ($45k, or 3.0 BTC in RUNE burnt).
- The protocol has to pay $60k BTC back to the shorts, but nothing to the longs.
- Net mint is $15k
🚨
In an unfavourable bullish market, (twice as many longs to shorts), where BTC goes down 33%:
- The protocol is storing $15k + 2.0 BTC in equity ($45k, or 3.0 BTC in RUNE burnt).
- The protocol has to pay $30k back to the shorter, but nothing to the longs.
- Net burn is $15k
✅
In a favourable bearish market, (twice as many shorts to longs), where BTC goes up 33%:
- The protocol is storing $30k + 1.0 BTC in equity ($45k, or 3.0 BTC in RUNE burnt).
- The protocol has to pay 2.0 BTC back to the longs, but nothing to the shorts.
- Net burn is 1.0 BTC
✅
If prices are equally likely to go up as down, and the market sentiments are equally likely to be bullish or bearish, then over time the protocol shouldn't be risking that much since it will all balance out. However, with crypto, prices are more likely to go up than down, and markets are more likely to be bullish than bearish (more longs than shorts).
Thus the favourable bullish market scenario is more likely to play out than others, causing the Protocol likely to net mint RUNE.
Something needs to counter-act this to drive markets to be balanced, ie an interest rate should be paid between Longs and Shorts. To do this, holders of positions put their assets into a vault (size*leverage)
, and are given vault shares. The vault balances (depth*price)
between long and short is incremented/decremented each block in order to drive convergence (should be same notional size at all times). The rate of change is a function of the depth difference between the vaults.
Ie, as the market goes up, all the Long Vault will increase faster than the Short Vault, so it will look bigger. Thus they pay an interest rate to the Short Vault. This should attract more shorters into the Short Vault to balance it out.