A TypeScript SDK for interacting with Doppler V3 protocol - a Liquidity Bootstrapping Protocol built on Uniswap V3.
- 🏭 Factory interactions for doppler contract creation and management
- 💰 Token operations including DERC20 and native ETH handling
- 🔍 Historical event querying for pools and tokens
# Using npm
npm install doppler-v3-sdk
# Using bun
bun add doppler-v3-sdk
import { ReadFactory } from "doppler-v3-sdk";
const factory = new ReadFactory("0x...factoryAddress");
const assetData = await factory.getAssetData(tokenAddress);
const createEvents = await factory.getCreateEvents();
// ERC20 Token
const derc20 = new ReadDerc20(tokenAddress);
const balance = await derc20.getBalanceOf(userAddress);
// Native ETH
const eth = new ReadEth();
const ethBalance = await eth.getBalanceOf(userAddress);
const pool = new ReadUniswapV3Pool(poolAddress);
const [slot0, swapEvents] = await Promise.all([
pool.getSlot0(),
pool.getSwapEvents(),
]);
const quoter = new ReadQuoter(quoterAddress);
const quote = await quoter.quoteExactInput({
params: {
tokenIn: "0x...",
tokenOut: "0x...",
amountIn: parseUnits("1", 18),
fee: 3000,
},
options: {
tokenDecimals: 18,
formatDecimals: 4,
},
});
Component | Description |
---|---|
ReadFactory |
Interface for reading from the Doppler airlock contract |
ReadWriteFactory |
Interface for writing to the Doppler airlock contract |
ReadDerc20 |
DERC20 token operations with vesting support |
ReadEth |
Native ETH operations |
ReadUniswapV3Pool |
Interface for Uniswap V3 pool contract operations |
ReadInitializer |
Interface for the UniswapV3Initializer contract |
ReadQuoter |
Price quoting engine with fixed-point precision |
import { ReadQuoter, fixed } from "doppler-v3-sdk";
const quoter = new ReadQuoter("0x...quoterAddress");
const amountIn = fixed(1.5, 18); // 1.5 tokens with 18 decimals
const quote = await quoter.quoteExactInput(
{
tokenIn: "0x...",
tokenOut: "0x...",
amountIn: amountIn.toBigInt(),
fee: 3000,
},
{ tokenDecimals: 18, formatDecimals: 4 }
);
console.log(`Expected output: ${quote.formattedAmountOut}`);
Note: for executing swaps see doppler-router here
import { ReadUniswapV3Pool } from "doppler-v3-sdk";
const pool = new ReadUniswapV3Pool("0x...poolAddress");
const [slot0, liquidityEvents] = await Promise.all([
pool.getSlot0(),
pool.getMintEvents(),
]);
console.log(`Current price: ${slot0.sqrtPriceX96}`);
console.log(`${liquidityEvents.length} liquidity positions found`);
This project is licensed under the MIT License - see the LICENSE file for details.