Skip to content
MeteoraAgPublic

About

A Typescript SDK for zapping in and out of tokens from DAMM v2, DLMM or Jupiter

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

Meteora Zap SDK

A Typescript SDK for interacting with the Zap program on Meteora.

Overview

This SDK provides a set of tools and methods to interact with the Zap Program on Meteora. It enables developers to easily zap out of their positions on different AMMs on Solana.

Disclaimer: quotes, Direct routes, and examples

Zap In is a multi-step flow. Intermediate swap transactions are Jupiter (or pool) quotes that the SDK does not economically validate.

  • simulateTransaction with no err only means the swap will land. It does not mean outAmount is a reasonable market vs the input size.
  • Jupiter slippageBps bounds fill vs that quote / that route, not input-vs-output fair value. See Jupiter customer support.
  • Zap-in helpers send Jupiter their slippage argument plus the Jupiter query parameters you pass in the optional jupiterQuoteOptions, and Jupiter uses its own defaults for the rest. A low maxAccounts (the examples use 40 or 50) can return a much thinner route than the Jupiter UI.
  • The Meteora UI applies extra output-amount / USD / extreme-impact checks. This SDK does not. Examples are starting points for specific pools and sizes, not production-safe defaults for every token.

Before sending: compare quoted output to a reference price, reject extreme impact, simulate wallet token deltas, and if the quote is far worse than the Jupiter UI quote, raise maxAccounts or skip the zap.

Installation

npm install @meteora-ag/zap-sdk
# or
pnpm install @meteora-ag/zap-sdk
# or
yarn add @meteora-ag/zap-sdk

Jupiter API Setup

All Jupiter-related functions (getJupiterQuote, getJupiterSwapInstruction, getJupAndDammV2Quotes, and the DLMM estimate functions) support custom API configuration.

API Version

The SDK uses Jupiter Swap API v2 (GET /swap/v2/build) by default. v1 api support is deprecated in this SDK.

Getting Your Jupiter API Key

As of January 31st 2026, Jupiter requires an API key for all api request to https://api.jup.ag/. Obtain your API key at the Jupiter Portal

For detailed setup instructions, see Jupiter's Setup Guide.

API Parameters

All Jupiter functions accept an optional config: ZapConfig:

  • jupiterApiUrl (optional): The Jupiter API endpoint. Default: "https://api.jup.ag"
  • jupiterApiKey (optional): Your Jupiter API key. Default: "" (empty string)
  • jupiterApiVersion (optional): JupiterApiVersion.V2 (default) or JupiterApiVersion.V1 (deprecated)

Note: While the API key parameter is optional in the function signature, Jupiter requires an API key for all requests. Using the default empty string may result in API errors.

Initialization

import { Connection } from "@solana/web3.js";
import { Zap } from "@meteora-ag/zap-sdk";

const connection = new Connection("https://api.mainnet-beta.solana.com");

const zap = new Zap(connection, {
  jupiterApiUrl: "https://api.jup.ag",
  jupiterApiKey: "YOUR_API_KEY_HERE",
  // jupiterApiVersion: JupiterApiVersion.V1, // deprecated, defaults to V2 if unset
});

Usage

Refer to the docs for how to use the functions.

The zap methods return an ordered list of instructions and the address lookup tables they use, not transactions, so you can build legacy or v0 transactions and decide how to split them. See Building Transactions for the instruction order, compute budget and lookup table details.

Program Address

  • Mainnet-beta: zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz
  • Devnet: zapvX9M3uf5pvy4wRPAbQgdQsM1xmuiFnkfHKPvwMiz

License

This SDK is released under the MIT License.

The on-chain Zap program is licensed separately and is not covered by this MIT license.

About

A Typescript SDK for zapping in and out of tokens from DAMM v2, DLMM or Jupiter

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages