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"
}
'import requests
url = "https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price"
payload = {
"tokenId": "550e8400-e29b-41d4-a716-446655440000",
"chainSlug": "base-sepolia",
"amount": 100,
"direction": "buy",
"inputToken": "usdc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tokenId: '550e8400-e29b-41d4-a716-446655440000',
chainSlug: 'base-sepolia',
amount: 100,
direction: 'buy',
inputToken: 'usdc'
})
};
fetch('https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tokenId' => '550e8400-e29b-41d4-a716-446655440000',
'chainSlug' => 'base-sepolia',
'amount' => 100,
'direction' => 'buy',
'inputToken' => 'usdc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price"
payload := strings.NewReader("{\n \"tokenId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"chainSlug\": \"base-sepolia\",\n \"amount\": 100,\n \"direction\": \"buy\",\n \"inputToken\": \"usdc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tokenId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"chainSlug\": \"base-sepolia\",\n \"amount\": 100,\n \"direction\": \"buy\",\n \"inputToken\": \"usdc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tokenId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"chainSlug\": \"base-sepolia\",\n \"amount\": 100,\n \"direction\": \"buy\",\n \"inputToken\": \"usdc\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Tokens
Get token price quote
Get a price quote for buying or selling tokens. Automatically uses the appropriate protocol:
- RobinSwap for non-graduated tokens
- UniswapV3 for graduated tokens
Supports flexible quoting:
- Specify amount in tokens or USDC
- Buy or sell direction
- Handles new token initial fee ($5 minimum)
Returns input/output amounts, protocol used, and graduation status.
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"
}
'import requests
url = "https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price"
payload = {
"tokenId": "550e8400-e29b-41d4-a716-446655440000",
"chainSlug": "base-sepolia",
"amount": 100,
"direction": "buy",
"inputToken": "usdc"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tokenId: '550e8400-e29b-41d4-a716-446655440000',
chainSlug: 'base-sepolia',
amount: 100,
direction: 'buy',
inputToken: 'usdc'
})
};
fetch('https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tokenId' => '550e8400-e29b-41d4-a716-446655440000',
'chainSlug' => 'base-sepolia',
'amount' => 100,
'direction' => 'buy',
'inputToken' => 'usdc'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price"
payload := strings.NewReader("{\n \"tokenId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"chainSlug\": \"base-sepolia\",\n \"amount\": 100,\n \"direction\": \"buy\",\n \"inputToken\": \"usdc\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tokenId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"chainSlug\": \"base-sepolia\",\n \"amount\": 100,\n \"direction\": \"buy\",\n \"inputToken\": \"usdc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://yppncslmsswqydhhgygz.supabase.co/functions/v1/token-price")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tokenId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"chainSlug\": \"base-sepolia\",\n \"amount\": 100,\n \"direction\": \"buy\",\n \"inputToken\": \"usdc\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
JWT token or API key
Body
application/json
Token UUID
Example:
"550e8400-e29b-41d4-a716-446655440000"
Blockchain identifier. Supported chains: solana-devnet, base, base-sepolia, avalanche, bnb, bnb-testnet, unichain, unichain-testnet, abstract, polygon, zkSync, zkSync-testnet
Available options:
solana-devnet, base, base-sepolia, avalanche, bnb, bnb-testnet, unichain, unichain-testnet, abstract, polygon, zkSync, zkSync-testnet Example:
"base-sepolia"
Amount to quote (interpretation depends on direction and inputToken)
Required range:
x > 0Example:
100
Trade direction
Available options:
buy, sell Example:
"buy"
Whether amount represents tokens or USDC
Available options:
token, usdc Example:
"usdc"
