🏦Investing
This page describes the use cases related to investing into the TurboSwap, such as invest, redeem, and capital rebalance
Token Spot Price
The TurboSwap protocol acts as an automated market-maker for TurboSwap tokens. It calculates the spot token's pricepdenominated in the base currency as:
HereCis the value of the protocol capital,Nis the total number of tokens in circulation, andαis the capitalization ratio, i.e. the total value of all tokens in circulation divided by the capital of the protocol:
This capitalization ratio could be calculated from the initial values of the capitalC0, the initial number of the tokensN0, and the initial token pricep0:
Example: The reference currency is USD, the initial capital of the protocol is $6M(C0=6,000,000), the initial number of tokens is 1B(N0=1,000,000,000), and the initial token price is ¢1(p0=0.01). Then:
Token Price Invariant
If we put fees aside, then a user may investdCworth amount of assets into the capital and getdN=pdCnewly minted tokens. Thus we have:
By solving this differential equation, we get the token price invariant:
whereqis a constant quotient. The quotientqcould be calculated as:
For the example above, the initial value forqwould be:
so the token price invariant would be:
The following graph shows the relationship between the capitalCand the number of tokens in circulationN:
And here is the relationship between the spot token pricepand the number of tokens in circulationN:
So the spot token price goes up when the number of tokens in circulation grows.
Invest
When a user, whose account index isj, wants to invest anxiamount of thei-thasset into the capital, the amount is subtracted from the user's position, then a small minting feeϕmis charged from the amount, and the value of the remaining amount is added to the capital:
Herepiis the current price of thei-thasset denominated in the base currency.
Then, the protocol then calculates the number of new tokensΔNto be minted and sent to the user. This number should preserve the token price invariant:
So, the number of token a user will get is:
Redeem
When a user, whose account index isj, wants to redeemnfor thei-thasset, first the gross payoutxiis calculated that preserves the token price invariant:
A small fractionϕbof this gross amount is charged as a burning fee, and the remaining is added to the user's position, and redeemed tokens are burned:
Capital Rebalance
The protocol capital valueCis the sum of the capital valuescifor all listed assets weighted at the current asset pricespi:
Thus the capital is exposed to market risk. When the prices of different assets change, this affects the capital value. Letσibe the share of thei-thasset in the capital:
Biggerσimeans that the protocol capital is more exposed to the price of the i-thasset. Note, that in some casesσicould be negative, which means, that the capital has negative (short) exposure to the price of the corresponding asset. Anyway, the sum ofσifor all the listed assets always equals to one:
Capital allocation is a vector of all the σivalues:{σi}.
The governance sets a target capital allocation{τi}, such as:
If, for somei,σi<τi, theni-thasset is underweight in the capital, i.e. the protocol needs more capital to be allocated into this asset. If σi>τi, then the asset is overweight and the protocol needs to reduce the amount of the capital allocated to this asset.
If one asset is underweight and at the same time another asset is overweight in the capital, then a capital rebalance operation is possible.
Capital Rebalance on Exchange
Leti1be the ID of the underweight asset andi2be the ID of the overweight asset:
Letjbe the ID of a user who triggers capital rebalance trade on exchange. Let xi1 be the amount of the underweight assets for be bought for xi2units of the overweight asset. Let ρ be the capital rebalance reward. Then:
It is required thatai2⩾xi2for the trade to be successful. Also, the protocol checks that the under-/overweight states of the assets didn't flip after the trade, i.e. that:
Capital Rebalance Against a User
Instead of performing capital rebalanced trade on exchange, a user may do so against the user's own account.
The trade is performed at the current price, i.e.:
And as usual, the protocol checks, that the under-/overweight states of the assets didn't flip and the trade didn't leave the user's account in margin call.
Haircut
As the capital may take losses, it may go underwater, i.e. it may be thatC<0. In such extreme conditions, the protocol is not able to repay all the deposits in full, even in case all the short positions will be covered.
During the times when the capital is underwater, the protocol operates in the underwater mode, which means:
Token issuance is possible at a certain minimal price, rather than at a negative price calculated by the normal price formula.
Token redemption is not possible.
Withdrawals are performed with a haircut.
The haircut withdrawal formula works like this:
And a user gets just(1−ϕw)xi−C−C+units of the asset.
HereC+is the sum of all the capital assets, i.e. reserves and short positions:
andC+is the sum of all the capital obligations, i.e. long positions:
Haircut encourages users to stay invested. Also in case of unrecoverable capital damage, it allows users to return at least part of their funds.
Last updated