Skip to main content

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?

  1. Frontend called POST /api/perpai/quote
  2. Server returned 402 Payment Required with payment details
  3. You signed EIP-3009 authorization (no gas fee)
  4. Frontend submitted to POST /api/pay
  5. Facilitator SDK verified signature and settled USDC transfer
  6. Payment recorded in database
  7. Frontend retried quote request with payment ID
  8. Server returned quote data

Next Steps