Trade tokens [local RPC]

Make trade and sign

Method is used to get trade instructions for local RPC signing. It provides unsigned transaction and returns the transaction in base64 format.

POST /tradeInstructions

Method is used to retrieve the unsigned swap transaction

Headers

NameValue

Content-Type

application/json

x-api-key

The API key for authentication

Parameters

ParameterDescriptionRequired

mode

Mode of the trade (e.g., “buy”, “sell”)

Yes

token

Token to be traded

Yes

amount

Amount of the token to trade (lamports)

Yes

amountInSol

Boolean indicating if amount is in SOL

Yes

slippage

Allowed slippage percentage (basis points)

Yes

priorityFee

Priority fee for the transaction (microlamports)

Yes

public

Public key of buyer/seller/fee payer

Body

Response

{
  "tx": "your_unsigned_transaction"
}

Examples

curl --location 'https://rpc.api-pump.fun/tradeInstructions' \
--header 'Content-Type: application/json' \
--header 'x-api-key: your_api_key' \
--data '{
  "mode": "buy",
  "token": token_contract,
  "amount": 100000,
  "amountInSol": false,
  "slippage": 500,
  "priorityFee": 100000,
  "public": ""
}'

Last updated