Agoric / dapp-inter

User application for Agoric Inter Protocol—Vaults, BLD Boost, Liquidations, etc.
2 stars 7 forks source link

Total # of active vaults not including vaults with zero IST debt #311

Closed otoole-brendan closed 3 weeks ago

otoole-brendan commented 3 weeks ago

Describe the bug

App.inter.trade shows Total # of active vaultswhich uses sum of numActiveVaults. However it does not include vaults with zero IST debt and therefore is technically incorrect and underreporting the number of active vaults.

Info.inter.trade accounts for these vaults and includes them in the count.

Update dapp-inter to use this query to return the correct value (Slack reference)

curl -s 'https://api.subquery.network/sq/agoric-labs/agoric-mainnet-v2' -H 'Content-Type: application/json' --data-binary '{ "query": "query {\tvaults(filter: {state: {equalTo: \"active\"}}) {totalCount}}" }' | jq .

To Reproduce

Steps to reproduce the behavior:

  1. Compare $ of active vaults visible on app.inter.trade with that of info.inter.trade

Expected behavior

Should in include vaults that have zero IST debt

samsiegart commented 3 weeks ago

@otoole-brendan Do we have subquery indexers for testnets as well? At the very least, we won't have it for local networks. I can make the dapp use this subquery data for mainnet, and all other networks it would still use the same old data if that works.

otoole-brendan commented 2 weeks ago

@otoole-brendan Do we have subquery indexers for testnets as well? At the very least, we won't have it for local networks. I can make the dapp use this subquery data for mainnet, and all other networks it would still use the same old data if that works.

that's fine @samsiegart ! @toliaqat can answer about indexers for testnets - I'm not sure