Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Lend: Switch Lending Position to Borrowing Collateral Position #238

Open Markoyw opened 1 year ago

brozorec commented 1 year ago

In the background, we move the user's position from vault1 (Lending) to vault2 (Borrowing). That operation can also happen cross-chain.

Ex.: Alice deposited in the past some WETH in a Lending Vault to earn a yield on Ethereum. She now needs USDC to participate in a farm on Arbitrum. Fuji moves the WETH to a borrowing vault, where it gets deposited as collateral, and we borrow the required USDC and hand it over to Alice on Arbitrum. Alice can choose the borrowing vault where Fuji her collateral:

  1. deposit+borrow from a vault on Ethereum and transfer the borrowed amount to Arbitrum or
  2. transfer WETH from Ethereum to Arbitrum and deposit+borrow on Arbitrum

This operation is similar to #239 in a way that we switch one vault for another.

@Markoyw