WPAXG Swap Integration
This guide walks through integrating the WPAXG swap REST API into your application.Currently only available via REST API.
Prerequisites
- A Paxos Labs API key
- An Optimism RPC endpoint
- A wallet library (viem, ethers, wagmi, etc.)
Supported Token Pairs
WPAXG must be either theofferAsset (sell) or wantAsset (buy) in every swap request. Supported stablecoins for the other side of the trade:
| Token | Address |
|---|---|
| USDC | 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 |
Getting a Swap Quote
Request a quote by calling the/v1/wpaxg/swapQuotes endpoint:
Response Structure
The quote response includes:Handling Token Approvals
Before executing the swap, ensure the user has approved sufficient tokens:Executing the Swap
Once approved, execute the swap using the provided calldata:Using Permit2 Authorization
For gasless approvals, use thepermit2 auth method:
Error Handling
The API returns standard HTTP error codes:| Status | Description |
|---|---|
| 400 | Invalid parameters or insufficient liquidity |
| 503 | DEX aggregator temporarily unavailable |