rocketGet Started

Getting Started with Doppler V4 SDK

This section guides you through setting up and using the Doppler V4 SDK to interact with the latest version of the Doppler protocol.

Prerequisites

  • Node.js: Version 18.14 or higher

  • npm or yarn: Package manager for installing dependencies

  • Web3 Provider: Access to Ethereum RPC endpoints (Infura, Alchemy, etc.)

  • Wallet: MetaMask or similar wallet for transaction signing

Installation

Install the Doppler V4 SDK, Viem, and Drift packages:

npm install doppler-v4-sdk viem @delvtech/drift @delvtech/drift-viem
# or
yarn add doppler-v4-sdk viem @delvtech/drift @delvtech/drift-viem

The SDK uses Driftarrow-up-right for blockchain interactions.

Required Environment Variables

# RPC Endpoint
RPC_URL="https://sepolia.base.org"

# Wallet Private Key (for automated transactions)
PRIVATE_KEY="your-private-key"

# Network Configuration
CHAIN_ID=84532

Basic Setup

1. Import the SDK

2. Initialize Drift Client

Set up your Drift client with both read and write capabilities:

Read-only operations

Read-write operations

3. Get Protocol Addresses

Core Concepts

Factory Classes

The V4 SDK provides two main factory classes:

  • ReadFactory: For querying protocol state and reading data

  • ReadWriteFactory: For creating tokens with hooks

Key V4 Features

  • Dynamic bonding curves: Custom hooks supporting dynamic bonding curves

Asset Lifecycle

  1. Token Creation: Deploy new tokens with custom hooks

  2. Price Discovery: Initial liquidity provision and price discovery phase

  3. Trading: Enhanced trading with V4 features

Quick Start Examples

Reading Protocol Data

Creating a New Token with Hooks

Using the Doppler Lens for Advanced Queries

After creating your token, you can use the DopplerLensQuoter to get detailed information about your pool:

Network Support

The V4 SDK supports multiple networks:

  • Base Sepolia (chainId: 84532) - Testnet

  • Base Mainnet (chainId: 8453) - Production

  • Unichain Mainnet (chainId: 130) - Production

  • Unichain Sepolia (chainId: 1301) - Testnet

  • Ink (chainId: 57073) - Production

For complete network addresses and additional supported networks, see the Contract Addresses documentation.

You can get free Base Sepolia ETH from the Base Sepolia faucetarrow-up-right to test your applications.

Error Handling

The SDK provides comprehensive error handling for V4-specific scenarios:

Next Steps

Support

For additional help and examples:

  • Check the Token Launch Examples for comprehensive deployment scenarios

  • Review the Implementation Guide for protocol details

  • Join the community for discussions and support

Last updated