# Liquidity Pool Architecture

## Introducing

InterLink Liquidity Pools are on-chain smart contract systems deployed on the InterLink blockchain, implementing an automated liquidity protocol based on a constant product formula. Each InterLink liquidity pair maintains pooled reserves of two assets and provides decentralized liquidity for those assets while enforcing the invariant that the product of the reserves cannot decrease.

<figure><img src="https://2726550812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjMO51gfM0FaNC6SfYbCR%2Fuploads%2FOn8FUtfPjulnhjX4P0Ox%2FV1%20(2).png?alt=media&#x26;token=b2fb7862-688f-4f50-832c-54a23e095525" alt=""><figcaption></figcaption></figure>

Each liquidity pool consists of two assets:

```
IRC20 Token / ITL
```

\
Where ITL functions as the base settlement asset of the InterLink ecosystem and IRC20 tokens represent tokenized digital assets issued within the network.

Liquidity providers deposit both assets into the pool, receiving liquidity tokens that represent their proportional share of the pool’s reserves.

Traders interact with the pool by executing swaps between the two assets. All trades follow the invariant:

```
x · y = k
```

Where:

* x represents the reserve quantity of the IRC20 asset
* y represents the reserve quantity of ITL
* k represents the constant product maintained by the liquidity pool

The protocol enforces this invariant to ensure that each trade adjusts the relative price of the assets according to available liquidity.

Each swap includes a protocol fee, which is distributed between liquidity providers and the protocol’s revenue allocation mechanism. This fee structure supports the operation of the Transaction-Backed Digital Assets Protocol, where a portion of transaction value can be automatically routed into liquidity pools to purchase tokenized assets associated with participating businesses.

Unlike traditional order book markets, InterLink liquidity pools enable continuous price discovery through algorithmic market making. This approach allows liquidity to remain available without requiring centralized market makers.

The InterLink liquidity architecture enables the creation of arbitrary IRC20/ITL trading pairs, allowing tokenized digital assets issued within the ecosystem to access on-chain liquidity immediately upon deployment.

Liquidity pools are instantiated through a factory contract, which creates pair contracts responsible for holding reserves and executing swaps. To simplify user interaction, swaps and liquidity operations are typically executed through a router contract, which calculates optimal trade routes and transfers funds to the underlying pair contracts.

This architecture allows the InterLink ecosystem to support decentralized liquidity infrastructure while anchoring all asset pairs to the InterLink token as the network’s base settlement asset.
