What is it?

FlashClose is an additional feature in your dashboard, it allows you to manage your debt position easily by saving you time and operational costs.

We use a flashloan to sell your collateral on Uniswap and repay your outstanding debt in the same transaction. The advantage of this method is that you don't need to be in posession of the assets you have borrowed.


Alice has an active debt position in Fuji DAO, 1 ETH / 1000 USDC. Alice's USDC are currently deposited to Yearn Finance.

Without Flashclose:

In order to close her position, Alice would need to :

  1. withdraw her USDC from Yearn

  2. repay her debt in Fuji DAO

  3. withdraw her collateral

With Flashclose:

Alice doesn't need to witdraw her USDC from Yearn to close her position in Fuji DAO. Instead, Alice just need to call Fuji FlashClose, which closes her position and withdraws the remaining collateral.

Background operations

User Flashclose his ETH/USDC position,

  1. Fuji borrows 1000 USDC with a flashloan

  2. Fuji repays user's debt in Compound (1000 USDC)

  3. Fuji withdraws user's collateral from Compound (1 ETH)

  4. Fuji swaps part of the collateral on Uniswap to obtain 1000 USDC

  5. The remaining collateral is transferred to the user

  6. Fuji burns both collateral and debt token from the user (1 FujiETH / 1000 FujiUSDC).

Last updated