# Router

The router is used to deploy new vaults, pools, and farms, as well as to retrieve addresses for all three.\
**Note:** Swaps and liquidity actions do **not** interact with the router. Instead, these operations are handled directly via vaults to reduce transaction bottlenecks and increase throughput.

***

## Interface

### `get_vault_address`

Returns the vault address for a given token mint.

**Arguments**

| Data Type | Description        |
| --------- | ------------------ |
| `slice`   | Token mint address |

**Returns**

| Data Type | Description         |
| --------- | ------------------- |
| `slice`   | Token vault address |

***

### `get_pool_manager_address`

Returns the pool manager address for a given token pair, tick size, and fee parameters.

**Arguments**

| Data Type | Description          |
| --------- | -------------------- |
| `slice`   | Token0 vault address |
| `slice`   | Token1 vault address |
| `int`     | Tick size            |
| `int`     | LP fee               |
| `int`     | Protocol fee         |
| `int`     | Referral fee         |

**Returns**

| Data Type | Description          |
| --------- | -------------------- |
| `slice`   | Pool manager address |

***

### `get_pool_address`

Returns the pool address for a given pair of vaults, tick size, fee parameters, and pool index.

**Arguments**

| Data Type | Description          |
| --------- | -------------------- |
| `slice`   | Token0 vault address |
| `slice`   | Token1 vault address |
| `int`     | Pool index           |
| `int`     | Tick size            |
| `int`     | LP fee               |
| `int`     | Protocol fee         |
| `int`     | Referral fee         |

**Returns**

| Data Type | Description  |
| --------- | ------------ |
| `slice`   | Pool address |

***

### `get_num_farms`

Returns the number of deployed farms.

**Arguments**

*None*

**Returns**

| Data Type | Description              |
| --------- | ------------------------ |
| `int`     | Number of deployed farms |

***

### `get_farm_address`

Returns the farm address for a given farm index.

**Arguments**

| Data Type | Description |
| --------- | ----------- |
| `int`     | Farm index  |

**Returns**

| Data Type | Description  |
| --------- | ------------ |
| `slice`   | Farm address |

***

### `get_router_data`

Returns router metadata.

**Arguments**

*None*

**Returns**

| Data Type | Description      |
| --------- | ---------------- |
| `int`     | Is router locked |
| `slice`   | Admin address    |

***

## Messages

### Deploy Vault

```plaintext
Opcode: 0x89ed7fbb
```

**Body Format**

| Data Type | Description         |
| --------- | ------------------- |
| `Uint32`  | Opcode              |
| `Uint64`  | Query ID            |
| `slice`   | Jetton mint address |

***

### Deploy Pool

```plaintext
Opcode: 0xc2fd3731
```

**Body Format**

| Data Type | Description           |
| --------- | --------------------- |
| `Uint32`  | Opcode                |
| `Uint64`  | Query ID              |
| `Address` | Vault0 address        |
| `Address` | Vault1 address        |
| `Int32`   | Pool min tick (index) |
| `Int32`   | Initial tick          |
| `Uint32`  | Tick size             |
| `Uint8`   | LP fee                |
| `Uint8`   | Protocol fee          |
| `Uint8`   | Referral fee          |
| `Address` | Protocol fee address  |

***

### Deploy Farm

```plaintext
Opcode: 0x5961da05
```

**Body Format**

| Data Type | Description                    |
| --------- | ------------------------------ |
| `Uint32`  | Opcode                         |
| `Uint64`  | Query ID                       |
| `Address` | Pool manager address           |
| `Address` | Farm reward token mint address |
| `Uint64`  | Reward period start timestamp  |
| `Uint64`  | Reward period end timestamp    |
| `Cell`    | Admin address cell             |
| `Address` | Farm admin address             |


---

# 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.titan.tg/colossus-concentrated-liquidity-amm/smart-contracts/router.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.
