While our previously released Debt Swap Adapter (
ParaswapDebtSwapAdapter) automatically supports every newly added standard token on the Aave protocol, the custom nature of GHO requires an adaptation.
GHO has no underlying supply on the aToken, as GHO is minted when borrowing. This design is incompatible with the Aave style flash loans, as they use the underlying deposit as a liquidity source.
While GHO does not support flash loans, in the GHO listing proposal by @AaveCompanies a
FlashMinter Facilitator was introduced providing similar functionality but following the EIP-3156 standard.
This mechanism allows sourcing “flash” GHO from a smart contract venue, even if not directly from Aave v3.
To account for the EIP-3156 flow, under the hood, GHO is handled separately in our new swap adapter. Different from the usual code path for a swap from e.g.
vGHO debt, the following steps will be performed:
- Flash mint the amount of
GHOneeded to repay your
- Swap the received
DAI, in this case via Paraswap (to be compatible with previous versions).
- Repay the
vDAIdebt on behalf of the user.
- Borrow enough
GHOto cover the “flash mint” + the fee of the facilitator (zero at the moment).
The adapter will continue to work exactly as it did before. There are 0 changes to the interface.
Efficient debt swaps are a pretty important mechanism of arbitrage for stablecoins, as it allows users of protocols like Aave to change their exposure to more favorable interest rates, without any overhead of closing and re-open their position.
In a nascent stablecoin like GHO, this is especially important.
- We have made the code public, so entities with user interfaces supporting Aave can start with the integration.
In the case of app.aave.com from @AaveCompanies, the existing infrastructure for Repay with Collateral, Collateral Swap, and the v2→v3 migration we helped with, should make the integration straightforward.