Docs

Overview

Latch docs

Latch is a concentrated-liquidity AMM on Solana where each pool can take one hook program. These pages cover trading and providing liquidity in the app, how hooks work, and how to build on Latch.

Every pool on Latch is a concentrated-liquidity pool. When it is created, a pool may name one hook program and a permission mask. The hook runs at fixed points of every swap and liquidity change, and the mask says which of those points it may use and what it may change. Both are fixed for the life of the pool.

Every pool shares one program and one way of reading accounts, with a different hook in each. A dynamic fee, an on-chain TWAP and a range order ship as built-in hooks. Anything else that fits the interface can be written as a hook, without a new AMM.

Start here#

The built-in hooks#

Build on Latch#

Limits worth knowing first#

Some limits are part of the design:

  • A pool holds at most 64 initialized tick boundaries. Once all 64 are in use, a deposit into a range that needs a new boundary fails.
  • A hook can use at most eight extra accounts, listed literally when the pool is created.
  • Classic SPL tokens are supported, including wrapped SOL and stablecoins such as USDC and USDT. Token-2022 mints, frozen token accounts and token accounts with a delegate or close authority are rejected.
  • Positions belong to the wallet that opened them. They are program accounts, not transferable NFTs.
  • A pool's hook, permissions and caps never change. A different setup is a new pool.