Resources
Deframe Docs
Official documentation for Deframe strategies and API.
Starter repo
Full working example of Deframe + Privy integration.
Using Deframe with Privy
For this walkthrough, the examples use the Aave USDT strategy on Polygon. The same patterns work across all Deframe-supported strategies and networks—explore the complete list via the Deframe API.Setup
Below is a minimal setup for the Privy provider. To customize the provider, follow the Privy Quickstart.Configure Deframe API access
Obtain your API credentials from the Deframe Dashboard:List available strategies
Fetch the yield strategies available for users:id, protocol, assetName, network, and availableActions.
Deposit into a yield strategy
2. Generate transaction bytecodes from Deframe
Request the bytecodes needed to execute a deposit action:The response contains an array of transactions to execute:
Check strategy position
Fetch the user’s current position and APY for a strategy:Withdraw from a strategy
To withdraw, use thewithdraw action and execute the returned bytecodes:
Deframe EarnWidget
For a faster integration, Deframe provides a pre-builtEarnWidget component that handles strategy selection, deposits, and withdrawals with a built-in UI.
Install the Deframe SDK
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
- Handle token decimals: The
amountparameter must respect the token’s decimal places. USDT and USDC use 6 decimals; most other tokens use 18. - Execute transactions in order: Deframe may return multiple bytecodes for a single action. Execute them sequentially.
- Verify available actions: Each strategy has an
availableActionsarray. Check that the action exists before requesting bytecodes. - Handle errors gracefully: Wrap transaction execution in try/catch blocks to handle user rejection, insufficient funds, and network issues.

