Suggestion: add the ability to query/filter the results of /matches to those overlapping a slot #106
Replies: 2 comments
-
Actually, looking closer at the way pagination works, can you confirm that
would satisfy the above? |
Beta Was this translation helpful? Give feedback.
-
After some experimentation, looks like it's not quite possible to express what I need in a single query; For now I've just done it via two queries. The problem stems from the fact that So maybe a spent_slot IS NULL || spent_slot > ? for now, doing two requests:
and merging the results isn't terribly inconvenient, so this isn't a huge blocker. |
Beta Was this translation helpful? Give feedback.
-
Currently, one of our primary uses of Kupo, is to query user balances of a token at a specific point in time. For example, at the end of a Sundae Governance vote, we need to query everyone's balance to determine their voting weight.
We do this by having Kupo run without pruning spent UTXOs, querying the matches for a specific token, and then filtering to just those where Slot <= snapshot && (SpentSlot is null || SpentSlot > snapshot)
However, with larger tokens (at the moment newm, and SUNDAE is going to be even larger), this can be... very large. i.e. 2.8gb of data over the network.
Pagination will help this slightly, but it'd still save a lot of network bandwidth if we could ask Kupo to do this filtering for us.
Beta Was this translation helpful? Give feedback.
All reactions