Smart contracts
address
account - owneraddress
debt - token for the loanaddress
collateral - security tokenuint256
amountIn - original amount of the positionuint256
leverage - leverageuint256
collateralAmount - amount for the collateral received after the tradeuint256
borrowAmount - amount of the loan for the redemption of the short-term loan and calculation of the fund
address
fromToken - input tokenaddress
toToken - output tokenuint256
amount - exchange amountstring
targetName - connector namebytes
data - calldata for the exchange
For each position opening, the commission is calculated based on the leveraged transaction amount and the commission set on the contract, the commission can only be changed by the configurator contract.
Position opening and creation of proxy accounts for users
Accounts are created by cloning a proxy contract when a position is opened and the user has no account
Open and closing a position in a token that is not present in the lending protocols, there are methods by which we can make the exchange before opening or after closing a position.
It stores the data of all user accounts and positions.
Is used to take and return flash loans
It works with aave, balancer, maker
The parameters are calculated using the flash resolver contract (in the future they will be calculated on the backend).
Main registry of addresses part of or connected to the protocol.
Sets the addresses for support contracts for interactions with other protocols
Main registry of connector contract addresses.
Used to take and return flash loans
Works with AAVE, Balancer, and Maker
Parameters are calculated using the FlashResolver contract (in the future they will be calculated on the backend).
Calculates the parameters for working with flash aggregator.
Contains the minimal logic for working with external protocols
They are handled by
delegatecall
(There’s a thought of making libraries out of them).
Access control list manager, main registry of system roles and permissions.
Implements the configuration methods for the FlashFlow protocol.
Smart contracts for FlashFlow protocol are available under the MIT License.
Github repository
Last updated