Funding rate
List a perpetual's past funding rates, newest first.
On this page
Agent prompt
Write a small program that calls `settlement.funding_rate` on Grvt {environment} {using}.
Target environment: {environment} (chain ID {chainId}). Recorded signing cases keep their original environment.
{executionGuidance}
Read this first: {origin}/bundle/reference/rpc/funding_rate.md (~52 KB, plain Markdown: this page plus the AGENTS.md rules, Errors and retries, Python SDK, Environments).
Fetch other pages from the index at {origin}/llms.txt only as you need them. {origin}/downloads/contract.json is a machine-readable contract for tools, not for reading.
Rules: follow AGENTS.md; do not send requests without the user asking you to; read credentials from environment variables; never retry writes automatically; show me the code and how to run it. URLs and generated code samples on this page: Testnet (chain ID 326). Other code on this page doesn't change: it stays on testnet until you switch it in your code. Tutorials, signing cases and live tools always use testnet.
Pagination works as follows:
- We perform a reverse chronological lookup, starting from
end_time. Ifend_timeis not set, we start from the most recent data. - The lookup is limited to
limitrecords. If more data is requested, the response will contain anextcursor for you to query the next page. - If a
cursoris provided, it will be used to fetch results from that point onwards. - Pagination will continue until the
start_timeis reached. Ifstart_timeis not set, pagination will continue as far back as our data retention policy allows.
| SDK | client. |
|---|---|
| HTTP | POST https:/, or /lite/v1/funding for lite names (the SDKs' default) |
| WebSocket | method v1/funding on wss:/, or /ws/lite for lite names |
| Auth | None (public) |
| Retries | Read: the SDKs retry retryable errors (rules) |
| Contract id | settlement. (RPCFundingRateV1) |
Request
Body type ApiFundingRateRequest. Fields the server fills are left out.
- The instrument name, e.g.
BTC_USDT_Perp(perpetual),BTC_USDT_SFP(stable funding perp) orBTC_USDT_SpotSwap(spot swap). - Start time of funding rate in unix nanoseconds
- End time of funding rate in unix nanoseconds
- The limit to query for. Defaults to 500; Max 1000
- The cursor to indicate when to start the query from
- Aggregation method for historical funding rate observations. Defaults to using the instrument-specific funding interval.
4 values
Response
Body type ApiFundingRateResponse (the same object is the JSON-RPC result over WebSocket).
- The funding rate result set for given interval
9 fields of
ApiFundingRate- The instrument name, e.g.
BTC_USDT_Perp(perpetual),BTC_USDT_SFP(stable funding perp) orBTC_USDT_SpotSwap(spot swap). - The funding rate of the instrument, expressed in percentage points. Absent for stable perps, which have
funding_rate_long_apr_pctandfunding_rate_short_apr_pctinstead. - The funding timestamp of the funding rate, expressed in unix nanoseconds
- The mark price of the instrument at funding timestamp. Decimal string, e.g. "65000.5"; up to 9 decimals. For stable perps, the index price the charge used.
- Deprecated: Refer to
funding_rateinstead. Will be removed in a future release. Absent for stable perps. - Funding interval in hours (e.g. 1/4/8/etc).
- Stable perps only: the annual rate for retail longs at this charge, in percent a year (
'-5.5'= retail longs paid 5.5%; positive = retail receives, negative = retail pays). Absent for other kinds. - Stable perps only: the annual rate for retail shorts at this charge, in percent a year (
'-5'= retail shorts paid 5%; positive = retail receives, negative = retail pays). Absent for other kinds. - Stable perps only: days of funding the charge covered, 3 on the triple day, else 1. Absent for other kinds.
- The cursor to indicate when to start the next query from
Errors
Errors come back as {"code", "message", "status"} (lite {"c", "m", "s"}) with the HTTP status. Codes this call can return (all error codes):
3007NotApplicableForSpotInstrument400- API is not applicable for spot instruments
3008InvalidFundingAggregationTypeForStablePerp400- Funding rate aggregation type is not applicable for stable perp instruments
3012InvalidCursor400- Cursor is invalid
Plus 5 errors any call can return
1002InternalServer500- Internal Server Error
1003InvalidRequest400- Request could not be processed due to malformed syntax
1006RateLimit429retryable- You have surpassed the allocated rate limit for your tier
1014GatewayTimeout504retryable- Upstream data service timed out, please try again
1015ServiceUnavailable503retryable- Upstream data service is temporarily unavailable, please try again
Example
Example code
from grvt import Grvt
with Grvt(env="testnet") as client:
resp = client.funding_rate(
instrument="BTC_USDT_Perp",
limit=500,
)
print(resp)
Raw HTTP (set GRVT_DOMAIN, see Environments):
With full field names:
curl -sS "https://market-data.testnet.grvt.io/full/v1/funding" \
-H "Content-Type: application/json" \
--data @- <<EOF
{
"instrument": "BTC_USDT_Perp",
"limit": 500
}
EOFWith lite field names:
curl -sS "https://market-data.testnet.grvt.io/lite/v1/funding" \
-H "Content-Type: application/json" \
--data @- <<EOF
{
"i": "BTC_USDT_Perp",
"l": 500
}
EOF