Skip to main content
Track Zap releases here.
DLMM Pro Zap-In and Zap-Out

Release summary

What We Shipped

  • Zap in to a new DLMM Pro position with zap_in_dlmm_pro
  • Zap out through a DLMM Pro swap
  • TypeScript SDK 2.1.0

What To Do

IntegratorsWhat ChangedWhat To Do
Partners
  • New endpoint zap_in_dlmm_pro opens a DLMM Pro position and deposits weighted tick ranges in one instruction
  • Optional leftover ranges, max_tick_slippage, and min_multiplier
  • zap_out accepts a DLMM Pro swap
  • Use @meteora-ag/zap-sdk@2.1.0 or later. It depends on @meteora-ag/dlmm-pro-sdk.
  • Estimate with estimateDlmmProDirectSwap or estimateDlmmProIndirectSwap. Pass the returned pool tick as the tick the ranges were built against, and derive minMultiplier from the returned multiplier.
  • Build with getZapInDlmmProDirectParams or getZapInDlmmProIndirectParams, then buildZapInDlmmProTransaction. Pass ranges with weights, for example from buildLiquidityShape. The position NFT mint must sign.
  • Set maxTickSlippage. Set minMultiplier when a range bound sits close to the price. A move inside a single tick can change the multiplier many times over, and the zap in fails with ExceededSlippage when the multiplier is below minMultiplier.
  • Call zapOutThroughDlmmPro to zap out through a DLMM Pro pool (dPro1D5wiqnGMH8vMDG23jh35btTHoWdyqXjqkqxe8n).
  • Upgrading from SDK 1.x includes the 2.0.0 breaking changes: builders return ZapInstructionsResponse (instructions and addressLookupTableAccounts), and Jupiter API v2 is the default. Read the SDK 2.0.0 notes before upgrading.

Program: zap 0.3.0

Program ID (mainnet and devnet): zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz

Added

  • Added endpoint zap_in_dlmm_pro. It opens a DLMM Pro position for the given tick ranges and adds multiplier * weight liquidity to every range in one deposit, sized by the largest multiplier both ledger balances can fund. The binding side is used up.
  • The other side’s leftover goes into its single-sided range on the optional leftover (range_x above the price, range_y below it), and only that range is opened, after the shape ranges. With no leftover, that balance stays in the ledger.
  • A leftover range is given by its bound next to the price (inner_tick_id) and away from it (outer_tick_id). With leftover.is_inner_tick_relative, inner_tick_id is a distance in tick spacing away from the price, from the closest tick a single-sided range can start at for the pool tick at execution, so the leftover ranges start next to the price. With leftover, the tick arrays can be passed in any order, and extra accounts are allowed.
  • max_tick_slippage is the maximum distance between the pool tick at execution and current_tick_id. The optional min_multiplier fails the instruction with ExceededSlippage when the multiplier at execution is below it. A move inside a single tick can change the multiplier many times over when a range bound sits close to the price.
  • Range bounds and the leftover outer_tick_id must be within DLMM Pro’s min and max tick ([-443636, 443636]).
  • zap_out supports swapping through DLMM Pro (dPro1D5wiqnGMH8vMDG23jh35btTHoWdyqXjqkqxe8n) swap.

Changed

  • Updated Anchor to 1.2.1 (solana-v4 crates), Solana to 4.1.2, and Rust to 1.95.0. The program is built with platform-tools v1.57 for SBPF v3.
  • Bumped the damm-v2 (cp-amm) dependency to the Anchor 1.2.1 revision.

TypeScript SDK: @meteora-ag/zap-sdk 2.1.0

SDK PR #41

Added

  • Support for Zap program 0.3.0: endpoint zap_in_dlmm_pro, and zap_out swaps through DLMM Pro.
  • zapOutThroughDlmmPro zaps out by swapping through a DLMM Pro pool.
  • getZapInDlmmProDirectParams, getZapInDlmmProIndirectParams, and buildZapInDlmmProTransaction zap in to a new DLMM Pro position. The position is given as tick ranges with weights, for example the ranges from buildLiquidityShape of @meteora-ag/dlmm-pro-sdk. maxTickSlippage and the optional minMultiplier bound the price slippage, and the optional leftover ranges take what the ranges leave of the token that is not used up. The position NFT mint passed to buildZapInDlmmProTransaction must sign the zap-in transaction.
  • estimateDlmmProDirectSwap and estimateDlmmProIndirectSwap size the swaps of a DLMM Pro zap in. They also return the pool tick and the multiplier expected when the zap in executes, to pass as the tick the ranges were built against and to derive minMultiplier from.
  • getDlmmProZapInMultiplier, which mirrors how the program sizes the deposit, and getDlmmProZapInTickArrays, which returns the tick arrays the zap in needs, including the ones the leftover ranges can resolve to.
  • Helpers getDlmmProSwapInstruction, getDlmmProTickArraysForSwap, getDlmmProDepositTransferHookAccounts, and deriveDlmmProEventAuthority.
  • Constants DLMM_PRO_PROGRAM_ID and AMOUNT_IN_DLMM_PRO_OFFSET.
  • Examples zapInDlmmProDirect, zapInDlmmProIndirect, and zapOutThroughDlmmPro.

Changed

  • Added the dependency @meteora-ag/dlmm-pro-sdk.
  • The IDL of release 0.3.0 names the types it shares between the pool programs after their program. In ZapTypes, remainingAccountsInfo, remainingAccountsSlice, and accountsType are now dlmmDlmmTypesRemainingAccountsInfo, dlmmDlmmTypesRemainingAccountsSlice, and dlmmDlmmTypesAccountsType, and pool is now cpAmmStatePoolPool. The methods of the SDK take the same arguments as before.
Jupiter route_v2 for zap-out, and amount_in offset derived from the AMM

Release summary

What We Shipped

  • Whitelisted Jupiter route_v2 and shared_account_route_v2 for zap_out
  • zap_out now derives the amount_in offset from the AMM program and its instruction discriminator
  • Updated Anchor to 1.0.2
  • Deprecated Jupiter route and shared_account_route in favor of the v2 routes. Both stay whitelisted for zap_out
  • offset_amount_in in ZapOutParameters is ignored. The field stays in the instruction layout

Program: zap 0.2.3

Program ID (mainnet and devnet): zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz

Changed

  • Update anchor to 1.0.2
  • Endpoint zap_out now derives the offset of amount_in in the swap payload from the amm program and its instruction discriminator, instead of reading it from ZapOutParameters.

Added

  • Add Jupiter’s route_v2 and shared_account_route_v2 as whitelisted instructions for zap_out

Deprecated

  • Jupiter’s route and shared_account_route are deprecated in favor of route_v2 and shared_account_route_v2. They remain whitelisted for zap_out for backward compatibility.
  • offset_amount_in in ZapOutParameters is ignored. It remains in the instruction layout for backward compatibility.
Support Zap-In to damm-V2 Compounding Pool Fee Mode and single-sided damm-v2 pool

Release summary

What We Shipped

  • Support Zap-In to damm-V2 Compounding Pool Fee Mode
  • Support Zap-In to single-sided damm-v2 pool

What To Do

IntegratorsWhat ChangedWhat To Do
Partners
  • Support Zap-In to damm-V2 Compounding Pool Fee Mode and single-sided damm-v2 pool
  • Bump your SDK version to @meteora-ag/zap-sdk@1.3.0 to start testing.

Program: zap 0.2.2

Program ID (mainnet and devnet): zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz

Added

  • Add support for damm-v2 pool with Compounding fee mode

Fixed

  • Fix zap in to single-sided damm-v2 pool. A single-sided pool is a pool fully contains only one token in the pool pair, either fully token a (sqrt_price at sqrt_min_price) or fully token b (sqrt_price at sqrt_max_price)

TypeScript SDK: @meteora-ag/zap-sdk 1.3.0

SDK PR #30

Added

  • Support Zap-In to damm-V2 Compounding Pool Fee Mode.
  • Support Zap-In to single-sided damm-v2 pool. A single-sided pool is a pool that fully contains only one token of the pool pair, either fully token A (sqrt_price at sqrt_min_price) or fully token B (sqrt_price at sqrt_max_price).

Fixed