Skip to content

Commit

Permalink
feat: fix getAllocation
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmardefago committed Nov 28, 2023
1 parent 41d49c9 commit d16cf29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type GraphNetwork @entity {
totalTaxedQueryFees: BigInt!

# It is hard to separate the unclaimed and rebates lost
"Total unclaimed rebates. Includes unclaimed rebates and rebates lost in cobbs douglas "
"Total unclaimed rebates. Includes unclaimed rebates and rebates lost in rebate mechanism "
totalUnclaimedQueryFeeRebates: BigInt!

# Indexing rewards globals
Expand Down Expand Up @@ -386,10 +386,10 @@ type SubgraphDeployment @entity {
"Total query fees earned by this Subgraph Deployment, without curator query fees"
queryFeesAmount: BigInt!

"Total query fee rebates for indexers earned from the protocol, through the cobbs douglas formula."
"Total query fee rebates for indexers earned from the protocol, through the rebate mechanism formula."
queryFeeRebates: BigInt!

"Total query fee rebates for delegators earned from the protocol, through the cobbs douglas formula."
"Total query fee rebates for delegators earned from the protocol, through the rebate mechanism formula."
delegatorQueryFees: BigInt!

"Total curator rewards from fees"
Expand Down Expand Up @@ -479,7 +479,7 @@ type Indexer @entity {
"Total query fees collected. Includes the portion given to delegators"
queryFeesCollected: BigInt!

"Query fee rebate amount claimed from the protocol through cobbs douglas. Does not include portion given to delegators"
"Query fee rebate amount claimed from the protocol through rebate mechanism. Does not include portion given to delegators"
queryFeeRebates: BigInt!

"Total indexing rewards earned by this indexer from inflation. Including delegation rewards"
Expand Down Expand Up @@ -619,12 +619,12 @@ type Allocation @entity {
"Fees this allocation collected from query fees upon closing. Excludes curator reward and protocol tax"
queryFeesCollected: BigInt!

"Query fee rebate amount claimed from the protocol through cobbs douglas. Does not include portion given to delegators"
"Query fee rebate amount claimed from the protocol through rebates mechanism. Does not include portion given to delegators"
queryFeeRebates: BigInt!

"Query fee rebates collected from the protocol. Can differ from queryFeeRebates if multiple vouchers per allocation are allowed."
distributedRebates: BigInt!

"Curator rewards deposited to the curating bonding curve"
curatorRewards: BigInt!

Expand Down Expand Up @@ -682,7 +682,7 @@ type Pool @entity {
"Total query fees collected in this epoch"
totalQueryFees: BigInt!

"Total query fees claimed in this epoch. Can be smaller than totalFees because of cobbs douglas function "
"Total query fees claimed in this epoch. Can be smaller than totalFees because of rebate mechanism function "
claimedFees: BigInt!

"Total rewards from query fees deposited to all curator bonding curves during the epoch"
Expand Down Expand Up @@ -1297,10 +1297,10 @@ type SubgraphDeploymentDailyData @entity {
"[CUMULATIVE] Total query fees earned by this Subgraph Deployment, without curator query fees"
queryFeesAmount: BigInt!

"[CUMULATIVE] Total query fee rebates for indexers earned from the protocol, through the cobbs douglas formula."
"[CUMULATIVE] Total query fee rebates for indexers earned from the protocol, through the rebate mechanism formula."
queryFeeRebates: BigInt!

"[CUMULATIVE] Total query fee rebates for delegators earned from the protocol, through the cobbs douglas formula."
"[CUMULATIVE] Total query fee rebates for delegators earned from the protocol, through the rebate mechanism formula."
delegatorQueryFees: BigInt!

"[CUMULATIVE] Total curator rewards from fees"
Expand Down Expand Up @@ -1359,7 +1359,7 @@ type GraphNetworkDailyData @entity {
totalTaxedQueryFees: BigInt!

# It is hard to separate the unclaimed and rebates lost
"[CUMULATIVE] Total unclaimed rebates. Includes unclaimed rebates and rebates lost in cobbs douglas "
"[CUMULATIVE] Total unclaimed rebates. Includes unclaimed rebates and rebates lost in rebate mechanism "
totalUnclaimedQueryFeeRebates: BigInt!

# Indexing rewards globals
Expand Down
2 changes: 1 addition & 1 deletion src/mappings/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ export function handleAllocationClosedCobbDouglas(event: AllocationClosed1): voi
// We must call the contract directly to see how many fees are getting closed in this
// allocation. The event does not emit this information
let staking = Staking.bind(event.address)
let contractAlloc = staking.getAllocation(event.params.allocationID)
let contractAlloc = staking.getAllocation1(event.params.allocationID)
pool.totalQueryFees = pool.totalQueryFees.plus(contractAlloc.collectedFees)
pool.save()

Expand Down

0 comments on commit d16cf29

Please sign in to comment.