diff --git a/schema.graphql b/schema.graphql index 6c2fd32b..837791ed 100644 --- a/schema.graphql +++ b/schema.graphql @@ -3,6 +3,7 @@ type Balancer @entity { id: ID! poolCount: Int! pools: [Pool!] @derivedFrom(field: "vaultID") + snapshots: [BalancerSnapshot!] @derivedFrom(field: "vault") totalLiquidity: BigDecimal! totalSwapCount: BigInt! @@ -22,16 +23,16 @@ type Pool @entity { oracleEnabled: Boolean! symbol: String name: String - + "Indicates if a pool can be swapped against. Combines multiple sources, including offchain curation" swapEnabled: Boolean! - + "The native swapEnabled boolean. internal to the pool. Only applies to Gyro, LBPs and InvestmentPools" swapEnabledInternal: Boolean - + "External indication from an offchain permissioned actor" swapEnabledCurationSignal: Boolean - + swapFee: BigDecimal! owner: Bytes isPaused: Boolean @@ -53,6 +54,7 @@ type Pool @entity { tokensList: [Bytes!]! tokens: [PoolToken!] @derivedFrom(field: "poolId") + joinsExits: [JoinExit!] @derivedFrom(field: "pool") swaps: [Swap!] @derivedFrom(field: "poolId") shares: [PoolShare!] @derivedFrom(field: "poolId") snapshots: [PoolSnapshot!] @derivedFrom(field: "pool") @@ -255,6 +257,7 @@ type Swap @entity(immutable: true) { poolId: Pool! userAddress: User! timestamp: Int! + block: BigInt! tx: Bytes! } @@ -273,6 +276,7 @@ type JoinExit @entity(immutable: true) { user: User! timestamp: Int! tx: Bytes! + block: BigInt! } type LatestPrice @entity { @@ -401,4 +405,4 @@ type ProtocolIdData @entity { type FXOracle @entity { id: ID! # FX oracle aggregator address tokens: [Bytes!]! # token addresses using this oracle -} \ No newline at end of file +} diff --git a/src/mappings/vault.ts b/src/mappings/vault.ts index c528d398..a0913826 100644 --- a/src/mappings/vault.ts +++ b/src/mappings/vault.ts @@ -190,6 +190,7 @@ function handlePoolJoined(event: PoolBalanceChanged): void { join.timestamp = blockTimestamp; join.tx = transactionHash; join.valueUSD = valueUSD; + join.block = event.block.number; join.save(); let protocolFeeUSD = ZERO_BD; @@ -329,6 +330,7 @@ function handlePoolExited(event: PoolBalanceChanged): void { exit.timestamp = blockTimestamp; exit.tx = transactionHash; exit.valueUSD = valueUSD; + exit.block = event.block.number; exit.save(); let protocolFeeUSD = ZERO_BD; @@ -617,6 +619,7 @@ export function handleSwapEvent(event: SwapEvent): void { swap.timestamp = blockTimestamp; swap.tx = transactionHash; + swap.block = event.block.number; swap.save(); // update pool swapsCount