> ## Documentation Index
> Fetch the complete documentation index at: https://docs.madra.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploying to Mainnet

> Sponsor funding math, RPC selection, and the cutover checklist for taking a facilitator to production.

This page assumes a working testnet deployment (from the [operator quickstart](/getting-started/quickstart-operators)) and takes it to mainnet.

## Sponsor account funding math

Every paid request costs the sponsor account one Stellar transaction fee. On mainnet, average Soroban invoke fees are on the order of 0.0002 XLM. Estimate:

```text theme={null}
daily_xlm_needed = expected_daily_requests × avg_fee_xlm × safety_factor
```

A facilitator serving 100k requests/day at 0.0002 XLM average, with a 3x safety factor, needs \~60 XLM/day. Fund for at least 30 days at expected volume so you are not topping up in the middle of the night.

Set `SPONSOR_MIN_BALANCE_XLM` to at least 3 days of expected burn.

## RPC selection

Soroban RPC quality varies. Rules of thumb:

* Do not use the public testnet RPC for mainnet.
* Configure at least one fallback (`STELLAR_RPC_FALLBACK_URLS`).
* If you run your own Stellar Core with Soroban, prefer it. Otherwise, use two independent providers.

## Cutover checklist

<Checklist>
  <Check>Sponsor account is funded for 30+ days at expected volume.</Check>
  <Check>`SPONSOR_ALERT_WEBHOOK` is wired to your on-call channel and tested (fire a test alert).</Check>
  <Check>`STELLAR_RPC_URL` and at least one fallback are reachable from the deployment host.</Check>
  <Check>`ADMIN_TOKEN_HASH` is set. There is no unauthenticated admin surface.</Check>
  <Check>`ALLOWED_ORIGINS` is not `*` unless you have a specific reason.</Check>
  <Check>Metrics scraping and OTEL export are confirmed working.</Check>
  <Check>Runbook is where the on-call can find it under stress. See [Runbook](/guides/operators/runbook).</Check>
</Checklist>

## The cutover itself

```diff theme={null}
-NETWORK=stellar:testnet
-STELLAR_RPC_URL=https://soroban-testnet.stellar.org
+NETWORK=stellar:pubnet
+STELLAR_RPC_URL=https://mainnet-soroban.stellar.org

-SPONSOR_SECRET_KEY=SA... (testnet key)
+SPONSOR_SECRET_KEY=SA... (mainnet key, freshly generated)
```

Do not reuse a testnet sponsor key on mainnet. Generate fresh.

## First hour on mainnet

* Watch the sponsor account balance move; confirm the burn rate matches expectation.
* Watch verify latency and settle latency in the metrics.
* Watch the rejection code distribution. `network_mismatch` in the first minutes usually means a downstream cache still has your testnet config.
