from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.risk_yield.risk_yield_pools_pool_id_(pool_id=174842, chain=models.V2RiskYieldPoolsPoolIDChain.ROBINHOOD, depth_words=4, history=models.PoolHistory.SEVEND)
# Handle response
print(res)import { CompassApiSDK } from "@compass-labs/api-sdk";
const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await compassApiSDK.riskYield.riskYieldPoolsPoolId({
poolId: 174842,
chain: "robinhood",
depthWords: 4,
history: "7d",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v2/risk_yield/pools/{pool_id} \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v2/risk_yield/pools/{pool_id}', 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.compasslabs.ai/v2/risk_yield/pools/{pool_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.compasslabs.ai/v2/risk_yield/pools/{pool_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.compasslabs.ai/v2/risk_yield/pools/{pool_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v2/risk_yield/pools/{pool_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"pool": {
"pool_id": 123,
"dex_version": "V3",
"pool_key": "<string>",
"token0": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"kind": "OTHER",
"price_usd": "<string>",
"price_source": "CHAINLINK",
"price_confidence": "<string>",
"stock_ticker": "<string>"
},
"token1": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"kind": "OTHER",
"price_usd": "<string>",
"price_source": "CHAINLINK",
"price_confidence": "<string>",
"stock_ticker": "<string>"
},
"fee_ppm": 123,
"fee_pct": "<string>",
"pair_class": "MEME_STOCK",
"watched": true,
"lp_open": true,
"lp_earns_fees": true,
"address": "<string>",
"tick_spacing": 123,
"hooks": "<string>",
"stock_token": "<string>",
"meme_token": "<string>",
"stock_ticker": "<string>",
"launchpad_origin": "PONS_V1",
"lp_fee_note": "<string>",
"tvl_usd": "<string>",
"tvl_confidence": "<string>",
"volume_24h_usd": "<string>",
"volume_7d_usd": "<string>",
"fees_24h_usd": "<string>",
"fees_7d_usd": "<string>",
"swaps_24h": 123,
"fee_apr_24h": "<string>",
"fee_apr_7d": "<string>",
"fee_apr_full_range_24h": "<string>",
"realized_vol_24h": "<string>",
"realized_vol_7d": "<string>",
"il_adjusted_apr_7d": "<string>",
"price": "<string>",
"price_change_24h_pct": "<string>",
"locked_share": "<string>",
"meme_fdv_usd": "<string>",
"ranked": true,
"created_at": "2023-11-07T05:31:56Z",
"last_swap_at": "2023-11-07T05:31:56Z",
"stats_updated_at": "2023-11-07T05:31:56Z"
},
"on_chain": {
"block_number": 123,
"sqrt_price_x96": "<string>",
"tick": 123,
"liquidity": "<string>",
"fetched_at": "2023-11-07T05:31:56Z",
"price": "<string>",
"lp_fee_ppm": 123,
"fee_growth_global0_x128": "<string>",
"fee_growth_global1_x128": "<string>"
},
"liquidity_distribution": [
{
"tick_lower": 123,
"tick_upper": 123,
"liquidity": "<string>",
"price_lower": "<string>",
"price_upper": "<string>",
"is_current": false
}
],
"hourly": [
{
"hour_start": "2023-11-07T05:31:56Z",
"open": "<string>",
"high": "<string>",
"low": "<string>",
"close": "<string>",
"close_source": "<string>",
"volume_usd": "<string>",
"lp_fees_usd": "<string>",
"swap_count": 0,
"tvl_usd_end": "<string>"
}
],
"stock_reference": {
"ticker": "<string>",
"reference_price_usd": "<string>",
"reference_source": "<string>",
"reference_updated_at": "2023-11-07T05:31:56Z",
"pool_implied_price_usd": "<string>",
"premium_pct": "<string>",
"reference_is_stale": false
},
"warnings": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get pool detail
One pool, with its price history and the caveats that apply to it.
For a pool holding a tokenized stock, stock_reference compares the pool’s
price against the stock’s own. They drift: the pool trades around the clock
while the stock trades in a session, and that gap is what a liquidity
provider is quoting against overnight.
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.risk_yield.risk_yield_pools_pool_id_(pool_id=174842, chain=models.V2RiskYieldPoolsPoolIDChain.ROBINHOOD, depth_words=4, history=models.PoolHistory.SEVEND)
# Handle response
print(res)import { CompassApiSDK } from "@compass-labs/api-sdk";
const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await compassApiSDK.riskYield.riskYieldPoolsPoolId({
poolId: 174842,
chain: "robinhood",
depthWords: 4,
history: "7d",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v2/risk_yield/pools/{pool_id} \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v2/risk_yield/pools/{pool_id}', 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.compasslabs.ai/v2/risk_yield/pools/{pool_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.compasslabs.ai/v2/risk_yield/pools/{pool_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.compasslabs.ai/v2/risk_yield/pools/{pool_id}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v2/risk_yield/pools/{pool_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"pool": {
"pool_id": 123,
"dex_version": "V3",
"pool_key": "<string>",
"token0": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"kind": "OTHER",
"price_usd": "<string>",
"price_source": "CHAINLINK",
"price_confidence": "<string>",
"stock_ticker": "<string>"
},
"token1": {
"address": "<string>",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"kind": "OTHER",
"price_usd": "<string>",
"price_source": "CHAINLINK",
"price_confidence": "<string>",
"stock_ticker": "<string>"
},
"fee_ppm": 123,
"fee_pct": "<string>",
"pair_class": "MEME_STOCK",
"watched": true,
"lp_open": true,
"lp_earns_fees": true,
"address": "<string>",
"tick_spacing": 123,
"hooks": "<string>",
"stock_token": "<string>",
"meme_token": "<string>",
"stock_ticker": "<string>",
"launchpad_origin": "PONS_V1",
"lp_fee_note": "<string>",
"tvl_usd": "<string>",
"tvl_confidence": "<string>",
"volume_24h_usd": "<string>",
"volume_7d_usd": "<string>",
"fees_24h_usd": "<string>",
"fees_7d_usd": "<string>",
"swaps_24h": 123,
"fee_apr_24h": "<string>",
"fee_apr_7d": "<string>",
"fee_apr_full_range_24h": "<string>",
"realized_vol_24h": "<string>",
"realized_vol_7d": "<string>",
"il_adjusted_apr_7d": "<string>",
"price": "<string>",
"price_change_24h_pct": "<string>",
"locked_share": "<string>",
"meme_fdv_usd": "<string>",
"ranked": true,
"created_at": "2023-11-07T05:31:56Z",
"last_swap_at": "2023-11-07T05:31:56Z",
"stats_updated_at": "2023-11-07T05:31:56Z"
},
"on_chain": {
"block_number": 123,
"sqrt_price_x96": "<string>",
"tick": 123,
"liquidity": "<string>",
"fetched_at": "2023-11-07T05:31:56Z",
"price": "<string>",
"lp_fee_ppm": 123,
"fee_growth_global0_x128": "<string>",
"fee_growth_global1_x128": "<string>"
},
"liquidity_distribution": [
{
"tick_lower": 123,
"tick_upper": 123,
"liquidity": "<string>",
"price_lower": "<string>",
"price_upper": "<string>",
"is_current": false
}
],
"hourly": [
{
"hour_start": "2023-11-07T05:31:56Z",
"open": "<string>",
"high": "<string>",
"low": "<string>",
"close": "<string>",
"close_source": "<string>",
"volume_usd": "<string>",
"lp_fees_usd": "<string>",
"swap_count": 0,
"tvl_usd_end": "<string>"
}
],
"stock_reference": {
"ticker": "<string>",
"reference_price_usd": "<string>",
"reference_source": "<string>",
"reference_updated_at": "2023-11-07T05:31:56Z",
"pool_implied_price_usd": "<string>",
"premium_pct": "<string>",
"reference_is_stale": false
},
"warnings": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Path Parameters
The pool id, as returned by GET /pools.
Query Parameters
robinhood How many 256-tick words either side of the current price to read for the liquidity distribution. More is a wider picture and more node calls.
1 <= x <= 1624h, 7d, 30d Response
Successful Response
Show child attributes
Show child attributes
Read live, at request time.
The indexer's numbers are minutes old, which is fine for ranking and not fine for sizing a position on an asset that moves this fast.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The pool price against the stock's own reference price.
A tokenized stock trades in its pool around the clock while the underlying trades in a session. The gap between them is real information — it is what an LP is quoting against overnight — and it is not visible from either number alone.
Show child attributes
Show child attributes
Things worth knowing before providing liquidity here.
Was this page helpful?