# pair()

{% code title="CarbonController.sol" overflow="wrap" lineNumbers="true" %}

```solidity
    function pair(Token token0, Token token1) external view returns (Pair memory);
```

{% endcode %}

This function is used to get the metadata for the pair of the indicated tokens. This includes the ID of the pair, token0, and token1.&#x20;

### **Function Arguments**

<table><thead><tr><th width="175">Name</th><th width="142.66666666666663">Type</th><th>Description</th></tr></thead><tbody><tr><td>token0</td><td>Token</td><td>The first token address. </td></tr><tr><td>token1</td><td>Token</td><td>The second token address.</td></tr></tbody></table>

### Returns

This function returns a Pair object, containing the pair ID and the addresses of token0 and token1.

<table><thead><tr><th width="187">Name</th><th width="118.66666666666663">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>uint256</td><td>The ID of the pair </td></tr><tr><td>token0</td><td>Token</td><td>The first token address </td></tr><tr><td>token1</td><td>Token</td><td>The second token address</td></tr></tbody></table>

### Example

<pre><code>pair(
 0x514910771AF9Ca656af840dff83E8264EcF986CA, //token0
 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE //token1
)

// Returns:
// struct Pair {
//    uint128 id;
//    Token[2] tokens;
<strong>// }
</strong></code></pre>

{% hint style="info" %}
For the ETH token, use the contract address: *0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE*&#x20;
{% endhint %}


---

# 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/carboncontroller-functions/read-functions/pair.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.
