kava icon indicating copy to clipboard operation
kava copied to clipboard

Querier improvements for kava-4

Open denalimarsh opened this issue 4 years ago • 2 comments

Queries are organized by module and priority. I'm working on implementing these on branch dm-queries.

  • [1] First priority: there is currently no way to get this data
  • [2] Second priority: active consumers need this data (and are mitigating with hacky solutions)
  • [3] Third priority: "nice to have" for consumers

CDP

  • [x] [1] Query CDP by ID
  • [x] [1] Query total amount of savings rate distributed USDX
  • [x] [1] Query CDPs by owner address (without collateral type)
  • [x] [2] Query total amount locked for each collateral type
  • [ ] [2] Query total amount borrowed for each principal type (currently just USDX)
  • [ ] [2] Query total amount of savings rate distributed USDX by collateral type
  • [ ] [3] Query total amount of fees currently outstanding
  • [x] [3] Query total amount of fees that have been repaid (i.e. protocol profit)

Auction

  • [x] [1] Query for auctions associated with a specific address. In this case the lotReturnAddrs from StartCollateralAuction.
  • [x] [3] Use events to query closed auctions. -> develop a separate event storage/query service for our web app?

BEP3

  • [ ] [2] migrate calculate-swap-id cmd from kvtool - it requires less args
  • [ ] [2] marshal YAML gives bytes formatted swap ID
  • [ ] [2] add marshalYAML (or String?) methods to swap direction and status types so they show up as string not numbers in query output
  • [ ] [3] Consider adding ExpectedOtherChainSwapID to the augmented AtomicSwap.
  • [ ] [3] Improve "atomic swap ID not found error" for claim txs. Example: https://lcd-kava-3.cosmostation.io/txs/DEF1D9CBC7A7E9A71B09EE0BD6DAA7B5DB4C3DF6D0CA06D3758C5BCEA9E32679

Incentive

  • [x] [1] Query ongoing claims
  • [ ] [2] Get reward APY for an asset at the current period reward rate. Under the current architecture, this should be a CDP module query because we need the amount of collateral locked and the collateral’s system price, requiring the import of CDP and Pricefeed keeper.

denalimarsh avatar Aug 27 '20 12:08 denalimarsh

@karzak @rhuairahrighairidh @nddeluca

Feel free to modify the priority or add new queries to the list.

denalimarsh avatar Aug 27 '20 12:08 denalimarsh

re

Query total amount locked for each collateral type

We already have this one I released. The CDP module account has all of the coins that have been deposited into cdps, so the endpoint /cdp/accounts (https://kava3.data.kava.io/cdp/accounts) shows the total collateral locked in cdps. We could add a convenience method, /cdp/accounts/cdp, to just query the cdp module account.

karzak avatar Aug 30 '20 15:08 karzak