Relatick
How pools work

Extensions

Extensions add rules before or after pool actions: they can control access, check a trade's effect on liquidity, record trades for future pricing, block all trading and more.

Curators can reuse existing extensions or build their own.

Extensions can't change the pool's quote; they can only reject a trade. A custom extension therefore can't manipulate the quote of the current trade.

Where extensions run

Pool action
Extension points
Swap
Before or after the swap
Deposit
Before or after adding liquidity
Withdrawal
Before or after removing liquidity

For swaps for example, quote validation comes before the before-swap extensions; extensions cannot replace that quote for the current swap. After-swap extensions can inspect token amounts and pool state.

A rejection at either stage reverts the pool action, including token transfers.

Standard extensions

Extension
What it controls
StopLoss
Rejects swaps when a bin's value per LP share, in tokens rather than USD, drops too far below its recorded peak. The peak decays over time.
Velocity Guard
Rejects swaps when the reference price moves too fast.
Deposit allowlist
Limits who can deposit into a pool.

Settings matter

StopLoss values each bin at the Price Provider's bid and ask and tracks its peak: the highest value per LP share it has recorded. The drawdown setting decides how far below the peak a swap may take the bin; decay lowers the peak over time, so an old peak doesn't block the bin forever.

If a bin has no baseline, its first monitored trade initializes one without this drawdown check.

StopLoss rejects trades; it does not sell an LP's position or cap all losses. Ordinary market movements can trigger it.

Velocity Guard checks changes in the supplied reference, not ordinary price impact from crossing bins. Its allowance and comparison anchor can be changed by the pool admin.

Attaching a guard does not prove it is enabled. Check its settings and who can change them.

Fixed addresses, changeable behavior

Extension addresses and execution order are fixed at pool creation. Settings or code may remain changeable unless restricted.

A custom withdrawal extension can block LP exits. Before depositing, review its code and who can change it.

Risks and safeguards · Pool tiers · Build an extension

Last updated 29 days ago