Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developers.paxoslabs.com/llms.txt

Use this file to discover all available pages before exploring further.

The Amplify SDK wraps several REST API endpoints and on-chain reads behind convenient functions like getVaultAPY() and getWithdrawalRequests(). When integrating directly, you call these yourself. This page covers every read-only operation the SDK provides, with the raw API calls and contract reads you need.
All REST API endpoints require an API key passed via the x-api-key header. Contact Paxos Labs to get one. See the API Reference for full endpoint documentation including pagination, filtering, and response schemas.

Account Discovery

The SDK’s getVaultsByConfig() and getSupportedAssets() are powered by a GraphQL API. For direct integrations, use the REST endpoint GET /v2/amplify/vaultAssets instead.

List All Accounts

curl -s "https://api.paxoslabs.com/v2/amplify/vaultAssets?pageSize=100" \
  -H "x-api-key: $AMPLIFY_API_KEY" | jq
Response shape:
{
  "vaultAssets": [
    {
      "vaultAddress": "0x...",
      "chainId": 1,
      "assetAddress": "0x...",
      "depositable": true,
      "withdrawable": true
    }
  ],
  "nextPageToken": null,
  "tokenMetadata": {
    "1:0xA0b8...": {
      "address": "0xA0b8...",
      "chain_id": "1",
      "symbol": "USDC",
      "name": "USD Coin",
      "decimals": "6"
    }
  }
}
The tokenMetadata map is keyed by chainId:address and provides symbol, name, and decimals for each token — so you don’t need separate on-chain calls to resolve token info.

Withdraw-Eligible Assets

To find which assets support withdrawals for a specific account, filter the vaultAssets endpoint by withdrawable=true:
curl -s "https://api.paxoslabs.com/v2/amplify/vaultAssets?filter=withdrawable%3Dtrue%20AND%20vaultAddress%3D0x...&pageSize=100" \
  -H "x-api-key: $AMPLIFY_API_KEY" | jq

Account APY

Equivalent to SDK’s client.vaults.getApys() — see SDK AI Reference. Uses GET /v2/amplify/vaultApys.
VAULT_ADDRESS="0x..."
curl -s "https://api.paxoslabs.com/v2/amplify/vaultApys?filter=vaultAddress%3D${VAULT_ADDRESS}&orderByTimestamp=desc&pageSize=1" \
  -H "x-api-key: $AMPLIFY_API_KEY" | jq '.vaultApys[0]'
The apy field is a decimal (e.g., 0.0523 = 5.23%). Multiply by 100 to display as a percentage.

Account TVL

Equivalent to SDK’s client.vaults.getTvls() — see SDK AI Reference. Uses GET /v2/amplify/vaultTvls.
VAULT_ADDRESS="0x..."
curl -s "https://api.paxoslabs.com/v2/amplify/vaultTvls?filter=vaultAddress%3D${VAULT_ADDRESS}&includeCurrent=true&orderByTimestamp=desc&pageSize=1" \
  -H "x-api-key: $AMPLIFY_API_KEY" | jq '.vaultTvls[0]'

Withdrawal Request History

Equivalent to SDK’s client.withdraw.listRequests() — see SDK AI Reference. Uses GET /v2/amplify/withdrawalRequests.
USER_ADDRESS="0x..."
curl -s "https://api.paxoslabs.com/v2/amplify/withdrawalRequests?filter=userAddress%3D${USER_ADDRESS}&pageSize=20" \
  -H "x-api-key: $AMPLIFY_API_KEY" | jq

Status Values

StatusDescription
PENDINGOrder submitted, awaiting fulfillment by the account operator
COMPLETEFulfilled — want asset sent to receiver
PENDING_REFUNDCancellation in progress — shares being returned
REFUNDEDCancelled — shares returned to refund receiver

Token Balances

Read ERC-20 token balances directly from the blockchain.
const erc20Abi = [
  { inputs: [{ name: 'account', type: 'address' }], name: 'balanceOf', outputs: [{ name: '', type: 'uint256' }], stateMutability: 'view', type: 'function' },
  { inputs: [], name: 'decimals', outputs: [{ name: '', type: 'uint8' }], stateMutability: 'view', type: 'function' },
] as const

async function getTokenBalance(tokenAddress: Address, walletAddress: Address) {
  const [balance, decimals] = await Promise.all([
    publicClient.readContract({ address: tokenAddress, abi: erc20Abi, functionName: 'balanceOf', args: [walletAddress] }),
    publicClient.readContract({ address: tokenAddress, abi: erc20Abi, functionName: 'decimals' }),
  ])
  return { balance, decimals }
}

Allowance Checking

Equivalent to the SDK’s client.permit.authorize(...) branch resolution — the v1.0.0 SDK returns 'permit' | 'approval' | 'already_approved' based on the same on-chain ERC20.allowance(owner, spender) check shown below. Direct-contract callers run the read themselves.
async function checkAllowance(tokenAddress: Address, owner: Address, spender: Address) {
  const allowanceAbi = [{ inputs: [{ name: 'owner', type: 'address' }, { name: 'spender', type: 'address' }], name: 'allowance', outputs: [{ name: '', type: 'uint256' }], stateMutability: 'view', type: 'function' }] as const
  const allowance = await publicClient.readContract({ address: tokenAddress, abi: allowanceAbi, functionName: 'allowance', args: [owner, spender] })
  return allowance
}

// For deposits: checkAllowance(USDC, walletAddress, COMMUNITY_CODE_DEPOSITOR)
// For withdrawals: checkAllowance(BORING_VAULT, walletAddress, WITHDRAW_QUEUE)

Exchange Rate

The Accountant contract tracks the exchange rate between account shares and the underlying asset. You must pass the quote asset address (e.g., USDC) to get the rate denominated in that asset.
const accountantAbi = [{ inputs: [{ name: 'quote', type: 'address' }], name: 'getRateInQuoteSafe', outputs: [{ name: 'rateInQuote', type: 'uint256' }], stateMutability: 'view', type: 'function' }] as const

async function getExchangeRate(accountantAddress: Address, quoteAsset: Address) {
  return publicClient.readContract({ address: accountantAddress, abi: accountantAbi, functionName: 'getRateInQuoteSafe', args: [quoteAsset] })
}

Withdrawal Fees

Equivalent to SDK’s client.withdraw.calculateFee() — see SDK AI Reference. Reads from the WithdrawQueue’s FeeModule on-chain.
const queueFeeAbi = [{ inputs: [], name: 'feeModule', outputs: [{ name: '', type: 'address' }], stateMutability: 'view', type: 'function' }] as const
const feeModuleAbi = [
  { inputs: [{ name: 'amount', type: 'uint256' }, { name: 'offerAsset', type: 'address' }, { name: 'wantAsset', type: 'address' }, { name: 'receiver', type: 'address' }], name: 'calculateOfferFees', outputs: [{ name: 'feeAmount', type: 'uint256' }], stateMutability: 'view', type: 'function' },
  { inputs: [], name: 'offerFeePercentage', outputs: [{ name: '', type: 'uint256' }], stateMutability: 'view', type: 'function' },
] as const

async function getWithdrawalFee(shareAmount: bigint, wantAsset: Address, receiver: Address) {
  const feeModuleAddr = await publicClient.readContract({ address: WITHDRAW_QUEUE, abi: queueFeeAbi, functionName: 'feeModule' })
  const [feeAmount, feePercentage] = await Promise.all([
    publicClient.readContract({ address: feeModuleAddr, abi: feeModuleAbi, functionName: 'calculateOfferFees', args: [shareAmount, BORING_VAULT, wantAsset, receiver] }),
    publicClient.readContract({ address: feeModuleAddr, abi: feeModuleAbi, functionName: 'offerFeePercentage' }),
  ])
  return { feeAmount, feePercentage }
}

Pause State

Before submitting transactions, check whether the account is paused.
const tellerAbi = [{ inputs: [], name: 'isPaused', outputs: [{ name: '', type: 'bool' }], stateMutability: 'view', type: 'function' }] as const

async function checkPauseState(tellerAddress: Address) {
  return publicClient.readContract({ address: tellerAddress, abi: tellerAbi, functionName: 'isPaused' })
}
If the Teller is paused, deposit and withdrawal transactions will revert. Check pause state before submitting transactions in production.

SDK-to-Direct Mapping Reference

v1.0.0 SDK callDirect contract / API equivalent
new AmplifyClient({ apiKey })No equivalent needed — configure your HTTP client and contract addresses directly
client.vaults.list({ filter? })Amplify GraphQL API — see vault-discovery
client.vaults.listAssets({ filter? })GET /v2/amplify/vaultAssets — filter by depositable: true or withdrawable: true
client.vaults.getApys({ filter? })GET /v2/amplify/vaultApys
client.vaults.getTvls({ filter? })GET /v2/amplify/vaultTvls
client.vaults.getSupplyCaps({ filter? })On-chain: DistributorCodeDepositor.supplyCapInBase() per asset
client.withdraw.listRequests({ filter? })GET /v2/amplify/withdrawalRequests
client.withdraw.calculateFee({...})On-chain: WithdrawQueue.feeModule()FeeModule.calculateOfferFees()
client.users.getPositions({...})On-chain: BoringVault.balanceOf(user) + Accountant.getRateInQuoteSafe(quote)
client.permit.authorize({...})On-chain: ERC20.allowance(owner, spender) — branch on the result
client.deposit.prepareDeposit({...})Encode DistributorCodeDepositor.deposit() or depositWithPermit() directly
client.withdraw.prepareWithdrawal({...})Encode WithdrawQueue.submitOrder() directly
client.withdraw.cancel({...})Encode WithdrawQueue.cancelOrder() directly

Next Steps