Docs

Overview

Socket docs

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

Every pool on Socket 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 Socket#

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.
  • Only classic SPL tokens are supported, including wrapped SOL. Token-2022 mints, mints with a freeze authority and token accounts with a delegate or close authority are rejected. Several major stablecoins keep a freeze authority, so they can't be pooled.
  • 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.