Logic contract
Logic acts as the connection between DEFII and external protocols. It's a library where the logic for interacting with external protocols is implemented. When DEFII needs to interact with an external protocol, it uses delegatecall to invoke Logic functions.
Read functions
accountLiquidity
Shows the amount of liquidity locked in an external protocol.
account
address
Address for which to return the amount of liquidity.
Write function
enter
Implements the deposit logic into an external protocol. This can include leverage in a lending protocol, providing liquidity to liquidity pools, and so on. Expects that the smart contract already has a certain amount of input tokens
exit
Implements the logic of exiting from the external protocol.
liquidity
uint256
The amount of liquidity to withdraw from the external protocol.
withdrawLiquidity
Function for withdrawing liquidity from the external protocol directly to the recipient.
recipient
address
Recipient address
amount
uint256
Amount of tokens to withdraw.
emergencyExit
Function for exiting the protocol in emergency situations.
claimRewards
Claims rewards to recipient.
recipient
address
Recipient address
Last updated