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 vault names with getVaultsByConfig() before making deposit calls. See the migration guide.
The unified deposit API handles three authorization paths automatically:

Prerequisites

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

Installation

Imports

Step 0: Fetch Available Vaults

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

Step 1: Select a Vault

Once the user picks a vault 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

For more details on the deposit API, see Deposit Workflow.