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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.dforce.network/liquidity-markets/trade.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
