Skip to main content
POST
/
api
/
sol
/
swap
/
{mint}
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"
}

Authorizations

apiKey
string
query
required

Path Parameters

mint
string
required

Token mint address

Body

application/json

Swap transaction request parameters

signer
string
required

Public key of the transaction signer

Minimum string length: 32
Example:

"62ThHC1rs2GUfa8J4Qjcj5GD2MSL2d65pcJtenNieDnm"

type
enum<string>
required

Type of swap - buy (SOL to token) or sell (token to SOL)

Available options:
buy,
sell
Example:

"buy"

amountIn
number
required

Input amount (SOL for buy, tokens for sell). Either amountIn or amountOut is required.

Required range: x >= 0
Example:

0.1

amountOut
number

Desired output amount (tokens for buy, SOL for sell). Either amountIn or amountOut is required.

Required range: x >= 0
Example:

1000000

slippage
integer
default:100

Slippage tolerance in basis points (0-10000). Default is 100 (0.5%)

Required range: 1000 <= x <= 10000
Example:

100

encoding
enum<string>
default:base64

Transaction encoding format. Default is base64.

Available options:
base64,
base58
Example:

"base64"

quote
object

Optional cached quote. If provided, will use this quote instead of fetching a new one.

Response

Success - Transaction generated

Swap transaction response

success
boolean
required
Example:

true

tx
string
required

Serialized transaction in the requested encoding format (base64 or base58). This transaction must be signed and submitted to the Solana network.

Example:

"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArvc8yh6I6K7Q8Y"