dForce | Developers
  • Introduction
  • Lending Protocols
    • Yield Markets
      • Architecture
      • Modules
      • Contracts
      • Security
      • Interface
    • Lending & Synthetic Assets
      • iTokens
      • Controller
      • iMSDTokens
      • MSDController
      • Price Oracle
      • Reward Distribution
      • Security
      • Deployed Contracts
      • Glossary
    • Vaults
  • Liquidity Protocols
    • dForce Trade
    • Liquidity Mining
  • DF Staking
    • Free Staking
    • Lock-up Staking
Powered by GitBook
On this page

Was this helpful?

  1. Liquidity Protocols

dForce Trade

PreviousVaultsNextLiquidity Mining

Last updated 3 years ago

Was this helpful?

is a DEX aggregator to search for the best trading price and aggregate proper liquidity across multiple platforms to deliver an optimized trade.

Currently, dForce Trade has been integrated with 8 DEXes including Uniswap, Curve, Sushiswap, Balancer, Kyber, Oasis, S.Finance, Unisave, with almost 100% coverage of ERC20 token trades.

Link:

Github:

Name

Contract

DForceSplit

0xC9Ef75CB4C0e3402529d12eD5FFC5206d253Ad60

Name

Contract

DForceSplit

0x5CD4B2F0891bf450d42aBae62315027a50e0afa3

How to interact with dForce trade by contract

function getExpectedReturn()

get expected target returns by target token.

function getExpectedReturn(
        IERC20 fromToken,
        IERC20 toToken,
        uint256 amount,
        uint256 parts,
        uint256 flags
    )
        public
        view
        returns(
            uint256 returnAmount,
            uint256[] memory distribution
        );

function swap()

swap tokens by expected returns.

function swap(
        IERC20 fromToken,
        IERC20 toToken,
        uint256 amount,
        uint256 minReturn,
        uint256[] memory distribution,
        uint256 flags
    ) public payable;
dForce Trade
https://app.dforce.network/#/trade
https://github.com/dforce-network