FEATURE: Composite Assets [WIP]
Overview
THORChain composite assets are comprised of multi-asset pools containing curated synthetic assets. The liquidity token issued when a member adds liquidity becomes the composite asset, since it retains redemption power at all times.
Composites also have more unique characteristics:
- They are yield-generating
- They are continually rebalanced, but do not suffer decay
Examples:
- THOR.USD is the liquidity asset of a pool with the 5 deepest stablecoins, and suffers no Impermanent Loss
- THOR.CRYPTO is the asset for a pool with ALL the non-USD crypto assets on THORChain
- THOR.TEN is the top Ten non-USD
- THOR.ALTCOIN is all the non-USD coins, but also not Bitcoin
Implementation
Curation
There is required curation logic to each composite asset, which is able to add synths into a pool, then remove them according to the rule of the composite.
- THOR.USD: +/- 2% on the starting USD price
- THOR.CRYPTO: not in THOR.USD
- THOR.TEN: top 10 deepest in THOR.CRYPTO
- THOR.ALTCOIN: THOR.CRYPTO but not BTC assets, or BTC-like assets
Synth Replacement
All composites require logic to remove/replace a member synth. To do this, the balance of the existing synth needs to be synth-swapped into the desired one, and that new balance added back in.
Cycle, one check every compositeRebalanceCycle
:
- Synth replacements should be kept to a minimum
- Synths MUST be replaced if they are ever unstaged.
- THOR.USD synth swap should have swap fees reimbursed by the reserve (to prevent decay)
- Synth swaps should be done in 10 transactions over 1000 blocks (90% less fees, enough time to arb)
Liquidity Model
Composite pools are multi-asset pools.
Adding Liquidity
When a user adds liquidity to a pool with n
synths, they only add one, the "entry" synth. They will incur a small slip when they enter. They immediately get issued a token that represents redemption rights on the composite.
Formula:
a = assetAdded; A = assetDepth // entry asset
n = numberOfSynthsInComposite
compositeAmount = a ((A (sum(depthsOfOtherSynths)))/(a + nA)^2 + 1/n^2)
transfer(member, composite, compositeAmount)
Removing Liquidity
A user can only remove to one synth, the "exit" synth.
Formula:
p = compositeRedeemed / compositeSupply
n = numberOfSynthsInComposite
A = assetDepth // exit asset
assetRedeemed = (n-1)*Ap^3 - 2*(n-1)* Ap^2 + n*Ap
Swapping
Users swap across the pool between synths to arb and keep the pool balanced. They are arbing the pool's assets to keep the pool correctly balanced, and swap from one synth to another to re-capitalise.
The formula is simply the base CLP formula with a multiplier of 10 (very liquid), and traders simply arb one to another.
Formula:
A = compositeLiquidityMultiplier
X = sourceSynthDepth; Y = targetSynthDepth
x = sourceSynthAmount;
targetSynthAmount = (x * A X * A Y) / (x + A X)^2