Skip to main content
This guide walks through the lifecycle of launching and maintaining a Stablecoin Earn integration—from sandbox setup to production operations. Treat it as the map that connects the Quickstart, Concepts, and Functions sections.

1. Access & Environment

  1. Request a Paxos-issued Amplify API key for your environment (sandbox, staging, production).
  2. Store the key as a secret (.env, HashiCorp Vault, CI secrets manager).
  3. Confirm network access to required RPC endpoints (Alchemy, Infura, or your in-house nodes).
  4. 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.
For advanced configuration (custom loggers, telemetry control), see SDK Initialization and Logging.

4. Discover Vaults & Assets

  • Use fetchSupportedAssets to 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. The unified API automatically determines the optimal authorization method:

Flow Comparison

Notes

  • Each helper returns deterministic calldata and throws APIError with actionable metadata.
  • Execute transactions with viem, wagmi, or Privy helpers—never with raw ethers.js strings.
  • Record failed transactions alongside the endpoint value to accelerate debugging.
  • Default slippage is 50 basis points (0.5%). Increase for volatile conditions.

6. Error Handling

All SDK functions throw APIError 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.