Comment on page
Yield protocol offers fixed rates to borrowers and lenders through a zero-coupon bond-like instrument (called fyToken). At Contango we call them zcTokens, as in zero-coupon bond Tokens. At a high level:
- Lending at a fixed rate is equivalent to buying a zero-coupon bond.
- Borrowing at a fixed rate is equivalent to selling a zero-coupon bond.
However, borrowing on Yield, just like anywhere in DeFi, requires overcollateralization, i.e. you need to deposit more than the amount you can borrow, to ensure solvency and protect lenders.
So how does Contango achieve leverage for trading?
1) Contango first gets ETH from a flashswap on Uniswap. Notice this is slightly less than 0.2 ETH, because this amount will be lent on Yield and at maturity it will amount to 0.2 ETH (see the following step). The first address is the Uniswap pool. The second address is Yield’s fyETH/ETH pool contract (which is the same as the first address in the second line).
2) On the fyETH/ETH pool, Contango lends at a fixed-rate, by swapping the initial ETH for 0.2 fyETH (at expiry, thanks to interest being accrued, 0.2 fyETH will be swapped back for 0.2 ETH). The second address is the Join (contract that stores assets posted as collateral).
3) Contango transfers 100 USDC posted by the trader as collateral to Uniswap, to repay part of the flashswap. The first address is the trader’s wallet, and the second is Uniswap.
4) The 0.2 fyETH from step 2 are posted as collateral on Yield to mint fyUSDC (which explains why the origin address is a “Null Address”). Minting fyUSDC and selling them for USDC is equivalent to borrowing USDC at a fixed rate. The second address is the fyUSDC pool on Yield.
5) The fyUSDC from the previous step are swapped for USDC and transferred to Uniswap to honor the flashswap (which is the original Uniwap pool address from the first step).
6) Notice how an NFT representing the position is minted (from “Null Address”) and transferred to the trader’s wallet.
All the steps above are batched into one single atomic transaction.
That’s how Contango achieves up to 3.5x leverage for ETH pairs, given the 140% collateralization ratio on Yield protocol. For stable vs stable pairs the leverage goes up to 10x, because the collateralization ratio is lowered to 110%.