curl --request POST \
--url 'https://de.raze.sh/api/sol/swap/{mint}?apiKey=' \
--header 'Content-Type: application/json' \
--data '
{
"signer": "62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm",
"type": "buy",
"amountIn": 0.1,
"slippage": 100,
"encoding": "base64"
}
'{
"success": true,
"tx": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArvc8yh6I6K7Q8Y"
}Generate a swap transaction for buying or selling tokens. Returns a serialized transaction that can be signed and submitted to the Solana network.
curl --request POST \
--url 'https://de.raze.sh/api/sol/swap/{mint}?apiKey=' \
--header 'Content-Type: application/json' \
--data '
{
"signer": "62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm",
"type": "buy",
"amountIn": 0.1,
"slippage": 100,
"encoding": "base64"
}
'{
"success": true,
"tx": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArvc8yh6I6K7Q8Y"
}Token mint address
Swap transaction request parameters
Public key of the transaction signer
32"62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm"
Type of swap - buy (SOL to token) or sell (token to SOL)
buy, sell "buy"
Input amount (SOL for buy, tokens for sell). Either amountIn or amountOut is required.
x >= 00.1
Desired output amount (tokens for buy, SOL for sell). Either amountIn or amountOut is required.
x >= 01000000
Slippage tolerance in basis points (0-10000). Default is 100 (0.5%)
1000 <= x <= 10000100
Transaction encoding format. Default is base64.
base64, base58 "base64"
Optional cached quote. If provided, will use this quote instead of fetching a new one.
Show child attributes
Token mint address
"Fyx78ew4wRY26gPj5CkTyuZ4kvW7CkPff5Jm2vNspump"
Pool address
"PoolAddress123456789"
Average price of the token in SOL
0.000001
DEX program ID
"675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"
Slot number when quote was generated
"123456789"
Success - Transaction generated
Swap transaction response
true
Serialized transaction in the requested encoding format (base64 or base58). This transaction must be signed and submitted to the Solana network.
"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArvc8yh6I6K7Q8Y"