# V2 DEX

A UniV2-style DEX is a type of platform that operates as an Automated Market Maker (AMM), enabling users to trade cryptocurrencies directly through liquidity pools without the need for intermediaries or traditional order books.

The liquidity pools dynamically adjust token prices based on the supply of liquidity and the demand for swapping tokens within each pool.

The underlying smart contract algorithm used in these pools follows the formula: a \* b = k, where:

'a' represents the quantity of one token in the pool.

'b' represents the quantity of another token in the pool.

'k' is a constant value.

As the quantity of one token (a) increases, the quantity of the other token (b) decreases to maintain the constant product (k).

This mechanism ensures that the relative token prices within the pool automatically adjust based on the ratio of tokens present.

Users can have the opportunity to become market makers by providing liquidity to the existing pools.

Furthermore, UniV2-style DEXs offer flexibility for users to create their own custom pools or introduce new token pairs that are not currently available.


---

# 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.linehub.io/linehub-products/spot-and-perpetual-trading/v2-dex.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.
