Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Zap is Meteora’s helper program for position workflows that need token accounting, a supported swap, or a follow-up liquidity action. In practice, Zap has two jobs:
  • Zap In: use tracked token amounts to add liquidity to a supported DAMM v2 or DLMM position flow.
  • Zap Out: detect tokens received during the current flow and swap a selected percentage through a whitelisted route.
Zap runs on the program zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz.
Zap is deliberately narrow. It only supports the instructions and routes described in this section; it is not a general-purpose Solana router.

Core Features

User Ledger

Zap In flows use a user-owned ledger PDA to track token A/B or token X/Y amounts before and after swaps or deposits.

DAMM v2 Zap In

Zap can add DAMM v2 liquidity, optionally swap the surplus side through DAMM v2, then add remaining liquidity again.

DLMM Zap In

Zap can initialize a new DLMM position or deposit into an existing position with Spot, Curve, or Bid-Ask distribution parameters.

Zap Out

Zap can rewrite the amount field in a prepared DAMM v2, DLMM, or Jupiter v6 swap instruction and invoke it for the detected balance increase.

What Zap Supports

AreaSupported by the Zap program
DAMM v2 Zap InAdd liquidity, calculate the surplus side, swap through DAMM v2 swap2, then add remaining liquidity.
DLMM Zap InNew and existing positions through DLMM rebalance_liquidity.
DLMM strategiesSpot, Curve, and BidAsk.
Zap Out routesDAMM v2 swap, DLMM swap2, Jupiter v6 route, and Jupiter v6 shared-account route.
Ledger accountingOne PDA per owner using the user_ledger seed.
Token 2022 transfer feesTransfer-fee-aware net amount calculations in Zap In liquidity math.

What Zap Does Not Do

Zap does not choose the user’s pool, route, quote, position range, or slippage settings. Frontends and integrators still prepare those decisions before calling the program. Zap also does not guarantee the best route or exact final output. Swap execution still depends on pool liquidity, price movement, route accounts, token behavior, and the slippage checks used by the underlying program.

How It Works

Frontend prepares accounts, quote, range, and payload
        |
Zap validates ownership, route type, and supplied limits
        |
Zap updates ledger balances or detects received tokens
        |
Zap CPIs into DAMM v2, DLMM, or a whitelisted Zap Out route
For Zap In, the frontend records the token amounts in a user ledger before calling the DAMM v2 or DLMM Zap In instruction. For Zap Out, the frontend supplies a prepared swap instruction payload, and Zap replaces the amount field with the percentage of tokens received during the current flow.

Product Fit

Zap is useful when a user intent maps cleanly to one of the supported flows:
  • Add liquidity to a DAMM v2 position using amounts already tracked in the ledger.
  • Create a DLMM position and deposit into a selected bin range.
  • Add to or reposition an existing DLMM position with a supported strategy.
  • Claim, withdraw, or otherwise receive tokens, then convert a selected percentage through a supported Zap Out route.
For unsupported AMMs, unsupported Jupiter instructions, custom token behavior, or complex conditional execution, use the underlying program or route directly.

Zap Compatibilities

Review supported instructions, routes, accounts, access controls, and not-fit cases.

Zap Formulas and Limits

See the percentage, slippage, price, and DLMM strategy math used by the program.
Zap simplifies supported workflows, but users still take AMM, route, price movement, and token behavior risk.