API reference
getTipFloor
Read regional landed-tip percentiles.
The tip floor is available as the JSON-RPC method getTipFloor and as GET /tip_floor. Both need an API key and return the same JSON.
{"jsonrpc":"2.0","id":1,"method":"getTipFloor"}curl -sS "https://fra.sol.zerocopy.sh/tip_floor" -H "x-api-key: $SWQOS_API_KEY"Params
None. params, when present, is ignored.
Result
An array holding zero or one object. GET /tip_floor returns the array itself as application/json; getTipFloor returns it as result.
[
{
"time": "YYYY-MM-DDTHH:MM:SSZ",
"landed_tips_25th_percentile": LAMPORTS,
"landed_tips_50th_percentile": LAMPORTS,
"landed_tips_75th_percentile": LAMPORTS,
"landed_tips_95th_percentile": LAMPORTS,
"landed_tips_99th_percentile": LAMPORTS
}
]| Field | Type | Meaning |
|---|---|---|
time | string | When the snapshot was computed, RFC 3339 in UTC, to the second. |
landed_tips_Nth_percentile | integer, lamports | The region's Nth landed-tip percentile. |
An empty array means no recent landing data is available.
Using the floor
The floor is an observation, not a required tip or a prediction of landing. Your key's minimum tip still applies.
Regions report their own values. Use a named regional hostname when comparing responses.
The SWQoS agent does not serve the tip floor; ask a region.
Errors
| Reason | HTTP | Code | When |
|---|---|---|---|
unauthorized | 401 | -32000 | The key is missing, unknown or revoked. |
invalid_request | 200 | see codes | The body is not a valid JSON-RPC request. |
unsupported | 404 for GET /tip_floor, 200 for JSON-RPC | -32601 | Asked of the SWQoS agent, which does not serve it. |
Examples
import { call } from './swqos.ts'
type TipFloor = {
time: string
landed_tips_25th_percentile: number
landed_tips_50th_percentile: number
landed_tips_75th_percentile: number
landed_tips_95th_percentile: number
landed_tips_99th_percentile: number
}
const [floor] = await call<TipFloor[]>('getTipFloor')
if (floor) console.log(`${floor.time}: median landed tip ${floor.landed_tips_50th_percentile} lamports`)
else console.log('no recent landing data')