interlay / interbtc-squid

Subquid GraphQL schema and indexer for the Interlay and Kintsugi networks
Apache License 2.0
4 stars 7 forks source link

Cumulative pool trading volumes: Separate volumes in and out. #123

Closed bvotteler closed 1 year ago

bvotteler commented 1 year ago

The current cumulative pool volumes simply adds token volumes both in & out into a cumulative volume. For some calculations, like fee estimates, we need more granular data where the volumes swapped in & out are separated.

Notes: With all swaps stored now, we may want to expose a custom resolver that runs a query over swaps instead of storing snapshots of cumulative volumes. As example, see this PR 127

See also the subsquid docs for more info on custom resolvers.