1. Access & Environment
- Request a Paxos-issued Amplify API key for your environment (sandbox, staging, production).
- Store the key as a secret (
.env, HashiCorp Vault, CI secrets manager). - Confirm network access to required RPC endpoints (Alchemy, Infura, or your in-house nodes).
- Decide where transactions are signed (end-user wallet via Privy, custodial flow, or backend signer).
2. Scaffold the App
- Follow the Quickstart to spin up a Vite + React + Privy project.
- Mirror the recommended Directory Structure and create providers for Privy, Amplify, and your data cache.
- Add feature flags or progressive rollout gates if you are staging Earn access.
3. Initialize the SDK
- Call
initAmplifySDK(apiKey)once on boot (client or server). - Wrap the call in a provider that throws if the key is missing or the init step fails.
- Track initialization metrics to catch missing environment variables early.
4. Discover Vaults & Assets
- Use
fetchSupportedAssetsto build product selectors.
- Cache results (React Query, SWR, server-side caches) with sensible revalidation periods.
- Map vault metadata to your UI components (APY, supported assets, min/max).
5. Execute Flows
Our focus is on providing the best UX possible for our users. The Unified Deposit API simplifies this with automatic authorization detection.Unified Deposit API (Recommended)
The unified API automatically determines the optimal authorization method:Flow Comparison
Notes
- Each helper returns deterministic calldata and throws
APIErrorwith actionable metadata. - Execute transactions with
viem,wagmi, or Privy helpers—never with rawethers.jsstrings. - Record failed transactions alongside the
endpointvalue to accelerate debugging. - Default slippage is 50 basis points (0.5%). Increase for volatile conditions.
6. Error Handling
All SDK functions throwAPIError with actionable information:
You now have the skeleton needed to build durable Earn experiences. Dive into the Concepts section for protocol context or jump back to the Quickstart when onboarding new teammates.