# GIP-0043: Activate indexing rewards in The Graph Network on Arbitrum One

**URL:** <https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999>\
**Category:** Graph Improvement Proposals (GIP)\
**Created:** [February 5, 2023, 11:35pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999 "2023-02-05T23:35:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ari](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/ari/32/2747_2.png) [@ari](https://forum.thegraph.com/u/ari)\
**Post date:** [February 5, 2023, 11:35pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/1 "2023-02-05T23:35:44Z")

</div>

```auto
GIP: 0043
Title: Activate indexing rewards in The Graph Network on Arbitrum One
Authors: Pablo Carranza Vélez <pablo@edgeandnode.com>, Ariel Barmat <ariel@edgeandnode.com>, Tomás Migone <tomas@edgeandnode.com>
Created: 2023-02-01
Updated: 2023-02-01
Stage: Candidate
Category: "Protocol Logic", "Protocol Interfaces", "Economic Parameters"
Depends-On: GIP-0037

```

# Abstract

In this GIP we propose to upgrade the protocol contracts to support indexing rewards on the L2 as described in GIP-0037. That GIP proposed changing indexer rewards issuance to follow a linear function instead of the current exponential / compound interest formula, with the GRT for rewards minted natively in L1 and L2. In addition, we propose activating indexing rewards in Arbitrum One using a small initial step of 5% to 10% of the total issuance rate.

# Motivation

The Graph Protocol contracts have been deployed to Arbitrum One in block **42,449,166** as proposed in [GIP-0040](https://forum.thegraph.com/t/gip-0040-l2-bridge-and-protocol-deployment/3695) and approved by the Council in [GGP-0017](https://snapshot.org/#/council.graphprotocol.eth/proposal/0x8c3c94e6a3064023eac582d609041524c1f41b70bece62f6c58d303faa42b7e8). Since then, all the participants can run indexers and subgraphs on Arbitrum One. However, indexers don’t have any additional incentive to query fees collected from consumers. This GIP proposes to activate indexing rewards on Arbitrum One using a small initial step of 5% to 10% of issuance to increase the supply of indexers on the L2 deployment of The Graph Network.

# High-Level Description

Enabling indexing rewards in Arbitrum One involves several steps that we can divide into three parts:

### Part One: Upgrade

- Upgrade the Rewards Manager in Ethereum Mainnet (L1) to use the new linear issuance mechanism.

- Upgrade the L1GraphTokenGateway in Ethereum Mainnet (L1) to add extra protections for minted tokens coming from L2.

- Upgrade the Rewards Manager in Arbitrum One (L2) to use the new linear issuance mechanism.

- Council calls `RewardsManager.updateAccRewardsPerSignal()` in L1 to storage all pending accrual.

- Set indexing rewards configuration in terms of issuance speed instead of a percentage of the total token supply on Ethereum Mainnet (L1). We can calculate the current total issuance rate as speed in GRT per block:

totalIssuancePerBlock = totalSupply \times issuanceRatePerYear \div blocksPerYear

totalSupply = 10,576,000,000

issuanceRatePerYear = 0.03 

ethBlockTime = 12 \text{sec}\ 

blocksPerYear = secondsPerYear / ethBlockTime

10,576,000,000 \times 0.03 / (60 \times 60 \times 24 \times 365 \div 12) = 120.73 \text{GRT/block}\ 

- Finally, check that everything is properly configured and update relevant monitoring that tracks indexing rewards issuance.

### Part Two: Activate indexing rewards in Arbitrum One

- After reviewing that the upgrade is working correctly, the Graph Council will send one transaction to reduce the per-block issuance speed on Ethereum Mainnet (L1) and another one to increase it on Arbitrum One (L2).

- The Council must ensure that the transactions to L1 and L2 get mined as close as possible to avoid a gap in the issuance rate.

- Considering that total issuance speed is now the combined speed of L1 and L2:

totalIssuancePerBlock = issuancePerBlockL\_1 + issuancePerBlockL\_2

To set the rewards distribution in Arbitrum One to be 10% of the global issuance, the Council should set the issuance speed this way to keep the global issuance at the same rate:

issuancePerBlockL\_1 = 0.9 \times totalIssuancePerBlock

issuancePerBlockL\_2 = 0.1 \times totalIssuancePerBlock

### Part Three: Set L2 Bridge enhanced protections

One of the features introduced by GIP-0037 implementation is a “Mint Allowance Protection” as an extra line of defense against uncontrolled minting of L1 GRT after a large withdrawal from the L2.

- The Council must set this value to follow the issuance speed on L2 using `RewardsManager.updateL2MintAllowance()` to match the configuration used in Part Two.

# Additional Considerations

- After the Council upgrades the contracts to use a linear reward distribution, it will lead to less issuance over a very long period. The Council might consider reviewing the issuance per block parameter to match a desired target inflation to total supply.

- This GIP kickstarts the activation of indexing rewards in Arbitrum One. However, the Graph Council will need to decide on future updates in the distribution parameters to migrate most and eventually all of the reward issuance to L2.

# Related Work

For additional details, please read the related work in the following GIPs:

- **GIP-0037: The Graph Arbitrum deployment with linear rewards minted in L2**

> [@GIP-0037: The Graph Arbitrum deployment with linear rewards minted in L2](https://forum.thegraph.com/t/gip-0037-the-graph-arbitrum-deployment-with-linear-rewards-minted-in-l2/3551):
>
> GIP: 0037 Title: The Graph Arbitrum deployment with linear rewards minted in L2 Authors: Pablo Carranza Vélez \<pablo@edgeandnode.com\>, Ariel Barmat \<ariel@edgeandnode.com\>, Tomás Migone \<tomas@edgeandnode.com\> Created: 2022-09-02 Updated: 2022-09-06 Stage: Drafts Discussions-To: https://forum.thegraph.com/t/gip-0037-the-graph-arbitrum-deployment-with-linear-rewards-minted-in-l2/3551 Category: "Protocol Logic", "Protocol Interfaces", "Economic Parameters" Depends-On: GIP-0031 Implementations: htt…

- **GIP-0040: L2 Bridge and Protocol Deployment**

> [@GIP-0040: L2 Bridge and Protocol Deployment](https://forum.thegraph.com/t/gip-0040-l2-bridge-and-protocol-deployment/3695):
>
> GIP: 0040 Title: L2 Bridge and Protocol Deployment Authors: Pablo Carranza Vélez [pablo@edgeandnode.com](mailto:pablo@edgeandnode.com), Ariel Barmat [ariel@edgeandnode.com](mailto:ariel@edgeandnode.com), Tomás Migone [tomas@edgeandnode.com](mailto:tomas@edgeandnode.com) Created: 2022-11-03 Updated: 2022-11-03 Stage: Draft Category: Protocol Operations Abstract This GIP proposes the deployment of The Graph contracts on Arbitrum from the latest [published version](https://github.com/graphprotocol/contracts/tree/pcv/l2-bridge). Motivation As mentioned in GIP-0031, there is an interest in the community to move to an L2 to benefit from gas saving…

The feature is implemented in [PR-700](https://github.com/graphprotocol/contracts/pull/700)

# Risks and Security Considerations

Please read [GIP-0037](https://forum.thegraph.com/t/gip-0037-the-graph-arbitrum-deployment-with-linear-rewards-minted-in-l2/3551#risks-and-security-considerations-20) for a detailed description.

# Validation

- The code was audited by OpenZeppelin and the audit report can be found here: [OpenZeppelin Audit](https://github.com/graphprotocol/contracts/blob/12f17994f73603ff683abaaf53d19b8a588dbf8b/audits/OpenZeppelin/2022-11-graph-linear-rewards.pdf)

- Edge & Node team is running the test and deployment plan that involves simulating the upgrade, activating the rewards and checking that the issuance is correct.

# Copyright Waiver

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

---

<div class="post-metadata">

**Author:** ![Brandon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/brandon/32/1265_2.png) [@Brandon](https://forum.thegraph.com/u/Brandon)\
**Post date:** [February 10, 2023, 6:58pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/2 "2023-02-10T18:58:19Z")

</div>

I am strongly in favor of diverting some portion (5%) of indexing rewards to L2, even before it is considered production ready, as having some real incentives enabled is crucial to the testing process.

---

<div class="post-metadata">

**Author:** ![Fattox](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/fattox/32/34_2.png) [@Fattox](https://forum.thegraph.com/u/Fattox)\
**Post date:** [February 10, 2023, 11:51pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/3 "2023-02-10T23:51:05Z")

</div>

Agreed, and would add a nod towards 5% (or up to 10%) to draw in early interest.

---

<div class="post-metadata">

**Author:** ![chris](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/chris/32/657_2.png) [@chris](https://forum.thegraph.com/u/chris)\
**Post date:** [February 13, 2023, 1:45pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/4 "2023-02-13T13:45:50Z")

</div>

I think this is an important step in the journey to L2. I think we should err on the side of caution with respect to the proportion distributed on L2 to begin with, so I would be in favour of 5% or less, and ramp that up as key milestones are met.

---

<div class="post-metadata">

**Author:** ![howard](https://avatars.discourse-cdn.com/v4/letter/h/90ced4/32.png) [@howard](https://forum.thegraph.com/u/howard)\
**Post date:** [February 16, 2023, 10:48pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/5 "2023-02-16T22:48:23Z")

</div>

Thanks for sharing this GIP, Ariel. There may be benefits to waiting on activating L2 indexing rewards (or at least keeping them as low as possible).

1. Indexing rewards may be unnecessary. As indexers can be more efficient on Arbitrum (_e.g._ due to greatly reduced gas costs) and developers are expected to migrate there (again due to reduced costs), indexers may migrate without any indexing rewards. This is because reduced costs can increase indexer profitability from query fees.
2. We may see lower and more stable query prices _without_ indexing rewards. Without a subsidy, indexers that migrate are more inclined to streamline/optimize their operations and discover costs for serving queries than if they are insensitive to such matters (_e.g._ today many indexers on L1 use _default_ query cost models).
3. Activating indexing rewards on L2 now may complicate (if not block) a transition to curation v2. As the mechanisms for curation v1.x and indexing rewards are tied together, it may be least disruptive to users’ experiences if we first update curation and then turn on indexing rewards.

Lastly, if we are ultimately interested in helping developers get their queries served, I find it worth noting that I am not aware of any incentive provided by indexing rewards to motivate indexers _to serve queries_.

---

<div class="post-metadata">

**Author:** ![indexer\_payne](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/indexer_payne/32/44_2.png) [@indexer\_payne](https://forum.thegraph.com/u/indexer_payne)\
**Post date:** [February 16, 2023, 11:13pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/6 "2023-02-16T23:13:30Z")

</div>

> 1. indexers may migrate without any indexing rewards. This is because reduced costs can increase indexer profitability from query fees.

This is an idealistic scenario that will never happen imo. The query fees of the last 3 months are ~900k GRT which translates to less than $50k for the entire network at the current market price. Whereas the indexing rewards are ~800k GRT per day.

> 1. We may see lower and more stable query prices _without_ indexing rewards.

This means even lower revenue for indexers, reading the above stats. Lower query prices doesn’t translate to more queries. You need projects to migrate, to generate the queries, first and foremost, and only then, figure out ways to reduce the query prices.

> 1. I am not aware of any incentive provided by indexing rewards to motivate indexers _to serve queries_.

While there are no incentives to _serve queries_ there are incentives to keep running your infrastructure. There are 431 indexers on the network today (data coming from the explorer). Imagine if all those 431 indexers would be paid equally - that’s $116 per indexer at the current GRT price. If you can host your graph infrastructure and archive nodes within that budget, let me know, cus I’m looking to find a better provider than Hetzner (that already has a concentration of 60-80% of the indexers today).

---

<div class="post-metadata">

**Author:** ![cryptovestor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/cryptovestor/32/29_2.png) [@cryptovestor](https://forum.thegraph.com/u/cryptovestor)\
**Post date:** [February 16, 2023, 11:31pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/7 "2023-02-16T23:31:22Z")

</div>

Agree here, but I think @howard is onto something on expanding our thinking on how serving queries themselves might be incentivised. Maybe a topic for a different thread though.

---

<div class="post-metadata">

**Author:** ![justin](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@justin](https://forum.thegraph.com/u/justin)\
**Post date:** [February 17, 2023, 12:32am UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/8 "2023-02-17T00:32:39Z")

</div>

Howard makes some good points. I also understand the reasoning by indexer\_payne. While it is idealistic, delaying indexing rewards can at least test Howard’s hypothesis at relatively little cost (as long as the delay is sufficiently short). Furthermore, even if one indexer migrates (and thus some customers follow), we might gather some insight as to how indexers can optimize their behavior in absence of indexing rewards and provide better guidance to indexers in the future when query fees dwarf indexing rewards.

In short, it is unlikely all indexers will migrate without indexing rewards, but running an experiment to see even if one indexer migrates does have its benefits. Of course, this has to be weighed against the benefit of a timely migration to L2.

---

<div class="post-metadata">

**Author:** ![Pablo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/pablo/32/1623_2.png) [@Pablo](https://forum.thegraph.com/u/Pablo)\
**Post date:** [February 17, 2023, 3:43pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/9 "2023-02-17T15:43:49Z")

</div>

We already have a couple indexers migrating, but I would argue their behavior at this time will tell us little about the future when query fees dwarf rewards. I imagine they’re testing the waters and setting up their operations in anticipation of rewards starting to flow in, so I doubt they’ll be optimizing for queries at this time (we can ask them I guess? but Payne’s comment is probably a good indicator).

Slowing down the rewards rollout means slowing down a larger number of indexers going to L2, which in turn makes L2 less attractive to subgraph developers (as there’s less capacity to handle larger projects), which in turn means less query fees, which makes the whole idea of slowing down the rewards rollout even less effective imho…

As far as I know, one of the initial purposes of having indexing rewards was “bootstrapping the network”, and they seem to have worked for that in mainnet. Now that we have a new network in L2 I think bootstrapping it is just as important. Especially if curation v2 is at least a few months away (considering implementation, audit and testing times), keeping L2 without rewards throughout this time would surely slow down the migration significantly.

As to incentivizing serving queries, I think the current setup is kinda like paying an incentive for running the first 20 miles in a marathon; if you _also_ get a medal if you finish the full thing (query fees), I think most people would try to finish to get both. So it’s an indirect incentive, but I think mainnet proves it’s at least somewhat effective.

(Edit: Just to clarify, I would still support ideas for incentivizing serving queries more directly, e.g. finding ways to slash indexers that collect rewards but don’t respond to queries, or providing rewards for verifiably serving queries somehow)

---

<div class="post-metadata">

**Author:** ![Pablo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/pablo/32/1623_2.png) [@Pablo](https://forum.thegraph.com/u/Pablo)\
**Post date:** [March 27, 2023, 1:07pm UTC](https://forum.thegraph.com/t/gip-0043-activate-indexing-rewards-in-the-graph-network-on-arbitrum-one/3999/10 "2023-03-27T13:07:14Z")

</div>

Hi all, the Council has voted for deploying this GIP with a 5% initial rewards value for L2: [Snapshot](https://snapshot.org/#/council.graphprotocol.eth/proposal/0x1545e69c8205928eb13fd3a801f3c19402b806e8fc60db7dad274b8f9747c182)

We’re getting ready to deploy the updates and enable L2 rewards this week, will post back here when it’s done.

* * *

Update (April 10th): The upgrade has now been deployed and signed by the Council, so 5% of indexing rewards (6.0365 GRT per block) are now issued on L2 (with mainnet having 95% i.e. 114.6935 GRT per block).
