Skip to main content
Pods allows apps to access diversified DeFi yield strategies across multiple protocols through a single API. Apps fetch strategies from Pods and execute the returned transaction bytecodes using Privy wallets. This enables deposits into lending, staking, and protocol-native yield strategies without managing complex transaction flows.

Resources

Pods Docs

Official documentation for Pods strategies and API.

Starter repo

Full working example of Pods + Privy integration.

Using Pods with Privy

For this walkthrough, the examples use the Aave USDT strategy on Polygon. The same patterns work across all Pods-supported strategies and networks—explore the complete list via the Pods API.

Setup

Below is a minimal setup for the Privy provider. To customize the provider, follow the Privy Quickstart.

Configure Pods API access

Obtain your API credentials from the Pods Dashboard:

List available strategies

Fetch the yield strategies available for users:
Each strategy includes fields like id, protocol, assetName, network, and availableActions.

Deposit into a yield strategy

1

1. Get the user's wallet address

2

2. Generate transaction bytecodes from Pods

Request the bytecodes needed to execute a deposit action:
The response contains an array of transactions to execute:
3

3. Execute the transactions with Privy

Use Privy’s useSendTransaction to execute each bytecode:

Check strategy position

Fetch the user’s current position and APY for a strategy:

Withdraw from a strategy

To withdraw, use the withdraw action and execute the returned bytecodes:

Pods EarnWidget

For a faster integration, Pods provides a pre-built EarnWidget component that handles strategy selection, deposits, and withdrawals with a built-in UI.

Install the Pods SDK

If your app uses Vite, install the Node polyfills plugin and add it to vite.config.ts:

Configure the widget

Implement the bytecode processor

The widget returns bytecode for the app to execute using Privy smart wallets:

Render the widget

The EarnWidget requires Smart Wallets for transaction execution. Enable Smart Wallets in the Privy Dashboard under Wallet infrastructure.

Key integration tips

  1. Handle token decimals: The amount parameter must respect the token’s decimal places. USDT and USDC use 6 decimals; most other tokens use 18.
  2. Execute transactions in order: Pods may return multiple bytecodes for a single action. Execute them sequentially.
  3. Verify available actions: Each strategy has an availableActions array. Check that the action exists before requesting bytecodes.
  4. Handle errors gracefully: Wrap transaction execution in try/catch blocks to handle user rejection, insufficient funds, and network issues.
For advanced use cases, refer to the Pods Docs, or reach out in Slack.