curl --request POST \
--url http://localhost:8000/api/v1/market/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_asset": {
"asset_id": "BTC",
"layer": "BTC_LN",
"amount": 1500000
},
"to_asset": {
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"layer": "RGB_LN"
}
}
'import requests
url = "http://localhost:8000/api/v1/market/quote"
payload = {
"from_asset": {
"asset_id": "BTC",
"layer": "BTC_LN",
"amount": 1500000
},
"to_asset": {
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"layer": "RGB_LN"
}
}
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({
from_asset: {asset_id: 'BTC', layer: 'BTC_LN', amount: 1500000},
to_asset: {
asset_id: 'rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB',
layer: 'RGB_LN'
}
})
};
fetch('http://localhost:8000/api/v1/market/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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/market/quote",
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([
'from_asset' => [
'asset_id' => 'BTC',
'layer' => 'BTC_LN',
'amount' => 1500000
],
'to_asset' => [
'asset_id' => 'rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB',
'layer' => 'RGB_LN'
]
]),
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 := "http://localhost:8000/api/v1/market/quote"
payload := strings.NewReader("{\n \"from_asset\": {\n \"asset_id\": \"BTC\",\n \"layer\": \"BTC_LN\",\n \"amount\": 1500000\n },\n \"to_asset\": {\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"layer\": \"RGB_LN\"\n }\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("http://localhost:8000/api/v1/market/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_asset\": {\n \"asset_id\": \"BTC\",\n \"layer\": \"BTC_LN\",\n \"amount\": 1500000\n },\n \"to_asset\": {\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"layer\": \"RGB_LN\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/market/quote")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_asset\": {\n \"asset_id\": \"BTC\",\n \"layer\": \"BTC_LN\",\n \"amount\": 1500000\n },\n \"to_asset\": {\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"layer\": \"RGB_LN\"\n }\n}"
response = http.request(request)
puts response.read_body{
"rfq_id": "13d4777c-ae96-4858-9c7c-3ca730c5039a",
"from_asset": {
"asset_id": "BTC",
"name": "Bitcoin",
"ticker": "BTC",
"layer": "BTC_LN",
"amount": 1500000,
"precision": 8
},
"to_asset": {
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"name": "Tether USD",
"ticker": "USDT",
"layer": "RGB_LN",
"amount": 875000,
"precision": 6
},
"price": 59507000000,
"fee": {
"base_fee": 1000,
"variable_fee": 250,
"fee_rate": 0.0001,
"final_fee": 1250,
"fee_asset": "BTC",
"fee_asset_precision": 8
},
"timestamp": 1715896356,
"expires_at": 1715896416
}{
"detail": "Route not supported for this pair. From: BTC_LN, To: RGB_LN"
}{
"error": "missing_api_key"
}{
"error_code": "PAIR_NOT_FOUND",
"message": "Trading pair not found: BTC/USDT",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"detail": [
{
"loc": [
"body",
"rfq_id"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"error_code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"details": {
"retry_after": 60
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "INTERNAL_ERROR",
"message": "Internal Server Error",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "SERVICE_UNAVAILABLE",
"message": "Trading service is starting up. Please try again in a few moments.",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}Request market quote
Request an RFQ-backed quote for a route between two asset legs. A successful response returns an rfq_id that can be consumed by atomic swap initiation until the quote expires.
curl --request POST \
--url http://localhost:8000/api/v1/market/quote \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from_asset": {
"asset_id": "BTC",
"layer": "BTC_LN",
"amount": 1500000
},
"to_asset": {
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"layer": "RGB_LN"
}
}
'import requests
url = "http://localhost:8000/api/v1/market/quote"
payload = {
"from_asset": {
"asset_id": "BTC",
"layer": "BTC_LN",
"amount": 1500000
},
"to_asset": {
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"layer": "RGB_LN"
}
}
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({
from_asset: {asset_id: 'BTC', layer: 'BTC_LN', amount: 1500000},
to_asset: {
asset_id: 'rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB',
layer: 'RGB_LN'
}
})
};
fetch('http://localhost:8000/api/v1/market/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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/market/quote",
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([
'from_asset' => [
'asset_id' => 'BTC',
'layer' => 'BTC_LN',
'amount' => 1500000
],
'to_asset' => [
'asset_id' => 'rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB',
'layer' => 'RGB_LN'
]
]),
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 := "http://localhost:8000/api/v1/market/quote"
payload := strings.NewReader("{\n \"from_asset\": {\n \"asset_id\": \"BTC\",\n \"layer\": \"BTC_LN\",\n \"amount\": 1500000\n },\n \"to_asset\": {\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"layer\": \"RGB_LN\"\n }\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("http://localhost:8000/api/v1/market/quote")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from_asset\": {\n \"asset_id\": \"BTC\",\n \"layer\": \"BTC_LN\",\n \"amount\": 1500000\n },\n \"to_asset\": {\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"layer\": \"RGB_LN\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/market/quote")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_asset\": {\n \"asset_id\": \"BTC\",\n \"layer\": \"BTC_LN\",\n \"amount\": 1500000\n },\n \"to_asset\": {\n \"asset_id\": \"rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB\",\n \"layer\": \"RGB_LN\"\n }\n}"
response = http.request(request)
puts response.read_body{
"rfq_id": "13d4777c-ae96-4858-9c7c-3ca730c5039a",
"from_asset": {
"asset_id": "BTC",
"name": "Bitcoin",
"ticker": "BTC",
"layer": "BTC_LN",
"amount": 1500000,
"precision": 8
},
"to_asset": {
"asset_id": "rgb:2NZGjyz-pJePUgegh-RLHbpx1Hy-iZMagWiZZ-qY4AxGymW-yCEYwwB",
"name": "Tether USD",
"ticker": "USDT",
"layer": "RGB_LN",
"amount": 875000,
"precision": 6
},
"price": 59507000000,
"fee": {
"base_fee": 1000,
"variable_fee": 250,
"fee_rate": 0.0001,
"final_fee": 1250,
"fee_asset": "BTC",
"fee_asset_precision": 8
},
"timestamp": 1715896356,
"expires_at": 1715896416
}{
"detail": "Route not supported for this pair. From: BTC_LN, To: RGB_LN"
}{
"error": "missing_api_key"
}{
"error_code": "PAIR_NOT_FOUND",
"message": "Trading pair not found: BTC/USDT",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"detail": [
{
"loc": [
"body",
"rfq_id"
],
"msg": "Field required",
"type": "missing"
}
]
}{
"error_code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests",
"details": {
"retry_after": 60
},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "INTERNAL_ERROR",
"message": "Internal Server Error",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}{
"error_code": "SERVICE_UNAVAILABLE",
"message": "Trading service is starting up. Please try again in a few moments.",
"details": {},
"request_id": "req_01HV8Q9X7G0Q7Y3Z"
}Authorizations
Pass a Kaleido API key such as kld_live_c_....
Body
Response
Quote created successfully.
Response containing a quote for a trading pair.
Uses full SwapLeg for both sides, providing complete asset details including ticker, name, precision, layer, and amount.
"1234567890"
Complete source leg specification with amount and details
Show child attributes
Show child attributes
Complete destination leg specification with amount and details
Show child attributes
Show child attributes
Price of 1 whole unit of from_asset (e.g., 1 BTC) in terms of the smallest unit of to_asset (e.g., USDT with precision 6). Matches PriceData.price for the given rfq_id.
50000123456
Show child attributes
Show child attributes
Quote creation timestamp (seconds since epoch)
Quote expiry timestamp (seconds since epoch)
Was this page helpful?