Skip to content

Build with grapl

Choose a market, follow its liquidity lifecycle, and connect your application.

grapl provides the on-chain primitives for tokens, pools, positions, and swaps. Start with the market you need, then add a hook if your application needs custom behavior. Each path links the product behavior to its account and instruction contract.

Choose your market

Your goalStart hereResult
Create a classic SPL tokenToken factoryA mint and initial supply; pool creation is a separate operation
Open trading at a chosen priceDirect poolsA CLMM pool with an initial square-root price and funded positions
Bootstrap trading along a curveBonding curveVirtual-reserve pricing backed by real inventory, then explicit CLMM graduation
Apply custom pool rulesFirst hookA pool rule implemented through authenticated callbacks

Direct pools and graduated pools use the same CLMM core. The curve path preserves the pool and hook at graduation; it does not create a second AMM program.

Follow the liquidity lifecycle

  1. Configure the pool. Select ordered mints, initial price, tick spacing, fee bounds, and an optional hook. Read accounts and instructions for the current interface.
  2. Open a position. Choose aligned lower and upper ticks. Positions explains ownership and range selection.
  3. Fund it. Add liquidity with token limits. An active range requires both assets; a range entirely outside the current price can take one asset. Follow LP lifecycle.
  4. Trade or rebalance. Use ExactIn or ExactOut. A zap can combine a swap with a liquidity change on an existing position; the client chooses the split.
  5. Remove and collect. Withdraw principal and claim position fees as separate actions. Fee accounting explains what belongs to the position.

Connect your application

The client-input example handles exact token parsing and formatting. It is not a complete transaction SDK. Build instructions from the current IDL and use the source map to find the implementation of each operation.

For routed swaps, read Metis integration before selecting a hook. Native execution and a usable route quote have different requirements.

Confirm the result

Begin with your first integration, then validate each operation. Reconcile balances, position state, and hook effects against the user’s intent.