Close and Allocate in one transaction

Problem statement
Currently, 2 x eth transactions required to “renew” existing allocation.
Indexer has to close existing allocation and open new allocation (potentially with new parameters, e.g. allocationAmount) then. Having high gas cost, such 2 x operations could financialy impact indexer.

Proposed solution
Consider to update Indexer-Agent with new operation closeAndAllocate(), wich would allow to close and open allocation in one transaction, which could potentially reduce Indexer’s operational costs.

Operation closeAndAllocate() would intake optional argument:

  • newAllocationAmount

graph indexer rules set “deployments” newAllocationAmount 1000
It would close existing allocation and reopen with new amount 1000


Too be optimally relevant, all parameters possible with rules set should be an option for such new command. (Even if allocation amount seems currently the most important one.)

1 Like

I support this proposal!

When just reallocating to an existing subgraph, this proposal definitely lowers the operational burden, especially when trying to manage gas costs. Currently, if targeting minimal gas cost, it can take some time for the close to get mined, then then an open needs to be timed properly.

I absolutely support the proposal. Nowadays gas fees are very high and with a small capital is hard to surpass the price of the gas to delegate and undelegate with the reward that you make by delegating. This could lead to a decrease of small delegators less liquidity for the indexers to work with.

I fully support that. With a large number of subgraphs and a high gas cost, reallocations can potentially cause a huge economic burden on indexers, which can become unbearable for small indexers.

My understanding is, such function is actually present in the smart contract, though currently not used by the agent.

Yes indeed! contracts/Staking.sol at 4209da8ad4dfe044ed5d6e2b985e3e383ca0c7a3 · graphprotocol/contracts · GitHub