IndexZoo
Search…
⌃K

Leverage Token Design

Zoo leveraged Token Smart Contract (SC)

Those following data should be returned by the SC when call balance check function:
Asset (A(i)): deposit balance of SC in the Lending SC;
Debt(Di) : borrow balance of SC in the Lending SC;
Equity (Ei): equity owned by the SC,
Equity (Ei) = Asset (A(i)) - Debt (Di);
Index Token (Ti): # of token issued of the SC
Leverage Ratio (L(i)): leverage ratio of SC, L(i)= A(i) / (A(i) – D(i))
Token Price (P(i)) = Equity / # of token = (Asset – Debt) / # of token

Zoo leveraged Token Smart Contract (LTSM) Core Functions:

1. Mint:

As a leveraged token smart contract (LTSM), when MINT function is called, based on an E(x) amount of new equity token deposited from the user, the LTSM should mint T(x) amount of index token.
When the user deposited E(x) into the LTSM, LTSM should deposited E(x) into the underlying lending protocol, in this case AAVE, then borrow MD(x) amount of debt and swap MD(x) amount of debt token into A(d) amount of Asset back to the lending protocol. Once the above action finished, the LTSM should mint T(x) amount of token to the user.
E(i) = A(i) – D(i);
T(x)= E(x) / E(i) * T(i);
MD(x) = E(x) / E(i) * D(i);

2. Redeem: withdraw, sell, repay (Deleverage is in this step)

As a leveraged token smart contract (LTSM), when Redeem function is called, based on an T(x) amount of Index token deposited from the user, the LTSM should let the user to redeem E(x) amount of equity token.
When the user 1: redeemed E(x) into the LTSM, LTSM should 2 withdraw A(d) from the underlying lending protocol, in this case AAVE, then 3 swap AD(x) amount of debt token into MD(x) amount of Asset and 4 repay back to the lending protocol. Once the above action finished, the LTSM should 5 withdraw E(x) amount of equity token from the Lending SM then let the user 6 withdraw E(x) amount of equity token to their wallet.
E(x) = T(x) / T(i) * E(i)
AD(x) = T(x) / T(i) * D(i);
E(x) <= MRE(i), if E(x) > MRE(i), then return error code redeem amount is bigger than the maximum allowed, please split into multiple redemptions

3. Leverage:

As a leveraged token smart contract (LTSM), when Leverage function is called, based on an LD(x) amount inputted from the user, the LTSM should borrow LD(x) amount of debt token from the lending protocol, swap LD(x) into A(d) and redeposit A(d) into the Lending SM. Leverage function can only be called by whitelisted addresses.

4. De-Leverage:

As a leveraged token smart contract (LTSM), when De-Leverage function is called, based on an DA(x) amount inputted from the user, the LTSM should withdraw DA(x) amount of asset token from the lending protocol, swap DA(x) into LD(d) and repay LD(d) to the Lending SM. De-Leverage function can only be called by whitelisted addresses.