Self-hosted V6 Swap API

Jupiter provides advanced users to run a self-hosted Jupiter Swap API. You can download the jupiter-swap-api here.

Mission-critical use cases, such as liquidations and oracles, can deploy their own API servers, relying on their own RPC nodes to fully decouple their systems from Jupiter's infrastructure.

Integrators are no longer restricted by public API rate limits with a self-hosted setup.

Prerequisites

A dedicated or shared Solana RPC node is optional but recommended, with access to the Yellowstone gRPC plugin.

The following RPC providers offer RPC nodes with the Geyser plugin:

Usage

To start the API server:

RUST_LOG=info ./jupiter-swap-api --rpc-url <RPC-URL> --yellowstone-grpc-endpoint <GRPC-ENDPOINT> --yellowstone-grpc-x-token <X-TOKEN>

For instance, if you used Triton and your RPC url is https://supersolnode.jup/91842103123091841, the arguments would be --rpc-url https://supersolnode.jup/91842103123091841 --yellowstone-grpc-endpoint https://supersolnode.jup --yellowstone-grpc-x-token 91842103123091841

It is also possible to run the API in poll mode (heavy for nodes and it is not recommended). It will periodically poll the Solana RPC node for accounts rather than listening with the Yellowstone gRPC endpoint:

RUST_LOG=info ./jupiter-swap-api --rpc-url <RPC-URL>

For others options, use --help:

./jupiter-swap-api --help

Once the API server is ready, it will open a HTTP server at 0.0.0.0:8080.

The jupiter-swap-api is identical to the public Jupiter Swap API so all the documentation applies API for Swap, replacing the API URL https://api.jup.ag/swap/v6/quote with http://127.0.0.1:8080.

Market Cache

The Jupiter self-hosted Swap API relies on the market cache at https://cache.jup.ag/markets?v=3, maintained by the Jupiter team, as a snapshot of all relevant markets after liquidity filtering.

To pick up new markets, the API must be restarted. The cache is updated every 30 minutes.

This is the only reliance on Jupiter infrastructure.

Adding New Markets (without restarting)

To pick up new markets without restarting, you can set --enable-add-market when starting the Jupiter self-hosted Swap API. This will create a new endpoint at /add-market. To add a new market without restarting the API, you can post to this endpoint. For example, if you have a new market on Raydium AMM, you would post the following payload to this endpoint:

{
  "address": "EzvDheLRnPjWy3S29MZYEi5qzcaR1WR5RNS8YhUA5WG5",
  "owner": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
  "params": { // Optional
    "serumAsks":"Ac8Hoi4LBbJfG4pCEUu2sS3jkmNrZBv6tbdmEnxAkRsK",
    "serumBids":"CF1NyAZjWqi8t9WZ7pSiqCiTSr3taZ94EW44AjyZRsnY",
    "serumCoinVaultAccount":"65LDE8k8WqhgrZy6NDsVQxGuUq3r8fT8bJunt5WPAZAk",
    "serumEventQueue":"1Xpk12GqjPLS8bkL8XVRHc6nrnunqcJhDha9jUq6Ymc",
    "serumPcVaultAccount":"AKATaDtSNPc5HemQCJzhph7o76Q1ndRHyKwai5C4wFkR",
    "serumVaultSigner":"7xookfS7px2FxR4JzpB3bT9nS3hUAENE4KsGaqkM6AoQ"
  },
  "addressLookupTableAddress":"5tVPTN4afHxuyS8CNCNrnU7WZJuYeq5e2FvxUdCMQG7F" // Optional
}

To derive the parameters, you can refer to the Serum documentation.

MacOS

On MacOS, you may encounter this error message:

“jupiter-swap-api” can’t be opened because Apple cannot check it for malicious software.

To resolve this, go to System Settings and click Open Anyway.

Advanced

If a set of AMMs is not needed for routing, they can be removed before starting the API to reduce load.

To create a market cache excluding a specific program (e.g., Openbook in this example):

curl "https://cache.jup.ag/markets?v=3" -o market-cache.json
jq 'map(select(.owner != "srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"))' market-cache.json > market-cache-no-openbook.json

Then:

RUST_LOG=info ./jupiter-swap-api --market-cache market-cache-no-openbook.json ...

This will start the API server without Openbook as part of the routing. You can also remove individual markets as needed.

Paid Hosted APIs

We are working with several Solana RPC partners in the ecosystem to provide paid hosted APIs run by them.