Skip to content

Commit

Permalink
Referencing transaction from Snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Dec 6, 2020
1 parent 530f2bf commit 733596b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ type LiquidityPositionSnapshot @entity {
reserveUSD: BigDecimal! # snapshot of pair reserves in USD
liquidityTokenTotalSupply: BigDecimal! # snapshot of pool token supply
liquidityTokenBalance: BigDecimal! # snapshot of users pool token balance
tx: Bytes! # txn hash
gasUsed: BigInt!
gasPrice: BigInt!
transaction: Transaction!
}

type Transaction @entity {
Expand Down
4 changes: 1 addition & 3 deletions src/mappings/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,7 @@ export function createLiquiditySnapshot(position: LiquidityPosition, event: Ethe
snapshot.liquidityTokenTotalSupply = pair.totalSupply
snapshot.liquidityTokenBalance = position.liquidityTokenBalance
snapshot.liquidityPosition = position.id
snapshot.tx = event.transaction.hash
snapshot.gasUsed = event.transaction.gasUsed
snapshot.gasPrice = event.transaction.gasPrice
snapshot.transaction = event.transaction.hash.toHexString()
snapshot.save()
position.save()
}

0 comments on commit 733596b

Please sign in to comment.