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 pricedenominated in the base currency as:
Hereis the value of the protocol capital,is the total number of tokens in circulation, andis 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 capital, the initial number of the tokens, and the initial token price:
Example: The reference currency is USD, the initial capital of the protocol is $6M, the initial number of tokens is 1B, and the initial token price is Β’1. Then:
Token Price Invariant
If we put fees aside, then a user may investworth amount of assets into the capital and getnewly minted tokens. Thus we have:
By solving this differential equation, we get the token price invariant:
whereis a constant quotient. The quotientcould be calculated as:
For the example above, the initial value forwould be:
so the token price invariant would be:
The following graph shows the relationship between the capitaland the number of tokens in circulation:
And here is the relationship between the spot token priceand the number of tokens in circulation:
So the spot token price goes up when the number of tokens in circulation grows.
Invest
When a user, whose account index is, wants to invest anamount of theasset into the capital, the amount is subtracted from the user's position, then a small minting feeis charged from the amount, and the value of the remaining amount is added to the capital:
Hereis the current price of theasset denominated in the base currency.
Then, the protocol then calculates the number of new tokensto 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 is, wants to redeemfor theasset, first the gross payoutis calculated that preserves the token price invariant:
A small fractionof 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 valueis the sum of the capital valuesfor all listed assets weighted at the current asset prices:
Thus the capital is exposed to market risk. When the prices of different assets change, this affects the capital value. Letbe the share of theasset in the capital:
Biggermeans that the protocol capital is more exposed to the price of the asset. Note, that in some casescould be negative, which means, that the capital has negative (short) exposure to the price of the corresponding asset. Anyway, the sum offor all the listed assets always equals to one:
Capital allocation is a vector of all the values:.
The governance sets a target capital allocation, such as:
If, for some,, thenasset is underweight in the capital, i.e. the protocol needs more capital to be allocated into this asset. If , 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
Letbe the ID of the underweight asset andbe the ID of the overweight asset:
Letbe the ID of a user who triggers capital rebalance trade on exchange. Let be the amount of the underweight assets for be bought for units of the overweight asset. Let be the capital rebalance reward. Then:
It is required thatfor 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 that. 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 justunits of the asset.
Hereis the sum of all the capital assets, i.e. reserves and short positions:
andis 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
Was this helpful?