Most swap APIs either hold your keys or ask for a subscription. This one does neither: you ask for a quote, get an unsigned transaction for your own address, sign it in your own code and send it back for execution. Calling the API is free, and Ambolt never holds keys or funds.
The three calls
curl "https://api.ambolt.dev/api/swap/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=10000000"
- Quote returns the expected output, the minimum after slippage, price impact, route and the fee, which is already included.
-
Build (
POST /api/swap/buildwithtakerset to your address) returns an unsigned base64 transaction and arequestId. -
Execute (
POST /api/swap/executewith the signed transaction and therequestId) returns the result and the signature.
Signing with your own key
import { Keypair, VersionedTransaction } from "@solana/web3.js";
import bs58 from "bs58";
const keypair = Keypair.fromSecretKey(bs58.decode(process.env.SOLANA_SECRET_KEY));
const built = await post("build", { inputMint, outputMint, amount: "10000000", slippageBps: 50, taker: keypair.publicKey.toBase58() });
const tx = VersionedTransaction.deserialize(Buffer.from(built.transaction, "base64"));
tx.sign([keypair]);
const result = await post("execute", { signedTransaction: Buffer.from(tx.serialize()).toString("base64"), requestId: built.requestId });
The SDKs wrap the three calls (ambolt.swap.quote, build, execute), and the guide has the same flow in Python and for browser wallets.
Before you sign
- The build response has
checks:takerInTransactionandunsignedmust both be true. - The fee payer must be your own address. Never sign a transaction whose fee payer is someone else.
- Quotes are indicative and move with every block.
Limits
The API is rate limited per IP address (a 429 carries Retry-After). It is not investment advice and not a recommendation to trade any token; prices move, tokens can lose value and swaps can fail.
Top comments (0)