The pattern
Payment services, game servers and backends on other chains already speak HTTP. An x402 gateway lets them use Fade with one request. x402 turns a payment into a step of an HTTP request: the server answers402 Payment Required with what it wants paid, the client pays in a stablecoin and retries with proof of payment, and the server serves the request.
- checks the payment;
- opens the Fade wager with itself as
integratorAuthority,payerandstakeOwner, staking from its own USDC account, with the caller’s account asbeneficiary; - hands the wager to a keeper, or settles it itself;
- returns the wager address, which the caller can follow on-chain or through the keeper API.
What it unlocks
Any service that can make an HTTP request can offer a fixed-odds payout: a checkout backend, a web2 game studio, a payment API, a server on another chain. The caller needs no Solana SDK, no wallet and no SOL. This is also the cheapest way to add the checkout and rewards use cases to an existing payment flow.Design notes for a gateway
- Simulate before you answer 402. Build the
open_wagertransaction for the requested paytable and simulate it against the current pool. If it would be refused (for examplePerWagerCapon a pool that cannot back the prize yet), say so before taking payment. See Errors. - Pin the paytables. Offer named paytables you have checked, rather than accepting arbitrary ones from callers.
- Return the wager address immediately. The draw resolves a few seconds later; let callers poll the keeper’s
GET /v1/wagers/:addressor watch the chain. - Keep the payment and the wager linked. Store the payment reference against the wager address, so a caller can verify what applied.