# getTipFloor

> Read an edge's observed landed-tip percentiles with getTipFloor. Your key's minimum tip still applies.

<Note>
Supanode issues keys through [Telegram](https://telegram.me/supanode_tgs). Default minimum tip: 0.001 SOL; default rate: 15 sends/s per key per metro. Your key settings can differ. Declared tips are off by default and require enablement and a payment arrangement with Supanode. If your key returns `partner_declared_tips`, use an on-chain transfer instead.
</Note>

`POST https://fra.tpu.supanode.xyz/`

Authentication: API key, one of: `x-api-key` header, `api-key` query, `Authorization: Bearer` header.

## Request body (`application/json`)

One JSON object using the [shared request conventions](https://supanode.xyz/docs/solana/sender/reference/json-rpc#request). The method takes no params.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `jsonrpc` | `"2.0"` | yes |  |
| `id` | string or number or null | no | Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read. |
| `method` | `"getTipFloor"` | yes |  |
| `params` | any | no | Ignored when present. |

```json title="Request"
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTipFloor"
}
```

## Responses

### 200

Returns an array of zero or one observed tip-floor snapshots in `result`; an empty array means no recent landing data.

Refusals with HTTP 200, by `error.data.reason`:

- [`invalid_request`](https://supanode.xyz/docs/solana/sender/reference/errors#invalid_request): invalid JSON-RPC body.

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `jsonrpc` | `"2.0"` | yes |  |
| `result` | array of object | yes | Zero or one tip floor snapshot; an empty array means no recent landing data is available. The snapshot describes tips that already landed and does not predict landing; your key's [minimum tip](https://supanode.xyz/docs/solana/sender/tips#minimum-tip) still applies. Each metro reports its own values; use a named [metro hostname](https://supanode.xyz/docs/solana/sender/endpoints#regions) to compare them. maxItems: `1`. |
| `result[].time` | string (date-time) | yes | When the snapshot was computed, RFC 3339 in UTC, to the second. |
| `result[].landed_tips_25th_percentile` | integer | yes | The edge's 25th landed-tip percentile, in lamports. minimum: `0`. |
| `result[].landed_tips_50th_percentile` | integer | yes | The edge's 50th landed-tip percentile, in lamports. minimum: `0`. |
| `result[].landed_tips_75th_percentile` | integer | yes | The edge's 75th landed-tip percentile, in lamports. minimum: `0`. |
| `result[].landed_tips_95th_percentile` | integer | yes | The edge's 95th landed-tip percentile, in lamports. minimum: `0`. |
| `result[].landed_tips_99th_percentile` | integer | yes | The edge's 99th landed-tip percentile, in lamports. minimum: `0`. |
| `id` | string or number or null | yes | Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read. |
| `jsonrpc` | `"2.0"` | yes |  |
| `error` | object | yes |  |
| `error.code` | `-32700` or `-32600` or `-32601` or `-32602` or `-32603` or `-32000` or `-32001` or `-32002` or `-32003` | yes | [Status codes](https://supanode.xyz/docs/solana/sender/reference/json-rpc#status-codes) maps reasons and problems to codes. Match on `data.reason`. |
| `error.message` | string | yes | The same sentence as data.message. |
| `error.data` | object | yes | Reason-specific fields are included alongside these members, such as minimum, found, declared, available, unpaid_lamports, index, per_second and retry_after_ms. Failed preflight also includes Solana simulation fields such as err, logs and unitsConsumed. |
| `error.data.reason` | string | yes | Stable snake_case reason. Match on this; `message` wording can change, and the numeric codes are shared with Solana's RPC. |
| `error.data.message` | string | yes | What happened and what to change. Wording can change. |
| `error.data.retryable` | boolean | yes | Whether the unchanged request can succeed later. Wait before retrying, and check that the transaction has not expired. |
| `error.data.docs` | string (uri) | no | Optional error documentation URL followed by the reason anchor. Supanode endpoints omit this field. |
| `id` | string or number or null | yes | Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read. |

```json title="Success"
{
  "jsonrpc": "2.0",
  "result": [],
  "id": 1
}
```

```json title="Invalid JSON"
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32700,
    "message": "the body is not valid JSON",
    "data": {
      "reason": "invalid_request",
      "problem": "parse_error",
      "message": "the body is not valid JSON",
      "retryable": false
    }
  },
  "id": null
}
```

### 401

[`unauthorized`](https://supanode.xyz/docs/solana/sender/reference/errors#unauthorized): missing, unknown or revoked API key.

Content type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `jsonrpc` | `"2.0"` | yes |  |
| `error` | object | yes |  |
| `error.code` | `-32700` or `-32600` or `-32601` or `-32602` or `-32603` or `-32000` or `-32001` or `-32002` or `-32003` | yes | [Status codes](https://supanode.xyz/docs/solana/sender/reference/json-rpc#status-codes) maps reasons and problems to codes. Match on `data.reason`. |
| `error.message` | string | yes | The same sentence as data.message. |
| `error.data` | object | yes | Reason-specific fields are included alongside these members, such as minimum, found, declared, available, unpaid_lamports, index, per_second and retry_after_ms. Failed preflight also includes Solana simulation fields such as err, logs and unitsConsumed. |
| `error.data.reason` | string | yes | Stable snake_case reason. Match on this; `message` wording can change, and the numeric codes are shared with Solana's RPC. |
| `error.data.message` | string | yes | What happened and what to change. Wording can change. |
| `error.data.retryable` | boolean | yes | Whether the unchanged request can succeed later. Wait before retrying, and check that the transaction has not expired. |
| `error.data.docs` | string (uri) | no | Optional error documentation URL followed by the reason anchor. Supanode endpoints omit this field. |
| `id` | string or number or null | yes | Optional request id, echoed exactly in the response. Null when absent or refused before the id could be read. |

```json title="unauthorized"
{
  "jsonrpc": "2.0",
  "error": {
    "code": -32000,
    "message": "API key missing or not recognized; pass it as the api-key query parameter, an x-api-key header or Authorization: Bearer",
    "data": {
      "reason": "unauthorized",
      "message": "API key missing or not recognized; pass it as the api-key query parameter, an x-api-key header or Authorization: Bearer",
      "retryable": false
    }
  },
  "id": null
}
```

### 421

Unknown or removed TLS SNI or HTTP Host/:authority. Returns plain text without a JSON-RPC envelope or rejection object. The current hostname policy also applies to existing connections and resumed TLS sessions.

Content type: `text/plain`

```text title="UnknownHost"
This hostname is not served here. Check the endpoint address
```

## Code samples

```rust title="Rust"
// Builds on the example project (/reference/json-rpc#example-project).
use serde::Deserialize;
use swqos_examples::swqos::{Result, call};

#[derive(Deserialize)]
struct TipFloor {
    time: String,
    landed_tips_50th_percentile: u64,
}

#[tokio::main]
async fn main() -> Result<()> {
    let floors: Vec<TipFloor> = call("getTipFloor", None).await?;
    if let Some(floor) = floors.first() {
        println!(
            "{}: median landed tip {} lamports",
            floor.time, floor.landed_tips_50th_percentile
        );
    } else {
        println!("no recent landing data");
    }
    Ok(())
}
```

```go title="Go"
// Builds on the example project (/reference/json-rpc#example-project).
package swqos

import (
	"context"
	"fmt"
)

type TipFloor struct {
	Time         string `json:"time"`
	Percentile25 uint64 `json:"landed_tips_25th_percentile"`
	Percentile50 uint64 `json:"landed_tips_50th_percentile"`
	Percentile75 uint64 `json:"landed_tips_75th_percentile"`
	Percentile95 uint64 `json:"landed_tips_95th_percentile"`
	Percentile99 uint64 `json:"landed_tips_99th_percentile"`
}

func PrintTipFloor(ctx context.Context) error {
	floors, err := Call[[]TipFloor](ctx, "getTipFloor")
	if err != nil {
		return err
	}
	if len(floors) > 0 {
		floor := floors[0]
		fmt.Printf("%s: median landed tip %d lamports\n", floor.Time, floor.Percentile50)
	} else {
		fmt.Println("no recent landing data")
	}
	return nil
}
```

```ts title="TypeScript"
// Builds on the example project (/reference/json-rpc#example-project).
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')
```
