Skip to content

Add Index Supply skill#185

Open
Sam-Scolari wants to merge 1 commit intoBankrBot:mainfrom
Sam-Scolari:index-supply
Open

Add Index Supply skill#185
Sam-Scolari wants to merge 1 commit intoBankrBot:mainfrom
Sam-Scolari:index-supply

Conversation

@Sam-Scolari
Copy link

Adds a skill for Index Supply

Index Supply is a new way to query blockchains without the need to run a custom indexer. Instead, Index Supply indexes the whole chain and lets you fetch the data you need by decoding logs against the provided ABI at query time with SQL.

This is particularly useful for agents since they don't always have an API available to query the data they need.

For example, if I asked my agent "What is Nouns proposal 936 about?" the agent might do the following

Call proposals(uint256) -> realize that the markdown was only included in the ProposalCreated event and not stored onchain -> spin up a Ponder instance -> spin up a local db to query from -> fetch the indexed proposal record -> respond

While this is feasible, it can be heavily simplified. Instead of spinning up its own indexer, all the agent has to do is fetch the proposal record directly from Index Supply using the ProposalCreated event.

curl -s -G 'https://api.indexsupply.net/v2/query' \
  --data-urlencode "api-key=$INDEX_SUPPLY_API_KEY" \
  --data-urlencode 'signatures=ProposalCreated(uint256 id, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 startBlock, uint256 endBlock, string description)' \
  --data-urlencode 'query=
    SELECT id, description
    FROM proposalcreated 
    WHERE chain = 1 
      AND address = 0x6f3E6272A167e8AcCb32072d08E0957F9c79223d
      AND id = 936
    LIMIT 1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant