Skip to content

Commit

Permalink
Bugfix: Fix gauge (#280)
Browse files Browse the repository at this point in the history
* Separate CL pool Gauges.

* Add transaction hash to all event entities.

* Removing old Gauge contracts.
  • Loading branch information
jfarid27 authored Feb 6, 2025
1 parent f2cd73b commit 8af9a29
Show file tree
Hide file tree
Showing 20 changed files with 191 additions and 5 deletions.
7 changes: 7 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ contracts:
- event: Deposit(address indexed from, uint256 indexed tokenId, uint256 amount)
- event: NotifyReward(address indexed from, address indexed reward, uint256 indexed epoch, uint256 amount)
- event: Withdraw(address indexed from, uint256 indexed tokenId, uint256 amount)
- name: CLGauge
abi_file_path: abis/CLGauge.json
handler: src/EventHandlers/CLGauge.ts
events:
- event: NotifyReward
- event: Deposit
- event: Withdraw
- name: Gauge
abi_file_path: abis/Gauge.json
handler: src/EventHandlers/Gauge.ts
Expand Down
82 changes: 79 additions & 3 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,46 @@ type CLFactory_PoolCreated {
pool: String! @index
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}

# Event for when a gauge is notified of a reward
type CLGauge_NotifyReward {
id: ID!
from: String!
amount: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}

type CLGauge_Deposit {
id: ID!
tokenId: BigInt! @config(precision: 76)
user: String!
liquidityToStake: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}

type CLGauge_Withdraw {
id: ID!
tokenId: BigInt! @config(precision: 76)
user: String!
liquidityToStake: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}
Expand All @@ -128,6 +168,7 @@ type Gauge_NotifyReward {
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}
Expand All @@ -141,6 +182,7 @@ type Gauge_Deposit {
blockNumber: Int!
logIndex: Int!
chainId: Int!
transactionHash: String!
}

type Gauge_Withdraw {
Expand All @@ -150,6 +192,7 @@ type Gauge_Withdraw {
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}
Expand All @@ -165,6 +208,7 @@ type VotingReward_NotifyReward {
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}
Expand All @@ -181,6 +225,7 @@ type Pool_Swap {
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}
Expand All @@ -195,6 +240,7 @@ type Pool_Burn {
amount1: BigInt! @config(precision: 76)
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}
Expand All @@ -219,43 +265,44 @@ type Pool_Sync {
sourceAddress: String!
timestamp: Timestamp!
blockNumber: Int!
transactionHash: String!
logIndex: Int!
chainId: Int!
}

type NFPM_Transfer {
id: ID!
transactionHash: String!
from: String!
to: String!
tokenId: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}

type NFPM_IncreaseLiquidity {
id: ID!
transactionHash: String!
tokenId: BigInt! @config(precision: 76)
liquidity: BigInt! @config(precision: 76)
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
}

type NFPM_DecreaseLiquidity {
id: ID!
transactionHash: String!
tokenId: BigInt! @config(precision: 76)
liquidity: BigInt! @config(precision: 76)
amount0: BigInt! @config(precision: 76)
amount1: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -272,6 +319,7 @@ type VotingReward_Deposit {
amount: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -284,6 +332,7 @@ type VotingReward_Withdraw {
amount: BigInt! @config(precision: 76)
sourceAddress: String!
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -297,6 +346,7 @@ type Voter_Voted {
weight: BigInt! @config(precision: 76)
totalWeight: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -310,6 +360,7 @@ type Voter_DistributeReward {
amount: BigInt! @config(precision: 76)
tokensDeposited: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -326,6 +377,7 @@ type Voter_GaugeCreated {
gauge: String!
creator: String!
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -336,6 +388,7 @@ type Voter_GaugeKilled {
sender: String!
gauge: String!
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -346,6 +399,7 @@ type PoolFactory_SetCustomFee {
pool: String!
fee: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -361,6 +415,7 @@ type CLPool_Burn {
amount1: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -376,6 +431,7 @@ type CLPool_Collect {
amount1: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -388,6 +444,7 @@ type CLPool_CollectFees {
amount1: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -403,6 +460,7 @@ type CLPool_Flash {
paid1: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -414,6 +472,7 @@ type CLPool_IncreaseObservationCardinalityNext {
observationCardinalityNextNew: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -425,6 +484,7 @@ type CLPool_Initialize {
tick: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand Down Expand Up @@ -455,6 +515,7 @@ type CLPool_SetFeeProtocol {
feeProtocol1New: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -471,6 +532,7 @@ type CLPool_Swap {
tick: BigInt! @config(precision: 76)
sourceAddress: String! @index
timestamp: Timestamp! @index
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -483,6 +545,7 @@ type Voter_WhitelistToken {
token: String!
isWhitelisted: Boolean!
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -495,6 +558,7 @@ type SuperchainCLFactory_RootPoolCreated {
tickSpacing: BigInt! @config(precision: 76)
pool: String! @index
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
poolChainId: Int!
Expand All @@ -508,6 +572,7 @@ type SuperchainPoolFactory_RootPoolCreated {
stable: Boolean!
pool: String! @index
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
poolChainId: Int!
Expand Down Expand Up @@ -535,6 +600,7 @@ type VeNFT_Deposit {
locktime: BigInt! @config(precision: 76)
ts: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -547,6 +613,7 @@ type VeNFT_Withdraw {
value: BigInt! @config(precision: 76)
ts: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -558,6 +625,7 @@ type VeNFT_Transfer {
to: String!
tokenId: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
blockNumber: Int!
logIndex: Int!
chainId: Int!
Expand All @@ -574,6 +642,7 @@ type ALMCore_Rebalance {
ammPositionIdBefore: BigInt! @config(precision: 76)
ammPositionIdAfter: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
chainId: Int!
blockNumber: Int!
logIndex: Int!
Expand All @@ -589,6 +658,7 @@ type ALMCore_Rebalance_AmmPosition {
tickUpper: BigInt! @config(precision: 24)
liquidity: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
chainId: Int!
blockNumber: Int!
logIndex: Int!
Expand All @@ -604,6 +674,7 @@ type ALMDeployFactory_StrategyCreated {
width: BigInt! @config(precision: 24)
maxLiquidityRatioDeviationX96: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
chainId: Int!
blockNumber: Int!
logIndex: Int!
Expand All @@ -620,6 +691,7 @@ type ALMDeployFactory_StrategyCreated_AmmPosition {
tickUpper: BigInt! @config(precision: 24)
liquidity: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
chainId: Int!
blockNumber: Int!
logIndex: Int!
Expand All @@ -635,6 +707,7 @@ type ALMLPWrapper_Deposit {
lpAmount: BigInt! @config(precision: 76)
totalSupply: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
chainId: Int!
blockNumber: Int!
logIndex: Int!
Expand All @@ -650,6 +723,7 @@ type ALMLPWrapper_Withdraw {
lpAmount: BigInt! @config(precision: 76)
totalSupply: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
chainId: Int!
blockNumber: Int!
logIndex: Int!
Expand All @@ -661,6 +735,7 @@ type ALMLPWrapper_Transfer {
to: String!
value: BigInt! @config(precision: 76)
timestamp: Timestamp!
transactionHash: String!
chainId: Int!
blockNumber: Int!
logIndex: Int!
Expand All @@ -675,6 +750,7 @@ type ERC20_Transfer {
chainId: Int!
blockNumber: Int!
logIndex: Int!
transactionHash: String!
}

type Dynamic_Fee_Swap_Module {
Expand Down
Loading

0 comments on commit 8af9a29

Please sign in to comment.