# dForce Trade

[dForce Trade](https://trade.dforce.network/) is a DEX aggregator to search for the best trading price and aggregate proper liquidity across multiple platforms to deliver an optimized trade.&#x20;

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.&#x20;

Link: <https://app.dforce.network/#/trade>

Github: <https://github.com/dforce-network>

{% tabs %}
{% tab title="Ethereum Mainnet" %}

| Name         | Contract                                   |
| ------------ | ------------------------------------------ |
| DForceSplit  | 0xC9Ef75CB4C0e3402529d12eD5FFC5206d253Ad60 |
| {% endtab %} |                                            |

{% tab title="Binance Smart Chain" %}

| Name          | Contract                                   |
| ------------- | ------------------------------------------ |
| DForceSplit   | 0x5CD4B2F0891bf450d42aBae62315027a50e0afa3 |
| {% endtab %}  |                                            |
| {% endtabs %} |                                            |

### 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;
```
