> For the complete documentation index, see [llms.txt](https://docs.virtuswap.io/virtuswap-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.virtuswap.io/virtuswap-documentation/technical-reference/smart-contracts-v1/dex-contracts/user-defined-value-types.md).

# User Defined Value Types

User Defined Value Types used in VirtuSwap DEX contracts

#### 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.
