Where the money goes
You pay in USDC. Fees are paid in EGLD. Something has to convert one into the other, and the honest thing is to say exactly where that happens and what it does to your money.
It happens in the contract, in the same transaction as your payment. There is no treasury wallet that receives your USDC and converts it later at a time of our choosing.
The path of one payment
Step by step:
- You transfer USDC to the contract. This is an ordinary ESDT transfer that also calls a
contract function —
deposit,depositForordepositAndSubscribe. - The contract swaps it in the same call. USDC becomes WEGLD on the xExchange pair, and WEGLD
is unwrapped to EGLD. If the venue is paused or the swap fails, the whole transaction reverts:
your USDC never leaves your wallet and you get
SWAP_VENUE_PAUSEDrather than a half-finished state. - The EGLD is split. 30% to the treasury, 70% to the relayer pool. The pool is what funds the relayer wallets that pay your fees.
- You are credited. Your account is credited 1:1 from the USDC you paid, not from what the swap returned. The exchange rate is our problem, not yours: a bad swap costs CoRelayer, not the customer.
Credits, plans and escrow
| What it is | Refundable | |
|---|---|---|
| Credits | USDC-denominated balance inside the contract, created by a deposit. | No |
| A plan block | What a purchase writes: cap, period length, pay-as-you-go price and sender limit, frozen for the term. | No |
| Escrow | Credits set aside for pay-as-you-go usage that has not happened yet. | No — unused escrow returns to your credits when you turn pay-as-you-go off |
Nothing that enters the contract goes back to a wallet. Credits and plans are non-refundable, and the contract has no endpoint that would make them refundable; there is no discretionary "we can return it if we want to" path either, which is the same statement seen from the other side.
What the contract does guarantee is that escrow cannot be trapped. Unused escrow returns to the
account's credits once pay-as-you-go is off — normally through a closing settlement line, and, if
the settlement key is dead or hostile, through releaseEscrow, which anyone may call seven days
later and which no pause can block. (Credits and billing)
What the split pays for
The relayer pool (70%) buys the EGLD that pays your fees. This is the part that has to cover:
- the fee of every transaction we relay, at its worst case, because a failed execution costs the relayer the full gas limit and the network refunds nothing;
- the volatility between the moment you pay a fixed USDC price and the moment the EGLD is spent;
- the float each relayer holds so that it can accept the next transaction.
The treasury (30%) is everything else: infrastructure, development and margin.
Both shares are on chain, and the distribution to relayer wallets is itself a contract endpoint
with its own events — poolDistributed, distributionDeferred — so the accounting is auditable by
anyone, not just by us.
Why the swap is inside the payment
It would be simpler to receive USDC, keep it, and buy EGLD periodically. We do not, for two reasons:
- It would make us a custodian of your payment for a while. Swapping in the same call means there is never a moment where the contract holds a pile of customer USDC waiting for a decision.
- It would move the exchange-rate risk to the wrong side. Converting at payment time fixes the coverage of what you just bought. Converting later means the coverage of your prepaid plan depends on when we felt like trading.
The consequence — that a paused or broken venue makes purchases fail outright — is a real cost of
this choice, and it is why SWAP_VENUE_PAUSED is a documented, expected error rather than an
internal one.
When a price change touches your money
It does not, for anything you already paid for.
A purchase snapshots its terms into a plan block. Changing the tariff, editing a tier or retiring a tier never reaches into a block that was already paid for. A tariff increase additionally cannot take effect for 48 hours, and that notice period is a compiled constant of the contract — not a setting that the same key which sets the tariff could also set to zero.
The accounting you can check
| Contract view | Tells you |
|---|---|
getTotalOutstandingCredits | Credits and pay-as-you-go escrow still owed to accounts. |
getDistributionState | The relayer pool and how it is being distributed. |
getSwapBudget | The bounds the contract applies to its own swapping. |
getTariffHistory | Every tariff that has ever been in force, with the moment it became effective. |
Every one of these is a read-only call that costs nothing and needs no permission. (Contract reference)