# Bundle submission

Send 1 to 4 signed transactions in one HTTP/1.1 request with JSON-RPC sendBundle; they land atomically in order, or not at all.

## Route

| Route | Body | Key |
|---|---|---|
| `POST /v1/sendBundle` | JSON-RPC `sendBundle` | `api-key` header |

- The key is the one you send transactions with, in the `api-key` header: see [Authentication](/docs/tx-landing/http/#authentication).
- This is the only bundle route. The path is exact and case-sensitive.
- Plain HTTP/1.1 on port 80: your key travels unencrypted. HTTPS and HTTP/2 are not offered.
- Bundles are HTTP only. Bundles over QUIC are not offered.

## Rules

- **Paid tiers only.** A key on the Free [tier](/docs/tx-landing/rate-limits/#tiers) answers `403` `bundles require a paid tier`, which uses no TPS unit.
- **1 to 4 transactions.** Each is signed, and no two share a signature.
- **Tip.** One transaction carries a [tip](/docs/tx-landing/endpoints/#tip-rule) of at least 0.001 SOL (1,000,000 lamports), on every tier. Tips in several transactions are not added up. A higher tip gives broader coverage and a higher landing rate.
- **Rate limit.** A bundle uses 1 TPS unit whatever its size, from the same [rate limit](/docs/tx-landing/rate-limits/) as your transactions.
- **Size.** Each transaction is at most 1232 bytes (legacy, v0) or 4096 bytes (v1); the request body, at most 32768 bytes.

## sendBundle

The request has the shape of Jito's `sendBundle`, with the transactions in base64. The examples use Frankfurt; any [endpoint](/docs/tx-landing/endpoints/) works.

**curl**

```sh
TX1_BASE64='<first signed transaction, base64>'
TX2_BASE64='<second signed transaction, base64>'

curl http://fra.landing.soyas.xyz/v1/sendBundle \
  -H "api-key: $SOYAS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"sendBundle","params":[["'"$TX1_BASE64"'","'"$TX2_BASE64"'"]]}'
```

**Python**

```python
import base64
import requests

session = requests.Session()  # keeps the connection open between requests

# txs: 1 to 4 signed transactions' wire bytes (solders: [bytes(tx1), bytes(tx2)]).
def send_bundle(api_key: str, txs: list[bytes]) -> list[str]:
    encoded = [base64.b64encode(tx).decode() for tx in txs]
    resp = session.post(
        "http://fra.landing.soyas.xyz/v1/sendBundle",
        headers={"api-key": api_key},
        json={
            "jsonrpc": "2.0",
            "id": 1,
            "method": "sendBundle",
            "params": [encoded],
        },
    )
    if resp.status_code != 200:
        raise RuntimeError(f"{resp.status_code}: {resp.text}")
    return resp.json()["result"]
```

**Go**

```go
import (
	"bytes"
	"encoding/base64"
	"encoding/json"
	"fmt"
	"net/http"
)

// txs: 1 to 4 signed transactions' wire bytes (solana-go: tx.MarshalBinary()).
func sendBundle(apiKey string, txs [][]byte) ([]string, error) {
	encoded := make([]string, len(txs))
	for i, tx := range txs {
		encoded[i] = base64.StdEncoding.EncodeToString(tx)
	}
	body, _ := json.Marshal(map[string]any{
		"jsonrpc": "2.0",
		"id":      1,
		"method":  "sendBundle",
		"params":  []any{encoded},
	})
	req, _ := http.NewRequest("POST", "http://fra.landing.soyas.xyz/v1/sendBundle", bytes.NewReader(body))
	req.Header.Set("api-key", apiKey)
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	var out struct {
		Result []string        `json:"result"`
		Error  json.RawMessage `json:"error"`
	}
	if json.NewDecoder(resp.Body).Decode(&out); len(out.Result) == 0 {
		return nil, fmt.Errorf("%s: %s", resp.Status, out.Error)
	}
	return out.Result, nil
}
```

**Rust**

```rust
use base64::Engine as _;
use serde_json::{json, Value};
use solana_sdk::transaction::VersionedTransaction;

async fn send_bundle(
    http: &reqwest::Client,
    api_key: &str,
    txs: &[VersionedTransaction],
) -> anyhow::Result<Vec<String>> {
    let encoded: Vec<String> = txs
        .iter()
        .map(|tx| Ok(base64::engine::general_purpose::STANDARD.encode(bincode::serialize(tx)?)))
        .collect::<anyhow::Result<_>>()?;
    let resp = http
        .post("http://fra.landing.soyas.xyz/v1/sendBundle")
        .header("api-key", api_key)
        .json(&json!({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "sendBundle",
            "params": [encoded],
        }))
        .send()
        .await?;
    let status = resp.status();
    let body: Value = resp.json().await.unwrap_or_default();
    match serde_json::from_value(body["result"].clone()) {
        Ok(signatures) => Ok(signatures),
        Err(_) => anyhow::bail!("{status}: {body}"),
    }
}
```

- Transactions are base64 (standard alphabet, with padding); base58 is refused. Options are ignored. `id` comes back unchanged.
- One bundle per HTTP request: a JSON-RPC batch (an outer JSON array) is refused.
- `/v1/sendBundle` takes `sendBundle` only; any other JSON-RPC method answers `400` with code `-32601`.

## Response

`200`, `Content-Type: application/json`:

```json
{"jsonrpc":"2.0","id":1,"result":["<signature 1>","<signature 2>"]}
```

- `result` is the first signature of each transaction, in base58, in the order you sent them.
- It means the relay accepted the bundle, not that it landed. Check the signatures with `getSignatureStatuses` on your own RPC node.
- The relay does not verify signatures, simulate or deduplicate: the same bundle sent twice is forwarded twice and uses 2 TPS units.

Every error status and message is on [Errors](/docs/tx-landing/errors/). Apart from the request body, the connection limits and keep-alive are those of [transactions over HTTP](/docs/tx-landing/http/#limits).
