šBorrowing and lending
Last updated
Last updated
Each time the protocol opens an expirable position for a user, borrowing and lending at a fixed rate occur on other DeFi protocols. At a high level:
lending at a fixed rate is equivalent to buying a discounted zero-coupon bond
borrowing at a fixed rate is equivalent to selling a discounted zero-coupon bond.
The maturity of the expirable needs to match the maturity of the zero-coupon bonds.
Contango uses different protocols to borrow and lend at a fixed rate. In this section, you would find more information about our integration with:
Contango uses the concept of flash swaps to make the protocol capital efficient. Let's say a trader wants to buy 1 ETH with 100 DAI. Without using flash swaps the trader would need to first give DAI before receiving ETH. With flash swaps the trader could get 1 ETH first as long as the 100 DAI are given back in the same block. If that's not the case the transaction is reversed. This allows the trader, or a protocol such as Contango, to perform some actions between receiving the 1 ETH, at the start of the transaction, and giving 100 DAI at the end of the transaction.
Let's start by taking the example in the position opening section, where a trader buys 1 expirable at with . The protocol owes a debt . Let's say the borrowing requires a minimum collaterization ratio (CR) of 140% margin, i.e. the equivalent of . The trader has only posted as margin, i.e. , there is clearly not enough money to do the borrowing with over-collaterisation.
Using flash swaps on the spot market, e.g. on Uniswap, the protocol is now able to meet the collaterisation ratio requirement by:
first getting the to be lent
lending by buying its zero-coupon version , worth
using this zero-coupon as margin to borrow the required fund. The collaterisation ratio for borrowing would be which is above the required 140%.
Swap the borrowed for .
use the borrowed plus margin to pay for the initial .
Contango closes a position by reverting the above steps. In the long example in the position closing section, the protocol follows these steps:ā
is repaid back from lending and swapped for .
is exchanged for its zero-coupon bond version, .
is then used to reimburse the debt and retrieve which is worth .
The margin is swapped for .
is given back to close the flashswap.