ape icon indicating copy to clipboard operation
ape copied to clipboard

Add support for multi-dimsensional queries [APE-1245]

Open fubuloubu opened this issue 2 years ago • 0 comments
trafficstars

Overview

Sometimes it is useful to run queries across 2 (or more) dimensions, such as with https://github.com/ApeWorX/ape-tokens/issues/33 where we want to get the top 20 accounts over a range of blocks. To unlock this, it should be possible to pass in an array argument to query functions where it makes sense. An example would be a list of addresses where a single address argument might go, or a list of indexes where we want to process the query with multiple values.

Further, we may also want a wildcard e.g. "*" that asks to iterate over all possible combinations, which may not be computationally feasible for certain query engines that do not have an index available. We can assist in making those queries easier to perform by adding support for ORDER BY and LIMIT semantics in these wildcard queries.

Specification

This may be streamlined in the default query engine using the ape_ethereum.multicall module that was added in https://github.com/ApeWorX/ape/pull/1189 (obviously only for supported chains) as we can merge these requests into one RPC request to make.

Dependencies

n/a

fubuloubu avatar Jul 29 '23 17:07 fubuloubu