Skip to content
Swaps

Build unsigned swap instructions

Currently returns 503 TRADING_NOT_CONFIGURED. The execution bridge is not implemented.

GET
/v1/swap/build

Returns account privileges and instruction bytes for wallet signing when the execution bridge is configured. Currently returns 503 TRADING_NOT_CONFIGURED.

Authorization

IntegrationKey
headerx-api-key<token>

Integration credential issued to your team. All team keys share the same request quota.

Query Parameters

inputMint*string

SPL mint to sell. Paired with outputMint for automatic pool selection.

Match^[1-9A-HJ-NP-Za-km-z]{32,44}$
Formatsolana-address
outputMint*string

SPL mint to receive; must differ from inputMint.

Match^[1-9A-HJ-NP-Za-km-z]{32,44}$
Formatsolana-address
amount*string

Positive u64 token atoms as a decimal string. Input atoms for ExactIn; output atoms for ExactOut. For 6 decimals, 1000000 represents one token.

Match^[1-9][0-9]{0,19}$
Lengthlength <= 20
swapMode?string

ExactIn fixes input and maximizes output; ExactOut fixes output and minimizes input.

Default"ExactIn"
Value in"ExactIn""ExactOut"
slippageBps?integer

Slippage tolerance in basis points: 50 = 0.5%. Sets the returned threshold; does not change which pool has the best nominal quote.

Range0 <= value <= 10000
Default50
taker*string

Wallet that will sign the swap; required for instruction construction.

Match^[1-9A-HJ-NP-Za-km-z]{32,44}$
Formatsolana-address

Response Body

Successful request

application/json
  1. response
success*true
Value intrue
data*
curl -X GET '{GRAPL_API_ORIGIN}/v1/swap/build?inputMint=string&outputMint=string&amount=string&taker=string' \  -H 'x-api-key: {GRAPL_API_KEY}'
Empty

The interactive playground is unavailable because no service origin is configured. Replace {GRAPL_API_ORIGIN} and {GRAPL_API_KEY} with your deployment values, and provide valid values for the schema-generated request inputs before running a sample. Responses without captured examples show Empty; the response schema remains available.

All public endpoints · OpenAPI JSON