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 goal | Start here | Result |
|---|---|---|
| Create a classic SPL token | Token factory | A mint and initial supply; pool creation is a separate operation |
| Open trading at a chosen price | Direct pools | A CLMM pool with an initial square-root price and funded positions |
| Bootstrap trading along a curve | Bonding curve | Virtual-reserve pricing backed by real inventory, then explicit CLMM graduation |
| Apply custom pool rules | First hook | A 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
- Configure the pool. Select ordered mints, initial price, tick spacing, fee bounds, and an optional hook. Read accounts and instructions for the current interface.
- Open a position. Choose aligned lower and upper ticks. Positions explains ownership and range selection.
- 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.
- 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.
- 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.