πContract Integration
Find out how to start working with FluidNFT smart contracts.
Modulesβ
The FluidNFT protocol is a collection of smart contracts connected via a modular system. Each module handles a specific aspect of the protocol. Depending on your use case you may need to interact with several different contract addresses.
Some modules are global, for example:
ExecutionDelegate: Grant ERC20, ERC721 & ERC1155 token access across the protocolExecutionManager: Batch requests to save on gasLendingPool: Execute peer-to-pool transactionsLending: Execute peer-to-peer transactions
Some modules are asset-specific, for example:
fTokens: Incentivised ERC-20 tokens that represent assetsstableDebtTokens: Incentivised ERC-20 tokens that represent stable interest rate liabilitiesvariablDebtTokens: Incentivised ERC-20 tokens representing variable interest rate liabilities
Executionβ
As it may be beneficial to batch requests to save on gas all modules can be called using the optional ExecutionManager.
Example of depositing into a lending pool with the execution manager:
// Use the lending pool module:
ILendingPool lendingPool = ILendingPool(LENDING_POOL);
// Deposit asset tokens into a pool
lendingPool.deposit(amount, reserveId, onBehalfOf, referralCode);Without the execution manager:
Note the ExecutionManager supports both .call() and .multiCall() functionality, for batch execution.
The remainder of this document details how to integrate without the execution module, for the sake of brevity.
P2Poolβ
Core peer-to-pool operations.
Deposit and withdrawβ
In order to earn passive yield, you need to deposit into a lending pool.
Use the fToken reserve to check balances.
You can withdraw at anytime to retrieve your funds.
Borrow and repayβ
To borrow an asset, you must supply collateral to be held in escrow for the duration of the loan.
Use the debtToken reserve to check debt balances.
You can repay at anytime to retrieve your collateral.
Liquidateβ
If a loan is no longer sufficiently overcollateralised, i.e. when the amount of outstanding debt exceeds the maximum loan-to-value, it can be liquidated.
The price is determined via a proprietary dynamic-Dutch auction mechanic that results in a high liquidation price when the loan is a little undercollateralised, that decays exponentially as the loan becomes more and more undercollateralised.
The liquidation price is further dependent on the asset being used to purchase the underlying collateral, with smaller and larger discounts available for their reserve's fTokens and stakedToken, respectively.
Last updated