Help center
  • General Info
    • FlashFlow Overview
    • Price aggregation
    • Liquidity
  • Trading guides
    • How to connect a Wallet
    • How to choose a network
    • How to open and close a trade
    • How to swap coins
    • Order Types
  • Trading Conditions
    • Fees and funding
    • What coins can be collaterals
    • Liquidation
    • PnL calculations
    • Trading assets
  • For developers
    • Smart contracts
  • Referral program
    • Referral program
  • FAQ
    • Can I trust FlashFlow?
    • What makes FlashFlow stand out among other trading protocols?
    • How much is the maximum leverage?
    • Why do I have to confirm my order twice?
    • Do I have to make a deposit to start trading?
    • How does FlashFlow get profit?
    • Is it safe to connect your wallet to FlashFlow?
    • How much do I lose in case of liquidation?
    • Why are there two liquidation prices?
    • What is the 'Claim' feature in the Wallet settings?
  • Terms and policies
    • Terms of use
    • Cookie policy
    • Privacy policy
Powered by GitBook
On this page
  1. For developers

Smart contracts

PreviousTrading assetsNextReferral program

Last updated 2 years ago

:

  • address account - owner

  • address debt - token for the loan

  • address collateral - security token

  • uint256 amountIn - original amount of the position

  • uint256 leverage - leverage

  • uint256 collateralAmount - amount for the collateral received after the trade

  • uint256 borrowAmount - amount of the loan for the redemption of the short-term loan and calculation of the fund

:

  • address fromToken - input token

  • address toToken - output token

  • uint256 amount - exchange amount

  • string targetName - connector name

  • bytes 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.

Github repository

Smart contracts for FlashFlow protocol are available under the .

Positon
SwapParams
Commission calculation
Router
Account
AddressesProvider
Connectors
FlashAggregator
FlashResolver
Connector
ACLManager
Configurator
License
MIT License
https://github.com/Flash-Flow