This page is a condensed, single-file reference for calling Amplify vault
contracts directly — without the SDK. For full documentation with interactive
examples, see the Direct Contract Integration
guides.
Contract Source
Open-source Solidity: github.com/paxoslabs/nucleus-boring-vaultArchitecture
| Contract | Role | GraphQL Field |
|---|---|---|
| DistributorCodeDepositor | Deposits (standard + permit) | vault.communityCodeDepositorModuleId |
| WithdrawQueue | Withdrawal orders + cancellations (ERC-721 per order) | vault.withdrawQueueModuleId |
| BoringVault | ERC-20 vault share token (18 decimals) | vault.boringVaultAddress |
| Accountant | Exchange rate oracle | vault.accountantModuleId |
| Teller | Pause state | vault.tellerModuleId |
| FeeModule | Withdrawal fee calculator | Obtained via WithdrawQueue.feeModule() |
communityCodeDepositorModuleId is a legacy GraphQL field name. It returns the DistributorCodeDepositor address.
Obtain Addresses — GraphQL API
Query
Example cURL
Response Shape
vault.id. withdrawQueueModuleId and communityCodeDepositorModuleId can be null if the vault doesn’t support those operations.
GraphQL Variables
| Variable | Type | Description |
|---|---|---|
chainId | Int | Filter by chain (e.g., 1 for Ethereum, 8453 for Base) |
yieldType | YieldType | Filter 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 vault is paused:Deposit Flow — Standard (Approve + Deposit)
Two transactions: ERC-20approve() then deposit().
Deposit Parameters
| Parameter | Type | Description |
|---|---|---|
depositAsset | address | ERC-20 token to deposit (e.g., USDC) |
depositAmount | uint256 | Amount in token’s smallest unit (USDC 6 decimals: 1000 USDC = 1000000000) |
minimumMint | uint256 | Min shares to receive (slippage protection). 0 to disable. |
to | address | Recipient of minted vault shares |
distributorCode | bytes | Referral 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)
| Token | name | version |
|---|---|---|
| USDC | "USD Coin" | "2" |
| USDG | Check token | Check |
| pyUSD | Check token | Check |
| USD₮0 | Check token | Check |
name(), version() (or EIP712_VERSION()) and use those for the domain.
Slippage / minimumMint Formula
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 vault operator fulfills orders (typically within 24 hours).submitOrder Parameters
| Field | Type | Description |
|---|---|---|
amountOffer | uint256 | Vault shares to offer (18 decimals) |
wantAsset | address | Token to receive (e.g., USDC). Must be withdrawable. |
intendedDepositor | address | Must match msg.sender |
receiver | address | Where the want asset is sent when fulfilled |
refundReceiver | address | Where shares go if order is cancelled |
signatureParams | tuple | Pass all-zeros struct for standard ERC-20 approval flow |
Share-to-Asset Conversion
Withdrawal Fee Calculation
sharesNeeded + feeAmount.
Cancellation Flow — Direct
Only orders withPENDING status (value 1) can be cancelled. The WithdrawQueue is an ERC-721 — each order is an NFT.
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
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 requirex-api-key: <your_key> header. Base URL: https://api.paxoslabs.com
Vault APY
apy is a decimal string — multiply by 100 for percentage (e.g., 0.0523 = 5.23%).
Vault TVL
Vault Assets (simplified vault discovery)
vaultAddress (BoringVault). Use the GraphQL API for full contract addresses.
Withdrawal Requests
PENDING, COMPLETE, PENDING_REFUND, REFUNDED.
Order Status Enum (On-Chain)
| Value | Status | Cancellable? |
|---|---|---|
| 0 | NOT_FOUND | No |
| 1 | PENDING | Yes |
| 2 | COMPLETE | No |
| 3 | COMPLETE_PRE_FILLED | No |
| 4 | PENDING_REFUND | No |
| 5 | COMPLETE_REFUNDED | No |
| 6 | FAILED_TRANSFER_REFUNDED | No |
Token Notes
| Token | Decimals | Permit (EIP-2612) | Notes |
|---|---|---|---|
| USDC | 6 | Yes | — |
| USDG | 6 | Yes | — |
| pyUSD | 6 | Yes | — |
| USD₮0 | 6 | Yes | — |
| USDT | 6 | No | Must reset allowance to 0 before setting new value |
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
| Error | Cause | Fix |
|---|---|---|
TellerIsPaused | Vault operations paused | Check Teller.isPaused() before submitting |
PermitFailedAndAllowanceTooLow | Invalid permit sig and no existing ERC-20 approval | Fix EIP-712 domain params or use approve flow |
ERC20: insufficient allowance | Spender not approved | Call approve() on token first |
ERC20: transfer amount exceeds balance | Insufficient token balance | Check balanceOf() before transacting |
AmountBelowMinimum | Withdrawal order below minimum size | Check WithdrawQueue.minimumOrderSize() |
InvalidDepositor | intendedDepositor ≠ msg.sender | Set intendedDepositor to the transaction sender |
AssetNotSupported | Want asset not enabled for this vault | Check supportedAssets with withdrawable: true |
OnlyOrderOwnerCanCancel | Caller doesn’t own the order NFT | Only the NFT holder can cancel |
InvalidOrderType | Order not in PENDING status | Check getOrderStatus() — only status 1 cancellable |
SignatureExpired | Meta-tx cancel deadline passed | Re-sign with future deadline |
Supported Chains
| Chain | ID |
|---|---|
| Ethereum | 1 |
| HyperEVM | 999 |
| Base | 8453 |