Relayer Economics
Fee structure and incentives for relayer operators
Relayer Economics
Operating a ZKMix relayer is an economic activity: relayers spend SOL on transaction fees and earn revenue from withdrawal fees. This page describes the fee structure, cost breakdown, revenue potential, and competitive dynamics of the relayer market.
Fee Calculation
The relayer fee is calculated as a percentage of the pool denomination. This percentage is set by the relayer operator and advertised through the relayer's /fees endpoint and the on-chain registry.
Formula
relayer_fee = max(denomination * fee_percentage / 100, min_fee)Where:
denominationis the pool's fixed deposit/withdrawal amountfee_percentageis the relayer's configured percentage (e.g., 0.3%)min_feeis the relayer's minimum fee floor in lamports or token units
Example Calculations
For a relayer charging 0.3% with a minimum fee of 10,000 lamports:
| Pool | Denomination | Fee (0.3%) | Min Fee | Actual Fee |
|---|---|---|---|---|
| SOL-0.1 | 0.1 SOL | 0.0003 SOL | 0.00001 SOL | 0.0003 SOL |
| SOL-1 | 1 SOL | 0.003 SOL | 0.00001 SOL | 0.003 SOL |
| SOL-10 | 10 SOL | 0.03 SOL | 0.00001 SOL | 0.03 SOL |
| SOL-100 | 100 SOL | 0.3 SOL | 0.00001 SOL | 0.3 SOL |
For SPL token pools, fees are denominated in the same token:
| Pool | Denomination | Fee (0.3%) | Actual Fee |
|---|---|---|---|
| USDC-100 | 100 USDC | 0.30 USDC | 0.30 USDC |
| USDC-1000 | 1,000 USDC | 3.00 USDC | 3.00 USDC |
| USDC-10000 | 10,000 USDC | 30.00 USDC | 30.00 USDC |
Fee Binding
The relayer fee is cryptographically bound to the withdrawal proof. When a user generates a proof, they include the relayer fee as a public input to the circuit. This means:
- The relayer cannot increase the fee after receiving the proof -- the proof would be invalid with a different fee amount.
- The relayer cannot take less than the stated fee either -- the exact fee amount is enforced by the on-chain program.
- The user agrees to the fee before generating the proof, providing full transparency.
Minimum Fees
Relayer operators can set a minimum fee floor to ensure every transaction is profitable regardless of the pool denomination. This is important for small-denomination pools where a percentage-based fee might not cover costs.
Why Minimum Fees Exist
Consider a 0.1 SOL pool with a 0.3% fee. The relayer fee would be 0.0003 SOL (300,000 lamports). However, the transaction cost (base fee + priority fee) might be 0.0001 SOL or more during congestion. The minimum fee ensures the relayer always covers its costs with margin.
Recommended Minimums
| Network Condition | Recommended Min Fee | Rationale |
|---|---|---|
| Low congestion | 10,000 lamports | Covers base fee with margin |
| Normal | 50,000 lamports | Covers typical priority fees |
| High congestion | 200,000 lamports | Covers elevated priority fees |
Some relayers implement dynamic minimum fees that adjust based on recent Solana priority fee levels. The relayer software supports this through the monitoring.dynamicFees configuration option.
Gas Cost Coverage
Every withdrawal transaction costs the relayer SOL in transaction fees. Understanding these costs is essential for profitable operation.
Cost Breakdown Per Transaction
| Cost Component | Amount (lamports) | Notes |
|---|---|---|
| Base transaction fee | 5,000 | Fixed per signature |
| Priority fee (typical) | 10,000 - 100,000 | Varies with network congestion |
| Compute unit cost | 0 - 500,000 | Depends on priority fee market |
| Account rent (if needed) | 0 | Accounts already exist for active pools |
| Typical total cost | 15,000 - 105,000 |
The priority fee market on Solana is dynamic. During periods of heavy network usage, priority fees can spike significantly. Relayers should monitor the priority fee market and adjust their minimum fees accordingly.
Profit Margin Per Transaction
Using the SOL-1 pool as an example with a 0.3% fee:
Revenue per withdrawal: 3,000,000 lamports (0.003 SOL)
Transaction cost: ~50,000 lamports (typical)
------------------------------------------------------
Net profit: 2,950,000 lamports (0.00295 SOL)
Profit margin: ~98.3%For the smaller SOL-0.1 pool:
Revenue per withdrawal: 300,000 lamports (0.0003 SOL)
Transaction cost: ~50,000 lamports (typical)
------------------------------------------------------
Net profit: 250,000 lamports (0.00025 SOL)
Profit margin: ~83.3%The margins are high because the relayer's only cost is the Solana transaction fee, which is low relative to the fees charged. However, the absolute revenue per transaction is modest, so relayers need consistent volume to generate meaningful income.
Revenue Potential
The revenue a relayer can earn depends on its share of the withdrawal volume and the mix of pool denominations.
Scenario Modeling
Conservative scenario -- A relayer processing 50 withdrawals per day with an average fee of 0.003 SOL:
Daily revenue: 50 * 0.003 SOL = 0.15 SOL
Monthly revenue: 0.15 * 30 = 4.5 SOL
Daily costs: 50 * 0.00005 SOL = 0.0025 SOL
Monthly profit: ~4.5 SOLModerate scenario -- A relayer processing 200 withdrawals per day across multiple pools:
Daily revenue: ~0.8 SOL (mix of pool sizes)
Monthly revenue: ~24 SOL
Daily costs: 200 * 0.00005 = 0.01 SOL
Monthly profit: ~24 SOLAggressive scenario -- A popular relayer processing 1,000+ withdrawals per day:
Daily revenue: ~5 SOL (mix of pool sizes, including large pools)
Monthly revenue: ~150 SOL
Daily costs: 1000 * 0.00005 = 0.05 SOL
Monthly profit: ~150 SOLSPL Token Revenue
For USDC and other SPL token pools, fees are earned in the token itself. A relayer processing USDC withdrawals earns USDC, which can be held or converted to SOL. The per-transaction SOL gas cost still applies, so the relayer needs a SOL balance for gas regardless of the token pool being served.
Revenue per Pool Type
| Pool | Fee (0.3%) | USD Value (approx) | Transactions for $100/day |
|---|---|---|---|
| SOL-0.1 | 0.0003 SOL | ~$0.05 | 2,000 |
| SOL-1 | 0.003 SOL | ~$0.50 | 200 |
| SOL-10 | 0.03 SOL | ~$5.00 | 20 |
| SOL-100 | 0.3 SOL | ~$50.00 | 2 |
| USDC-1000 | 3 USDC | $3.00 | 34 |
| USDC-10000 | 30 USDC | $30.00 | 4 |
Note: USD values assume a SOL price of approximately $150. Actual values will vary.
Competition Between Relayers
The relayer market is competitive. Multiple relayers serve the same pools, and the SDK selects relayers based on fee, reliability, and latency. This creates market dynamics that benefit users while still allowing profitable relayer operation.
How Users Choose Relayers
The SDK's default relayer selection algorithm considers the following factors, in order of priority:
- Fee -- Lower fees are preferred. The SDK sorts available relayers by fee amount for the relevant pool.
- Reliability -- Relayers with higher success rates and longer uptime are preferred. The SDK tracks success rates from the
/statusendpoint. - Latency -- Relayers that respond faster are preferred when fees are equal. The SDK measures round-trip time to each relayer.
- Availability -- Relayers that are currently at capacity (queue full) are excluded.
Competitive Dynamics
- Race to the bottom -- Fee competition pushes fees down over time. However, fees cannot go below the transaction cost without the relayer losing money, creating a natural floor.
- Differentiation -- Relayers can differentiate on reliability (better uptime), speed (faster confirmation), or geography (lower latency for regional users).
- Niche pools -- Relayers that support less common pools (large denominations, specific SPL tokens) face less competition and can charge higher fees.
- Volume advantages -- Relayers with more volume can afford lower per-transaction margins because they benefit from economies of scale in server costs.
Recommended Fee Strategy
For new relayer operators:
- Start at 0.3% -- This is the current market baseline. Starting higher will result in little traffic as the SDK will prefer cheaper alternatives.
- Monitor competitors -- Check other relayers' fees through the registry. Adjust to remain competitive.
- Focus on reliability -- Users will pay slightly higher fees for relayers with a proven track record. Invest in uptime and monitoring.
- Consider specialization -- If you can reliably serve high-denomination pools or niche token pools, you can sustain higher margins due to less competition.
Fee Floor Protection
The protocol does not enforce a minimum fee across relayers. However, the community-recommended minimum of 0.1% exists to prevent unsustainable pricing that would drive relayers out of the market, ultimately harming the protocol's decentralization. Relayers that charge below cost are likely operating at a loss for strategic reasons (market entry, market share capture) and may not be sustainable long-term.
Operational Costs Summary
Beyond transaction fees, relayer operators should account for the following ongoing costs:
| Cost | Monthly Estimate | Notes |
|---|---|---|
| Server hosting | $5 - $50 | VPS or cloud instance |
| RPC provider | $0 - $100 | Free tier may suffice for low volume |
| Domain and TLS | $1 - $5 | Required for HTTPS |
| Monitoring/alerting | $0 - $20 | Grafana Cloud free tier or similar |
| SOL float | Variable | Initial capital, recovered via fees |
| Total overhead | $6 - $175/month |
These costs are modest relative to potential revenue, making relayer operation accessible to individual operators, not just large infrastructure providers.