* Use cosmossdk.io/errors for deprecated error methods
* Update error registration with cosmossdk.io/errors
* Use cosmossdk.io/math for deprecated sdk.Int alias
* Fix modified proto file
* Update sdk.Int usage in swap hooks
* Update e2e test deprecated method usage
* Add cdp/totals rest endpoint for aggregated principal and fees
* Add total collateral to aggregated cdp
* Add pagination
* Update totalPrincipal endpoint to use keeper GetTotalPrincipal
* Update documentation for queryGetTotalPrincipal
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
* Remove unused AggregatedCDP types
* Make CDP type optional, return all if not provided
* add total collateral endpoint that efficient fetches collateral
for a types, only iterating cdps for types b, etc
* correctly and efficienlty filter for a single collateral type
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
* Add 'InterestFactor' to CDP type (#734)
* update cdp type to include interest factor
* fix build
* Add cdp accumulator methods (#735)
* remame fees to interest
* add accumulate interest method
* add basic test
* add note
* address review comments
* update tests
* Add sync cdp interest method (#737)
* remame fees to interest
* add accumulate interest method
* add basic test
* add note
* address review comments
* update tests
* remove old fee functions
* add method to synchronize cdp interest
* add multi-cdp tests
* add test with many blocks
* add test for interest getter
* address review comments
* calculate time difference then convert to seconds
* fix: update collateral index when syncing interest
* fix: differentiate between case when apy is zero and all fees are being rounded to zero
* fix: round time difference properly
* update cdp genesis state and migrations (#738)
* remame fees to interest
* add accumulate interest method
* add basic test
* add note
* address review comments
* update tests
* remove old fee functions
* add method to synchronize cdp interest
* add multi-cdp tests
* add test with many blocks
* add test for interest getter
* update cdp genesis state and migrations
* address review comments
* calculate time difference then convert to seconds
* fix: update collateral index when syncing interest
* fix: differentiate between case when apy is zero and all fees are being rounded to zero
* fix: simplify add/remove/update collateral index
* update genesis state to include total principal amounts
* update migration
* Delete kava-4-cdp-state-block-500000.json
* Add cdp liquidations by external keeper (#750)
* feat: split liquidations between external keepers and automated begin blocker
* address review comments
* USDX incentive accumulators (#752)
* feat: split liquidations between external keepers and automated begin blocker
* wip: refactor usdx minting incentives to use accumulators/hooks
* wip: refactor usdx minting claim object
* feat: use accumulators/hooks for usdx minting rewards
* fix: get tests passing
* fix: don't create claim objects unless that cdp type is eligable for rewards
* add begin blocker
* update client
* cleanup comments/tests
* update querier
* address review comments
* fix: check for division by zero
* address review comments
* run hook before interest is synced
* Remove savings rate (#764)
* remove savings rate
* remove savings rate from debt param
* update migrations
* address review comments
* Add usdx incentives calculation test (#765)
* add usdx incentive calculation test
* update reward calculation
* add allowable error to test criteria
* Update x/incentive/keeper/rewards_test.go
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
* fix: remove old fields from test genesis state
Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
* add collateral type field to cdp and collateral param
* fix upstream tests
* fix simulations
* fix validation logic
* update incentive to use collateral type instead of denom
* use collateral type instead of denom in cdp
* remove unused code
* address review comments
* add module accounts command
* update get accounts query to return array of
module accounts instead of map of addresses
* update tests and add update swagger
Co-authored-by: Kevin Davis <kjydavis3@gmail.com>
* bump SDK version to v0.38.3
Co-authored-by: Denali Marsh <denali@kava.io>
Co-authored-by: Kevin Davis <kjydavis3@gmail.com>
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
Co-authored-by: denalimarsh <denalimarsh@gmail.com>
Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
* AugmentedCDP type, codec registration, querier update
* added unique error for augmented cdp loading
* added AugmentedCDPs type for cdps query res
* query results for cdps (by denom) & cdps-by-ratio (by denom & ratio)
* status: converting collateral value into debt coin denom
* collateral value denominated in debt coin
* query cdps-by-ratio now searches by collateralization ratio instead of absolute ratio
* updated alias, code comments
* updated querier tests
* support multiple principal coins and their associated fees
* collateralization ratio calculations on updated fees
* include calculated fees in total debt calculation