Skip to content

Commit 22ff750

Browse files
committed
Referencing transaction from Snapshot
1 parent bcd7ff6 commit 22ff750

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

schema.graphql

+1-3
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

+1-3
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ 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
192+
snapshot.transaction = event.transaction.hash.toHexString()
195193
snapshot.save()
196194
position.save()
197195
}

0 commit comments

Comments
 (0)