Skip to content

Commit bcd7ff6

Browse files
committed
TX info in LiquidityPositionSnapshot
1 parent d8f0924 commit bcd7ff6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

schema.graphql

+3
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ type LiquidityPositionSnapshot @entity {
123123
reserveUSD: BigDecimal! # snapshot of pair reserves in USD
124124
liquidityTokenTotalSupply: BigDecimal! # snapshot of pool token supply
125125
liquidityTokenBalance: BigDecimal! # snapshot of users pool token balance
126+
tx: Bytes! # txn hash
127+
gasUsed: BigInt!
128+
gasPrice: BigInt!
126129
}
127130

128131
type Transaction @entity {

src/mappings/helpers.ts

+3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ export function createLiquiditySnapshot(position: LiquidityPosition, event: Ethe
189189
snapshot.liquidityTokenTotalSupply = pair.totalSupply
190190
snapshot.liquidityTokenBalance = position.liquidityTokenBalance
191191
snapshot.liquidityPosition = position.id
192+
snapshot.tx = event.transaction.hash
193+
snapshot.gasUsed = event.transaction.gasUsed
194+
snapshot.gasPrice = event.transaction.gasPrice
192195
snapshot.save()
193196
position.save()
194197
}

0 commit comments

Comments
 (0)