Skip to main content
Copy this page into your AI coding assistant (Cursor, Copilot, Claude, etc.) for accurate Amplify account direct contract completions.
This page is a condensed, single-file reference for calling Amplify account contracts directly — without the SDK. For full documentation with interactive examples, see the Direct Contract Integration guides.
Prefer server-side calldata instead of direct contract calls? Use the Calldata AI Reference — the REST path returns ready-to-sign transaction data with no local ABI management. Skill-aware tools also auto-discover the amplify-earn-api-calldata Agent Skill at /.well-known/agent-skills/index.json.

Contract Source

Open-source Solidity: github.com/paxoslabs/nucleus-boring-account

Architecture

ContractRoleGraphQL Field
DistributorCodeDepositorDeposits (standard + permit)vault.communityCodeDepositorModuleId
WithdrawQueueWithdrawal orders + cancellations (ERC-721 per order)vault.withdrawQueueModuleId
BoringVaultERC-20 account share token (18 decimals)vault.boringVaultAddress
AccountantExchange rate oraclevault.accountantModuleId
TellerPause statevault.tellerModuleId
FeeModuleWithdrawal fee calculatorObtained via WithdrawQueue.feeModule()
communityCodeDepositorModuleId is a legacy GraphQL field name. It returns the DistributorCodeDepositor address.

Obtain Addresses — GraphQL API

Query

Example cURL

Response Shape

Multiple configs can reference the same account. Deduplicate by vault.id. withdrawQueueModuleId and communityCodeDepositorModuleId can be null if the account doesn’t support those operations.

GraphQL Variables

VariableTypeDescription
chainIdIntFilter by chain (e.g., 1 for Ethereum, 8453 for Base)
yieldTypeYieldTypeFilter by yield type: CORE, TREASURY, FRONTIER, PRIME, TBILL, LENDING

ABIs

DistributorCodeDepositor

WithdrawQueue

ERC-20 (BoringVault shares + deposit tokens)

Accountant

FeeModule

Teller


Pre-Flight: Pause State Check

Before submitting any deposit or withdrawal transaction, check whether the account is paused:

Deposit Flow — Standard (Approve + Deposit)

Two transactions: ERC-20 approve() then deposit().

Deposit Parameters

ParameterTypeDescription
depositAssetaddressERC-20 token to deposit (e.g., USDC)
depositAmountuint256Amount in token’s smallest unit (USDC 6 decimals: 1000 USDC = 1000000000)
minimumMintuint256Min shares to receive (slippage protection). 0 to disable.
toaddressRecipient of minted account shares
distributorCodebytesReferral code as bytes. 0x if none.

Distributor Codes

If Paxos Labs provided a distributor code, encode it as bytes: toHex('your_code') in JS, b'your_code' in Python, []byte("your_code") in Go. Otherwise pass 0x / b"" / []byte{}.

Deposit Flow — Permit (Single Transaction)

For tokens supporting EIP-2612 (USDC, USDG, pyUSD, USD₮0). Not available for USDT. Not available for smart contract wallets (Privy Smart Wallets, Safe) — they cannot sign typed data.

Permit EIP-712 Domain (varies by token)

Tokennameversion
USDC"USD Coin""2"
USDGCheck tokenCheck
pyUSDCheck tokenCheck
USD₮0Check tokenCheck
Always read the token’s name(), version() (or EIP712_VERSION()) and use those for the domain.

Slippage / minimumMint Formula

Common default: SLIPPAGE_BPS = 50 (0.5%). Setting minimumMint = 0 disables slippage protection (fine for testing, not production).

Withdrawal Flow (Complete)

Withdrawals are order-based, not instant. The account operator fulfills orders (typically within 24 hours).

submitOrder Parameters

FieldTypeDescription
amountOfferuint256Account shares to offer (18 decimals)
wantAssetaddressToken to receive (e.g., USDC). Must be withdrawable.
intendedDepositoraddressMust match msg.sender
receiveraddressWhere the want asset is sent when fulfilled
refundReceiveraddressWhere shares go if order is cancelled
signatureParamstuplePass all-zeros struct for standard ERC-20 approval flow

Share-to-Asset Conversion

Withdrawal Fee Calculation

Fee is subtracted from offered shares. To receive the full want amount, offer sharesNeeded + feeAmount.

Cancellation Flow — Direct

Only orders with PENDING status (value 1) can be cancelled. The WithdrawQueue is an ERC-721 — each order is an NFT.
If you already have the orderIndex (from the OrderSubmitted event), skip enumeration and call cancelOrder(orderIndex) directly after verifying getOrderStatus(orderIndex) === 1.

Cancellation Flow — Meta-Transaction (Gasless)

A relayer submits the cancellation on behalf of the order owner using an EIP-712 signature.

EIP-712 Cancel Signature

The deadline in the signed message and the function call must match exactly. Reverts with SignatureExpired if the block timestamp exceeds the deadline.

REST API Endpoints

All require x-api-key: <your_key> header. Base URL: https://api.paxoslabs.com

Account APY

apy is a decimal string — multiply by 100 for percentage (e.g., 0.0523 = 5.23%).

Account TVL

Account Assets (simplified account discovery)

Only returns vaultAddress (BoringVault). Use the GraphQL API for full contract addresses.

Withdrawal Requests

REST status values: PENDING, COMPLETE, PENDING_REFUND, REFUNDED.

Order Status Enum (On-Chain)

ValueStatusCancellable?
0NOT_FOUNDNo
1PENDINGYes
2COMPLETENo
3COMPLETE_PRE_FILLEDNo
4PENDING_REFUNDNo
5COMPLETE_REFUNDEDNo
6FAILED_TRANSFER_REFUNDEDNo

Token Notes

TokenDecimalsPermit (EIP-2612)Notes
USDC6Yes
USDG6Yes
pyUSD6Yes
USD₮06Yes
USDT6NoMust reset allowance to 0 before setting new value
For USDT: if current allowance > 0, call approve(spender, 0) first, then approve(spender, amount). Smart contract wallets (Privy Smart Wallets, Safe) cannot sign permits — use the standard approve + deposit flow.

Common Revert Errors

ErrorCauseFix
TellerIsPausedAccount operations pausedCheck Teller.isPaused() before submitting
PermitFailedAndAllowanceTooLowInvalid permit sig and no existing ERC-20 approvalFix EIP-712 domain params or use approve flow
ERC20: insufficient allowanceSpender not approvedCall approve() on token first
ERC20: transfer amount exceeds balanceInsufficient token balanceCheck balanceOf() before transacting
AmountBelowMinimumWithdrawal order below minimum sizeCheck WithdrawQueue.minimumOrderSize()
InvalidDepositorintendedDepositormsg.senderSet intendedDepositor to the transaction sender
AssetNotSupportedWant asset not enabled for this accountCheck supportedAssets with withdrawable: true
OnlyOrderOwnerCanCancelCaller doesn’t own the order NFTOnly the NFT holder can cancel
InvalidOrderTypeOrder not in PENDING statusCheck getOrderStatus() — only status 1 cancellable
SignatureExpiredMeta-tx cancel deadline passedRe-sign with future deadline

Supported Chains

SDK built-in networks (for parity with @paxoslabs/amplify-sdk on-chain reads):
ChainID
Ethereum1
Sepolia11155111
Base8453
HyperEVM999
Stable Testnet2201