Skip to main content
GET
/
v1
/
wpaxg
/
swapQuotes
Get WPAXG swap quote
curl --request GET \
  --url https://api.paxoslabs.com/v1/wpaxg/swapQuotes \
  --header 'x-api-key: <api-key>'
{
  "transaction": {
    "to": "0x0d0e364aa7852291883c162b22d6d81f6355428f",
    "data": "0x...",
    "value": "0",
    "gas": "150000",
    "gasPrice": "20000000000"
  },
  "buyAmount": "2500000000",
  "minBuyAmount": "2475000000",
  "allowanceTarget": "0x0000000000001fF3684f28c67538d4D072C22734",
  "currentAllowance": "0",
  "permit2": {
    "type": "Permit2",
    "hash": "0xafb2c83591d83ec04d0792eaa00d36f5a509dfab6666fa787e310afa276bf379",
    "eip712": {
      "types": {},
      "domain": {
        "name": "Permit2",
        "chainId": 1,
        "verifyingContract": "0x000000000022d473030f116ddee9f6b43ac78ba3"
      },
      "message": {
        "permitted": {
          "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "amount": "1000000000000000000"
        },
        "spender": "0x0d0e364aa7852291883c162b22d6d81f6355428f",
        "nonce": "2241959297937691820908574931991559",
        "deadline": "1739918089"
      },
      "primaryType": "PermitTransferFrom"
    }
  }
}

Authorizations

x-api-key
string
header
required

API key in format: pxl_<public_id>_

Query Parameters

chainId
enum<number>
required

EVM chain ID. Supported: 10 (Optimism).

Available options:
10
Example:

10

offerAsset
string
required

Token address to offer (sell).

Example:

"0x5cb5c4d5e8b184a364534bc688da0553ccf8f484"

wantAsset
string
required

Token address to receive (buy).

Example:

"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"

offerAmount
string
required

Amount to offer, in the smallest unit of the token.

Example:

"1000000000000000000"

userAddress
string
required

Wallet address executing the swap.

Example:

"0x1234567890abcdef1234567890abcdef12345678"

authMethod
enum<string>
default:allowance_holder

Authorization method. allowance_holder (recommended): standard approve flow. permit2: requires signing EIP-712 typed data.

Available options:
allowance_holder,
permit2
Example:

"allowance_holder"

Response

transaction
object
required
buyAmount
string
required

Expected output amount in buy token wei.

Example:

"2500000000"

minBuyAmount
string
required

Minimum acceptable output amount accounting for slippage. Use this to verify swap execution.

Example:

"2475000000"

allowanceTarget
string
required

Contract address to approve tokens to before swapping. AllowanceHolder for default auth, Permit2 for permit2 auth.

Example:

"0x0000000000001fF3684f28c67538d4D072C22734"

currentAllowance
string

User's current allowance for the allowanceTarget contract. If less than sellAmount, approval is needed.

Example:

"0"

permit2
object

Present when authMethod=permit2. Contains EIP-712 typed data to sign before executing the swap.