Skip to content

Commit 530f2bf

Browse files
committed
TX info in LiquidityPositionSnapshot
1 parent 6ca8e96 commit 530f2bf

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

schema.graphql

Lines changed: 3 additions & 0 deletions
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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ export function createLiquiditySnapshot(position: LiquidityPosition, event: Ethe
190190
snapshot.liquidityTokenTotalSupply = pair.totalSupply
191191
snapshot.liquidityTokenBalance = position.liquidityTokenBalance
192192
snapshot.liquidityPosition = position.id
193+
snapshot.tx = event.transaction.hash
194+
snapshot.gasUsed = event.transaction.gasUsed
195+
snapshot.gasPrice = event.transaction.gasPrice
193196
snapshot.save()
194197
position.save()
195198
}

0 commit comments

Comments
 (0)