Documentation

Scaling

Scaling your Paymaster ensures it can handle more user traffic and transaction throughput, especially under high load.

There are two types of scaling strategies:

🔼 Vertical Scaling

Add more relayers.

Each relayer can only handle one transaction at a time due to nonce management. So:

1 relayer = 1 TPS (safe assumption)

Add more relayers to support more concurrent transactions How to scale vertically:

cargo run --bin paymaster-cli relayers-deploy\
\--master-address=0x...
\--master-pk=0x...
\--profile=my-profile
\--num-relayers=5
\--fund=10

This will deploy and fund 5 more relayers under your existing setup.

↔️ Horizontal Scaling

Run multiple Paymaster instances.

Useful when:

  • You want redundancy (multi-region)
  • You're running services in parallel environments
  • You expect huge traffic spikes

To do this safely, relayers must be shared across instances, and you need Redis-based locking to avoid nonce collisions.

`{  
  "relayers": {
    "lock": {
      "mode": "shared",
      "redis": {
        "endpoint": "redis://your-redis-url"
      }
    }
  }
}

This allows multiple Paymaster services to coordinate over the same pool of relayers.