Quote an Ondo asset
curl --request GET \
--url https://api.coinlist.co/v1/ondo/swap/quote \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.coinlist.co/v1/ondo/swap/quote"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.coinlist.co/v1/ondo/swap/quote', 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://api.coinlist.co/v1/ondo/swap/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coinlist.co/v1/ondo/swap/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coinlist.co/v1/ondo/swap/quote")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinlist.co/v1/ondo/swap/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"asset_address": "0x14c3abf95cb9c93a8b82c1cdcb76d72cb87b2d4c",
"asset_decimals": 18,
"chain_id": "1",
"object": "ondo_swap_quote",
"price": "225.273151158540753535",
"side": "buy",
"symbol": "AAPLon",
"ticker": "AAPL",
"token_base_units": "5000000000000000000"
}{
"message": "<string>",
"type": "api_error",
"code": "<string>",
"errors": {},
"event_id": "<string>"
}Ondo
Quote an Ondo asset
Prices a buy or sell of an Ondo asset and returns the quantity, the per-token USD price and the decimals the quantity is denominated in. Free to poll while the user edits an order; it consumes no attestation. Takes no chain parameter, since Ondo runs no testnet and every environment prices against Ethereum mainnet.
GET
/
v1
/
ondo
/
swap
/
quote
Quote an Ondo asset
curl --request GET \
--url https://api.coinlist.co/v1/ondo/swap/quote \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.coinlist.co/v1/ondo/swap/quote"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.coinlist.co/v1/ondo/swap/quote', 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://api.coinlist.co/v1/ondo/swap/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.coinlist.co/v1/ondo/swap/quote"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.coinlist.co/v1/ondo/swap/quote")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coinlist.co/v1/ondo/swap/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"asset_address": "0x14c3abf95cb9c93a8b82c1cdcb76d72cb87b2d4c",
"asset_decimals": 18,
"chain_id": "1",
"object": "ondo_swap_quote",
"price": "225.273151158540753535",
"side": "buy",
"symbol": "AAPLon",
"ticker": "AAPL",
"token_base_units": "5000000000000000000"
}{
"message": "<string>",
"type": "api_error",
"code": "<string>",
"errors": {},
"event_id": "<string>"
}Query Parameters
Dollar amount to price, as a decimal string. Exactly one of token_amount or notional_value is required. No CoinList fee is deducted: Ondo prices exactly this amount, so if you are sizing against a user's approval, subtract the fee before passing it here or the quote will overstate what they receive.
Example:
"1000"
Response
Successful response.
Indicative, size- and side-aware price for an Ondo asset. Free to poll and does not consume an attestation.