Skip to main content
POST
/
token-price
Get token price quote
curl --request POST \
  --url https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "tokenId": "550e8400-e29b-41d4-a716-446655440000",
  "chainSlug": "base-sepolia",
  "amount": 100,
  "direction": "buy",
  "inputToken": "usdc"
}'
{
  "success": true,
  "data": {
    "tokenId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "tokenSymbol": "<string>",
    "tokenName": "<string>",
    "chainSlug": "base-sepolia",
    "direction": "buy",
    "inputToken": "token",
    "inputAmount": 123,
    "outputAmount": 123,
    "inputTokenSymbol": "<string>",
    "outputTokenSymbol": "<string>",
    "protocol": "RobinSwap",
    "isGraduated": true,
    "timestamp": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

JWT token or API key

Body

application/json
tokenId
string<uuid>
required

Token UUID

Example:

"550e8400-e29b-41d4-a716-446655440000"

chainSlug
enum<string>
required

Blockchain identifier

Available options:
base,
base-sepolia
Example:

"base-sepolia"

amount
number
default:1

Amount to quote (interpretation depends on direction and inputToken)

Required range: x > 0
Example:

100

direction
enum<string>
default:sell

Trade direction

Available options:
buy,
sell
Example:

"buy"

inputToken
enum<string>
default:token

Whether amount represents tokens or USDC

Available options:
token,
usdc
Example:

"usdc"

Response

Successful response

success
boolean
required
data
object
required