Skip to main content
This guide demonstrates complete deposit flows using the unified deposit API, which automatically detects the optimal authorization method (permit vs approval).
Breaking change in v0.5.0: Transaction functions now use vaultName instead of yieldType. Discover account names with getVaultsByConfig() before making deposit calls. See the migration guide.
The unified deposit API handles three authorization paths automatically:
MethodDescription
PermitGas-efficient off-chain signature (EIP-2612). Single transaction — no separate approval needed.
ApprovalStandard ERC-20 approve transaction followed by the deposit transaction.
Already ApprovedDirect deposit when sufficient allowance already exists.

Prerequisites

  • Node.js 22+
  • Amplify API key from Paxos Labs
  • SDK initialized with initAmplifySDK()

Installation

Imports

Step 0: Fetch Available Accounts

Retrieve all accounts accessible with your API key. This is the data you need to build an account selector for your users.
You can also narrow the list with filters:

Step 1: Select an Account

Once the user picks an account from your UI, record its vault.name — all subsequent transaction calls require it.

Step 2: Check Authorization

Determine the optimal authorization method for this deposit. The SDK auto-detects permit support.

Step 3: Execute Deposit

After authorization, prepare and submit the deposit transaction.

Complete Examples

useDeposit Hook

Deposit Component

Customization

Custom Slippage

Distributor Code

Force Approval Flow

Troubleshooting

IssueSolution
”SDK not initialized”Call initAmplifySDK() before using hooks
”Connect a wallet first”Ensure user has connected wallet
Permit signature failsToken may not support EIP-2612, falls back to approval
Transaction revertsCheck token balance and allowance
For more details on the deposit API, see Deposit Workflow.