Get Token Quote
Calculates the estimated amount of tokens receivable for a given amount of SOL, based on the current market price.
Endpoint
POST
https://pumpswapapi.fun/api/data/quote
Request Parameters
Parameter | Type | Required | Description |
---|---|---|---|
solAmount | number | Yes | The amount of SOL to be exchanged. |
token | string | Yes | The mint address of the target token. |
Request Body Example
{
"solAmount": 1.5,
"token": "6yMUY2SBA9cKT935FxEDG4oEs8fMx3Tfw8SsyKupVfER"
}
Response Parameters
Parameter | Type | Description |
---|---|---|
tokenAmount | number | The estimated amount of token tokens receivable for solAmount SOL. |
price | number | The price of one token token in SOL, as fetched |
Response Body Example
{
"tokenAmount": 6452299.969789664,
"price": 1.54983e-7
}
Example Usage
Note
The price is fetched from an external oracle and represents the current market rate. The actual executed price may vary due to market volatility and slippage.