Seaport Leverage and Deleverage
Overview
Context
This contract outlines a leverage and deleverage strategy with the following assumptions:
The "base asset" can be sold for the "collateral asset" on Seaport.
The "collateral asset" can be sold for the "base asset" on Seaport.
Why Seaport?
As LRTs are having a hard time bootstrapping resilient liquidity on AMMsβespecially on Uniswapβwe are incorporating a RFQ system that connects the user looking to sell the collateral in a deleverage scenario to a marketmaker willing to buy the collateral at a discount.
Because RFQβs are traditionally non-atomic, they are not compatible with a delverage strategy that relies on atomic flashloans.
To make these RFQβs βatomicβ, we incorporate Seaport where a market maker first quotes the price offchain and signs an approval to transfer its payment asset to the deleverage contract.
This allows the user and the market maker to agree on an exchange of assets at a specific price prior to sending a transaction. The βswapβ is executed atomically when the deleverage contract is called.called.
The goal is to facilitate an atomic sale of collateral during a liquidation or a deleverage to an RFQ system that is willing to buy the collateral. We expect this path to be more resilient than the shallow liquidity on on-chain AMMs.
NOTE: Most of the complexity in the RFQ will be the responsibility of the frontend offchain system to match the users to a counterparty. The new on-chain integration that is being built out is the ability to fulfill an offer on seaport.
Transaction Flow
The key idea here is incorporating an βatomicβ RFQ-swap through Seaport. The following is the flow for the user looking to deleverage:
The user requests an amount of
weETH
to sell to the RFQ. [offchain, websocket connectionβno contract interaction has been made yet]The market maker quotes the amount of
wstETH
they are willing to pay for the given amount ofweETH
. [offchain, websocket connection]The market maker generates a signature and approves the wstETH amount via Seaport. The market maker creates an
offer
on seaport. [theoffer
is created on-chain on seaport].Next, the signature is sent from the market maker to the user [offchain, sent to the user interacting on the frontend]
The user on the frontend now calls the deleverage contract and passes this signature along in calldata.
The deleverage contract will now payoff Ion loan, withdraw
weETH
, then sell thisweETH
on seaport using the outstandingoffer
.The deleverage contract will fulfill the
offer
on seaport, transferring thewstETH
from the market makerβs EOA and transferring the userβsweETH
to the market maker.
It should also be noted that if the pricing is too unfavorable for the user, the deleverage may fail as it violates the max LTV requirement.
For example, the user and the RFQ counterparty agree on the amount of
weETH
andwstETH
to exchange.The deleverage sources the exact
wstETH
amount to pay off debt, but if after paying off this debt, the resulting LTV is above the maxLTV, then the contract will revert.The frontend will be responsible for making sure that the pricing is reasonable for the transaction to succeed before initiating any on-chain actions.
The transaction should revert when:
the weETHExchangeRate converts `weETH` value to the `wstETH` value.
Last updated