Last updated
Last updated
Users can set lending or borrowing limit orders within a pool. For example, a lender might set a limit order at the 10% interest rate by adding Loan Tokens at that specific tick. If a borrower takes all the Loan Tokens in the limit order in exchange for Fixed Rate Tokens, the limit order is marked as filled and becomes inactive. Once filled, the Fixed Rate Tokens from the limit order cannot be swapped back to Loan Tokens by any other lender. Users can redeem their limit orders at any time, regardless of whether they are unfilled, partially filled or filled.
When adding liquidity to a market a user needs to specify how many Loan Tokens or Fixed Rate Tokens he wants to add to a given set of ticks. Each tick LP is accounted for as a unique position. Liquidity can either be added in Loan Tokens or Fixed Rate Tokens. For example, a user can add 1,000 USDC worth of the Loan Token at the 9% tick:
If a borrower wants to borrow 1,000 worth of USDC at 9% the order will be converted to a higher amount of Fixed Rate USDC tokens depending on the exchangeRate at which the transaction occurs.
The user could add a second limit order. Let’s assume this time he wants to add 1,050 Fixed Rate USDC tokens. In order to do so he will need to own the 1,050 Fixed Rate tokens whether that’s through minting an offsetting pair of 1,050 Fixed USDC tokens and 1,050 Fixed USDC debts or by acquiring the 1,050 Fixed USDC tokens from the market. When adding the Fixed Rate Tokens, the LP can’t add them to a tick that already holds a Loan Tokens balance. In our example, the user adds a borrow limit order of 1,050 Fixed USDC tokens at the 5% tick.