diff --git a/src/entities/Pool.ts b/src/entities/Pool.ts index 43fd251..604b2f4 100644 --- a/src/entities/Pool.ts +++ b/src/entities/Pool.ts @@ -21,6 +21,7 @@ class PoolDetails { ibtAddress: Address ptAddress: Address factoryAddress: Address + lpAddress: Address timestamp: BigInt blockNumber: BigInt logIndex: BigInt @@ -69,7 +70,7 @@ export function createPool(params: PoolDetails): Pool { // Asset - Future relation let lpToken = getAsset( - getPoolLPToken(params.poolAddress).toHex(), + params.lpAddress.toHex(), params.timestamp, AssetType.LP ) diff --git a/src/mappings/futures.ts b/src/mappings/futures.ts index bebfd47..8df1ec9 100644 --- a/src/mappings/futures.ts +++ b/src/mappings/futures.ts @@ -35,6 +35,7 @@ import { } from "../entities/AccountAsset" import { getAsset } from "../entities/Asset" import { getAssetAmount } from "../entities/AssetAmount" +import { getPoolLPToken } from "../entities/CurvePool" import { createFactory, getCurveFactory } from "../entities/Factory" import { updateFutureDailyStats } from "../entities/FutureDailyStats" import { @@ -401,16 +402,22 @@ export function handleCurveFactoryChange(event: CurveFactoryChange): void { } export function handleCurvePoolDeployed(event: CurvePoolDeployed): void { + const lpAddress = getPoolLPToken(event.params.poolAddress) + createPool({ poolAddress: event.params.poolAddress, ibtAddress: event.params.ibt, factoryAddress: event.address, ptAddress: event.params.pt, + lpAddress: lpAddress, timestamp: event.block.timestamp, logIndex: event.logIndex, transactionHash: event.transaction.hash, blockNumber: event.block.number, }) + + // Create dynamic data source for LP token events + ERC20.create(lpAddress) } export function handleYieldUpdated(event: YieldUpdated): void {