# expectedTradeInput()

{% code overflow="wrap" %}

```solidity
    function expectedTradeInput(Token token, uint128 targetAmount) external view returns (uint128 sourceAmount);
```

{% endcode %}

Using this function, one can query the contract indicating the target token amount they would like to receive, and receive an indication of the expected source token amount required.&#x20;

Note that since the rate changes over time, the required amount might reduce with time as the price changes.

### **Function Arguments**

<table><thead><tr><th width="162">Name</th><th width="114.66666666666663">Type</th><th>Description</th></tr></thead><tbody><tr><td>token</td><td>Token</td><td>The token address of the token you would like to trade out of the contract</td></tr><tr><td>targetAmount</td><td>uint128</td><td>The amount of target tokens you would like to receive at the end of the trade</td></tr></tbody></table>

### Example

{% code overflow="wrap" %}

```solidity
expectedTradeInput(
0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c, //token address
4027872880331900000000 //target amount indicated in wei
)
returns (
1000000000000000000 //the required amount of source tokens indicated in wei
)
```

{% endcode %}
