// Get addresses for the current network
const chainId = 84532; // Base Sepolia (change to 8453 for Base Mainnet, 130 for Unichain Mainnet, etc.)
const addresses = DOPPLER_V3_ADDRESSES[chainId];
const airlockAddress = addresses.airlock;
// Create a read factory instance
const factory = new ReadFactory(
airlockAddress,
drift,
);
// Get information about a deployed asset
const assetData = await factory.getAssetData(tokenAddress);
console.log('Asset details:', {
numeraire: assetData.numeraire,
governance: assetData.governance,
pool: assetData.pool,
totalSupply: assetData.totalSupply.toString()
});
// Check module state
const moduleState = await factory.getModuleState(moduleAddress);
console.log('Module state:', moduleState);
// Get the asset data to find the price discovery pool address
const assetData = await factory.getAssetData(deployedTokenAddress);
const poolAddress = assetData.pool;
// Create a pool instance for the price discovery pool
const pool = new ReadUniswapV3Pool(poolAddress, drift);
// Get pool information
const slot0 = await pool.getSlot0();
const token0 = await pool.getToken0();
const token1 = await pool.getToken1();
const fee = await pool.getFee();
console.log('Price discovery pool info:', {
sqrtPriceX96: slot0.sqrtPriceX96.toString(),
tick: slot0.tick,
token0,
token1,
fee
});
// Get pool events (will show the initial mint from token creation)
const mintEvents = await pool.getMintEvents();
const swapEvents = await pool.getSwapEvents();
console.log(`Found ${mintEvents.length} mint events and ${swapEvents.length} swap events`);
// Note: After migration, liquidity moves to a V2 pool (or V4 if using fee streaming)
// The migrationPool address can be found at assetData.migrationPool
try {
const assetData = await factory.getAssetData(tokenAddress);
} catch (error) {
if (error.message.includes('Asset not found')) {
console.log('Token not deployed on Doppler');
} else {
console.error('Unexpected error:', error);
}
}