Prerequisites
Cronos Testnet wallet connected
USDC balance (get from faucet)
Relay Core running locally
Steps
1
Navigate to Trade Page
2
Select Direct Payment
Choose “Direct Payment” option (not session)
3
Click Get Quote
Click the “Get Quote” button
4
Sign Authorization
Your wallet will prompt you to sign an EIP-3009 authorization.
This does NOT execute a transaction, just creates a signature.
5
Payment Settles
The Facilitator SDK verifies your signature and settles the USDC transfer on-chain.
You’ll see a transaction hash in the response.
6
View Quote
Quote data returns with entry price, liquidation price, and funding rates.
Payment complete! You’ve executed your first x402 transaction.
What Happened?
- Frontend called
POST /api/perpai/quote - Server returned
402 Payment Requiredwith payment details - You signed EIP-3009 authorization (no gas fee)
- Frontend submitted to
POST /api/pay - Facilitator SDK verified signature and settled USDC transfer
- Payment recorded in database
- Frontend retried quote request with payment ID
- Server returned quote data