[Feature] Declarative Calls Feedback

Open
#5,445 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
32/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust, typescript

Research direction

Start by reviewing the declarative calls work in pull request 5264 and the blocker in issue 5444. The requested behavior is support for using one call's result as another call's input and issuing repeated calls with different inputs; done should be demonstrated for the Compound v3 use cases described here.

Written by the indexing model from the issue text.

Description

enhancement Stale
Description

I spent some time trying to add declarative calls (https://github.com/graphprotocol/graph-node/pull/5264) to messari's compound v3 subgraph as it uses a lot of eth_calls. I wasn't able to fully test any of this yet due to this blocker (https://github.com/graphprotocol/graph-node/issues/5444), however I had some feedback or requests for use cases that showed up when I was working to cut over the subgraph to use declarative calls.

  • Using an eth_call as input for another eth_call, here is a real example:
const utilization = cometContract.getUtilization();
const borrowRate = cometContract.getBorrowRate(utilization).toBigDecimal();
const supplyRate = cometContract.getSupplyRate(utilization).toBigDecimal();
  • Multiple calls on one handler for the same function call with different input:
calls:
	Comet.totalsBasic: Comet[event.address].totalsBasic(event.params.liquidator)
	Come.totalsBasic: Comet[event.address].totalsBasic(event.params.borrower)

Note: This may be possible to do already, but I am not sure

Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

https://github.com/graphprotocol/graph-node/issues/5444

Some information to help us out
  • Tick this box if you plan on implementing this feature yourself.
  • I have searched the issue tracker to make sure this issue is not a duplicate.
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from graphprotocol/graph-node

All issues in graphprotocol/graph-node

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.