# User Defined Value Types

#### RouteData

`RouteData` is a value type, defined as `uint256`. It is utilized to store compact information about trading route steps in the [vRouter 1.3](/virtuswap-documentation/technical-reference/smart-contracts-v1/dex-contracts/vrouter-1.3.md). The `RouteData` type combines multiple pieces of route-related data into a single `uint256` value for optimized on-chain processing.

The `RouteData` encodes three pieces of information:

* **Transit Start Index** is stored in the most significant **64 bits** (**bits 192-255**). It indicates the index of the first intermediate token in the array of transit tokens addresses of the route.
* **Transit Length** is stored in the next **64 bits** (**bits 128-191**). It represents the number of intermediate tokens in the route step. If set to `type(uint64).max`, it signifies a virtual swap (a case when a swap on the [virtual pool](/virtuswap-documentation/virtuswap-basics/virtuswap-technology.md) will be executed if it is not locked).
* **Amount** is stored in the least significant **128 bits** (**bits 0-127**). It is equal to the token amount involved in the route (`amountIn` for exact in swaps or `amountOut` for exact out swaps).

For direct swaps (through one real pool) the transit length is equal to `0` and transit tokens are ignored.


---

# 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.virtuswap.io/virtuswap-documentation/technical-reference/smart-contracts-v1/dex-contracts/user-defined-value-types.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.
