What We’re Building
A React (Next.js) app that connects Dynamic’s embedded wallets to Deframe Pods yield strategies, allowing users to:- Deposit stablecoins into yield strategies
- Withdraw from positions
- Track yields and positions across multiple protocols
Building the Application
Project setup
Follow the JS SDK Quickstart to initialize a Next.js app with Dynamic. Scaffold withcreate-next-app, then continue with the dependencies below.
Dashboard: Under Chains & Networks, enable Ethereum and any other EVM networks you use. Under Sign-in Methods and Wallets, enable what your flow needs (including Embedded wallets). Under Security → Allowed Origins, add the origin where the app runs (for example
http://localhost:3000).Install Dependencies
Configure Dynamic Environment
Create a.env.local file with your Dynamic environment ID and Deframe Pods API key:
.env.local
Initialize Dynamic
Createsrc/lib/dynamic.ts:
src/lib/dynamic.ts
Configure Providers
Createsrc/lib/providers.tsx. DynamicProvider owns reactive auth state; InnerProviders reads it via useUser() and useGetWalletAccounts() from @dynamic-labs-sdk/react-hooks:
src/lib/providers.tsx
Create Pods Client
Createsrc/lib/pods.ts for the Deframe Pods API client. This file contains all the API communication logic for interacting with the Deframe Pods service.
All type definitions are available in src/lib/pods-types.ts in the GitHub repository.
src/lib/pods.ts
Create Transaction Operations Hook
Createsrc/lib/useTransactionOperations.ts for handling deposits and withdrawals using createWalletClientForWalletAccount from the JS SDK:
src/lib/useTransactionOperations.ts
Build Yield Interface Component
Createsrc/components/YieldInterface.tsx for the main UI. It reads evmAccount from useWallet() instead of useDynamicContext():
src/components/YieldInterface.tsx
Run the Application
Start the development server:http://localhost:3000.