> For the complete documentation index, see [llms.txt](https://docs.carbondefi.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carbondefi.xyz/contracts-and-functions/carbonvortex-functions/read-functions/tokenprice.md).

# tokenPrice()

```solidity
    function tokenPrice(Token token) external view returns (Price memory price);
        struct Price {
        uint128 sourceAmount;
        uint128 targetAmount;
    }
```

This function allows to identify the current price of the token. Keeping in mind that the price change over time, which means that once you query the price, a moment later it would be a less as more time has passed.

### **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></tbody></table>

### Example

{% code overflow="wrap" %}

```solidity
tokenPrice(
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 //token address
)
returns (
  {
   uint128 sourceAmount; 
   uint128 targetAmount; 
  } 
)

```

{% endcode %}

{% hint style="info" %}
To check ETH, use the following address: *0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE*&#x20;
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.carbondefi.xyz/contracts-and-functions/carbonvortex-functions/read-functions/tokenprice.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
