0g-chain/x/cdp/alias.go
Kevin Davis c63ecf908a
Cdp accumulators (#751)
* 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>
2021-01-18 12:12:37 -07:00

191 lines
10 KiB
Go

package cdp
// DO NOT EDIT - generated by aliasgen tool (github.com/rhuairahrighairidh/aliasgen)
import (
"github.com/kava-labs/kava/x/cdp/keeper"
"github.com/kava-labs/kava/x/cdp/types"
)
const (
AttributeKeyCdpID = types.AttributeKeyCdpID
AttributeKeyDeposit = types.AttributeKeyDeposit
AttributeKeyError = types.AttributeKeyError
AttributeValueCategory = types.AttributeValueCategory
DefaultParamspace = types.DefaultParamspace
EventTypeBeginBlockerFatal = types.EventTypeBeginBlockerFatal
EventTypeCdpClose = types.EventTypeCdpClose
EventTypeCdpDeposit = types.EventTypeCdpDeposit
EventTypeCdpDraw = types.EventTypeCdpDraw
EventTypeCdpLiquidation = types.EventTypeCdpLiquidation
EventTypeCdpRepay = types.EventTypeCdpRepay
EventTypeCdpWithdrawal = types.EventTypeCdpWithdrawal
EventTypeCreateCdp = types.EventTypeCreateCdp
LiquidatorMacc = types.LiquidatorMacc
ModuleName = types.ModuleName
QuerierRoute = types.QuerierRoute
QueryGetAccounts = types.QueryGetAccounts
QueryGetCdp = types.QueryGetCdp
QueryGetCdpDeposits = types.QueryGetCdpDeposits
QueryGetCdps = types.QueryGetCdps
QueryGetCdpsByCollateralType = types.QueryGetCdpsByCollateralType
QueryGetCdpsByCollateralization = types.QueryGetCdpsByCollateralization
QueryGetParams = types.QueryGetParams
QueryGetPreviousSavingsDistributionTime = types.QueryGetPreviousSavingsDistributionTime
QueryGetSavingsRateDistributed = types.QueryGetSavingsRateDistributed
RestCollateralType = types.RestCollateralType
RestOwner = types.RestOwner
RestRatio = types.RestRatio
RouterKey = types.RouterKey
StoreKey = types.StoreKey
)
var (
// function aliases
CalculateInterestFactor = keeper.CalculateInterestFactor
FilterCDPs = keeper.FilterCDPs
FindIntersection = keeper.FindIntersection
NewKeeper = keeper.NewKeeper
NewQuerier = keeper.NewQuerier
CdpKey = types.CdpKey
CollateralRatioBytes = types.CollateralRatioBytes
CollateralRatioIterKey = types.CollateralRatioIterKey
CollateralRatioKey = types.CollateralRatioKey
DefaultGenesisState = types.DefaultGenesisState
DefaultParams = types.DefaultParams
DenomIterKey = types.DenomIterKey
DepositIterKey = types.DepositIterKey
DepositKey = types.DepositKey
GetCdpIDBytes = types.GetCdpIDBytes
GetCdpIDFromBytes = types.GetCdpIDFromBytes
NewAugmentedCDP = types.NewAugmentedCDP
NewCDP = types.NewCDP
NewCDPWithFees = types.NewCDPWithFees
NewCollateralParam = types.NewCollateralParam
NewDebtParam = types.NewDebtParam
NewDeposit = types.NewDeposit
NewGenesisAccumulationTime = types.NewGenesisAccumulationTime
NewGenesisState = types.NewGenesisState
NewGenesisTotalPrincipal = types.NewGenesisTotalPrincipal
NewMsgCreateCDP = types.NewMsgCreateCDP
NewMsgDeposit = types.NewMsgDeposit
NewMsgDrawDebt = types.NewMsgDrawDebt
NewMsgLiquidate = types.NewMsgLiquidate
NewMsgRepayDebt = types.NewMsgRepayDebt
NewMsgWithdraw = types.NewMsgWithdraw
NewMultiCDPHooks = types.NewMultiCDPHooks
NewParams = types.NewParams
NewQueryCdpDeposits = types.NewQueryCdpDeposits
NewQueryCdpParams = types.NewQueryCdpParams
NewQueryCdpsByCollateralTypeParams = types.NewQueryCdpsByCollateralTypeParams
NewQueryCdpsByRatioParams = types.NewQueryCdpsByRatioParams
NewQueryCdpsParams = types.NewQueryCdpsParams
ParamKeyTable = types.ParamKeyTable
ParseDecBytes = types.ParseDecBytes
RegisterCodec = types.RegisterCodec
RelativePow = types.RelativePow
SortableDecBytes = types.SortableDecBytes
SplitCdpKey = types.SplitCdpKey
SplitCollateralRatioIterKey = types.SplitCollateralRatioIterKey
SplitCollateralRatioKey = types.SplitCollateralRatioKey
SplitDenomIterKey = types.SplitDenomIterKey
SplitDepositIterKey = types.SplitDepositIterKey
SplitDepositKey = types.SplitDepositKey
ValidSortableDec = types.ValidSortableDec
// variable aliases
CdpIDKey = types.CdpIDKey
CdpIDKeyPrefix = types.CdpIDKeyPrefix
CdpKeyPrefix = types.CdpKeyPrefix
CollateralRatioIndexPrefix = types.CollateralRatioIndexPrefix
DebtDenomKey = types.DebtDenomKey
DefaultCdpStartingID = types.DefaultCdpStartingID
DefaultCircuitBreaker = types.DefaultCircuitBreaker
DefaultCollateralParams = types.DefaultCollateralParams
DefaultDebtDenom = types.DefaultDebtDenom
DefaultDebtLot = types.DefaultDebtLot
DefaultDebtParam = types.DefaultDebtParam
DefaultDebtThreshold = types.DefaultDebtThreshold
DefaultGlobalDebt = types.DefaultGlobalDebt
DefaultGovDenom = types.DefaultGovDenom
DefaultSavingsRateDistributed = types.DefaultSavingsRateDistributed
DefaultStableDenom = types.DefaultStableDenom
DefaultSurplusLot = types.DefaultSurplusLot
DefaultSurplusThreshold = types.DefaultSurplusThreshold
DepositKeyPrefix = types.DepositKeyPrefix
ErrAccountNotFound = types.ErrAccountNotFound
ErrBelowDebtFloor = types.ErrBelowDebtFloor
ErrCdpAlreadyExists = types.ErrCdpAlreadyExists
ErrCdpNotAvailable = types.ErrCdpNotAvailable
ErrCdpNotFound = types.ErrCdpNotFound
ErrCollateralNotSupported = types.ErrCollateralNotSupported
ErrDebtNotSupported = types.ErrDebtNotSupported
ErrDenomPrefixNotFound = types.ErrDenomPrefixNotFound
ErrDepositNotAvailable = types.ErrDepositNotAvailable
ErrDepositNotFound = types.ErrDepositNotFound
ErrExceedsDebtLimit = types.ErrExceedsDebtLimit
ErrInsufficientBalance = types.ErrInsufficientBalance
ErrInvalidCollateral = types.ErrInvalidCollateral
ErrInvalidCollateralLength = types.ErrInvalidCollateralLength
ErrInvalidCollateralRatio = types.ErrInvalidCollateralRatio
ErrInvalidDebtRequest = types.ErrInvalidDebtRequest
ErrInvalidDeposit = types.ErrInvalidDeposit
ErrInvalidPayment = types.ErrInvalidPayment
ErrInvalidWithdrawAmount = types.ErrInvalidWithdrawAmount
ErrLoadingAugmentedCDP = types.ErrLoadingAugmentedCDP
ErrNotLiquidatable = types.ErrNotLiquidatable
ErrPricefeedDown = types.ErrPricefeedDown
GovDenomKey = types.GovDenomKey
InterestFactorPrefix = types.InterestFactorPrefix
KeyCircuitBreaker = types.KeyCircuitBreaker
KeyCollateralParams = types.KeyCollateralParams
KeyDebtLot = types.KeyDebtLot
KeyDebtParam = types.KeyDebtParam
KeyDebtThreshold = types.KeyDebtThreshold
KeyGlobalDebtLimit = types.KeyGlobalDebtLimit
KeySurplusLot = types.KeySurplusLot
KeySurplusThreshold = types.KeySurplusThreshold
MaxSortableDec = types.MaxSortableDec
ModuleCdc = types.ModuleCdc
PreviousAccrualTimePrefix = types.PreviousAccrualTimePrefix
PricefeedStatusKeyPrefix = types.PricefeedStatusKeyPrefix
PrincipalKeyPrefix = types.PrincipalKeyPrefix
)
type (
Keeper = keeper.Keeper
AccountKeeper = types.AccountKeeper
AuctionKeeper = types.AuctionKeeper
AugmentedCDP = types.AugmentedCDP
AugmentedCDPs = types.AugmentedCDPs
CDP = types.CDP
CDPHooks = types.CDPHooks
CDPs = types.CDPs
CollateralParam = types.CollateralParam
CollateralParams = types.CollateralParams
DebtParam = types.DebtParam
DebtParams = types.DebtParams
Deposit = types.Deposit
Deposits = types.Deposits
GenesisAccumulationTime = types.GenesisAccumulationTime
GenesisAccumulationTimes = types.GenesisAccumulationTimes
GenesisState = types.GenesisState
GenesisTotalPrincipal = types.GenesisTotalPrincipal
GenesisTotalPrincipals = types.GenesisTotalPrincipals
MsgCreateCDP = types.MsgCreateCDP
MsgDeposit = types.MsgDeposit
MsgDrawDebt = types.MsgDrawDebt
MsgLiquidate = types.MsgLiquidate
MsgRepayDebt = types.MsgRepayDebt
MsgWithdraw = types.MsgWithdraw
MultiCDPHooks = types.MultiCDPHooks
Params = types.Params
PricefeedKeeper = types.PricefeedKeeper
QueryCdpDeposits = types.QueryCdpDeposits
QueryCdpParams = types.QueryCdpParams
QueryCdpsByCollateralTypeParams = types.QueryCdpsByCollateralTypeParams
QueryCdpsByRatioParams = types.QueryCdpsByRatioParams
QueryCdpsParams = types.QueryCdpsParams
SupplyKeeper = types.SupplyKeeper
)