Skip to content

Commit 733596b

Browse files
committed
Referencing transaction from Snapshot
1 parent 530f2bf commit 733596b

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

schema.graphql

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ 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!
126+
transaction: Transaction!
129127
}
130128

131129
type Transaction @entity {

src/mappings/helpers.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,7 @@ 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
193+
snapshot.transaction = event.transaction.hash.toHexString()
196194
snapshot.save()
197195
position.save()
198196
}

0 commit comments

Comments
 (0)