Skip to main content

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
If you want to take a quick look at the final code, check out the GitHub repository.

Building the Application

Project setup

Follow the JS SDK Quickstart to initialize a Next.js app with Dynamic. Scaffold with create-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 SecurityAllowed 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
You can find your Environment ID in the Dynamic dashboard under Developer Settings → SDK & API Keys. For the Deframe Pods API key, visit Deframe to get your API key.

Initialize Dynamic

Create src/lib/dynamic.ts:
src/lib/dynamic.ts

Configure Providers

Create src/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

Create src/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
You can get detailed information about the Deframe Pods API here.

Create Transaction Operations Hook

Create src/lib/useTransactionOperations.ts for handling deposits and withdrawals using createWalletClientForWalletAccount from the JS SDK:
src/lib/useTransactionOperations.ts

Build Yield Interface Component

Create src/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:
The application will be available at http://localhost:3000.

Configure CORS

Add your local development URL to the CORS origins in your Dynamic dashboard under Developer Settings > CORS Origins.

Full source code

GitHub repository →

Additional Resources

Last modified on June 24, 2026