Skip to main content
This guide shows how to install and initialize the official Zap TypeScript SDK, @meteora-ag/zap-sdk. Before you begin, here are the main resources:

TypeScript SDK

Zap TypeScript SDK repository.

Zap NPM Package

Published package for transaction builders, state reads, PDA helpers, and examples.

Install

To use the SDK in your project, install it with your preferred package manager:

Dependencies

Create A Client

jupiterApiUrl and jupiterApiKey are optional in the SDK constructor. Pass them whenever your Jupiter endpoint requires authenticated quote or swap-instruction requests. You can get the API key from Jupiter Developer Portal.

Program ID

The SDK also exports ZAP_PROGRAM_ID, DAMM_V2_PROGRAM_ID, DLMM_PROGRAM_ID, JUP_V6_PROGRAM_ID, and MEMO_PROGRAM_ID.

Transaction Model

Zap builders return unsigned Transaction objects. The caller is responsible for fee payer, blockhash, signing, simulation, and submission. For zap-in flows, preserve this order. The ledger stores intermediate token amounts that the following Zap instruction consumes.
Zap In is not a single instruction. It is a multi-step sequence (setup → swap → ledger → zap-in → cleanup). The swap leg is a Jupiter (or pool) quote that your integration must validate before signing.
  • simulateTransaction passing only means the swap will not revert. It does not mean the quoted outAmount is a reasonable market price for the input size.
  • Jupiter slippage bounds execution against that quote / that route, not input-vs-output fair value. See Jupiter customer support.
  • Direct zap-in estimators currently request Jupiter with onlyDirectRoutes=true and maxAccounts around 50. That can return a much thinner route than the Jupiter UI, which does not apply those limits.
  • The Meteora UI applies extra output-amount / USD / extreme-impact checks. The SDK does not. Copying an example is not a production guardrail for every pool or size.
Before submitting, compare quoted output to a reference price, reject extreme price impact, and simulate token balance deltas (not only err). If Direct is far worse than a multi-hop quote, fall back to broader routing (onlyDirectRoutes=false) or skip the zap.

Supported SDK Workflows

Testing the SDK

If you have cloned the SDK repository, start with package-level checks and tests: