# expectedTradeReturn()

{% code overflow="wrap" %}

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

{% endcode %}

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

Note that since the rate changes over time, the target amount of tokens might grow 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>sourceAmount</td><td>uint128</td><td>The amount of source tokens you are willing to trade out of your wallet against the indicated token</td></tr></tbody></table>

### Example

{% code overflow="wrap" %}

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

{% endcode %}


---

# 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://docs.carbondefi.xyz/contracts-and-functions/carbonvortex-functions/read-functions/expectedtradereturn.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.
