Documentation
¶
Index ¶
- Constants
- func CalculateInterestAmount(apy sdk.Dec, payFreq int) (sdk.Dec, error)
- func CalculateInterestFactor(perSecondInterestRate sdk.Dec, secondsElapsed sdkmath.Int) sdk.Dec
- func CalculateInterestRate(apy sdk.Dec, payFreq int) sdk.Dec
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AddInvestorToPool(ctx sdk.Context, poolWithInvestors *types.PoolWithInvestors)
- func (k Keeper) AfterSPVInterestPaid(ctx sdk.Context, poolID string, amt sdkmath.Int)
- func (k Keeper) AllowedPools(goCtx context.Context, req *types.QueryAllowedPoolsRequest) (*types.QueryAllowedPoolsResponse, error)
- func (k Keeper) ArchieveDepositor(ctx sdk.Context, depositor types.DepositorInfo)
- func (k Keeper) ArchiveClass(ctx sdk.Context, classID string)
- func (k Keeper) ArchiveNFT(ctx sdk.Context, classID, nftID string) error
- func (k Keeper) ArchivePool(ctx sdk.Context, poolInfo types.PoolInfo)
- func (k Keeper) BeforeNFTBurned(ctx sdk.Context, poolIndex string, walletAddress string, linkednfts []string) error
- func (k Keeper) ClaimableInterest(goCtx context.Context, req *types.QueryClaimableInterestRequest) (*types.QueryClaimableInterestResponse, error)
- func (k Keeper) DelDepositor(ctx sdk.Context, depositor types.DepositorInfo)
- func (k Keeper) DelPool(ctx sdk.Context, index string)
- func (k Keeper) Depositor(goCtx context.Context, req *types.QueryDepositorRequest) (*types.QueryDepositorResponse, error)
- func (k Keeper) DepositorHistory(goCtx context.Context, req *types.QueryDepositorHistoryRequest) (*types.QueryHistoryDepositorResponse, error)
- func (k Keeper) GetDepositor(ctx sdk.Context, poolIndex string, walletAddress sdk.AccAddress) (depositor types.DepositorInfo, found bool)
- func (k Keeper) GetDepositorHistory(ctx sdk.Context, timeStamp time.Time, poolIndex string, addr sdk.AccAddress) (types.DepositorInfo, bool)
- func (k Keeper) GetDepositorTotalBorrowedAmount(ctx sdk.Context, depositor sdk.AccAddress, poolID string) (borrowed math.Int, found bool)
- func (k Keeper) GetHistoryPools(ctx sdk.Context, index string) (poolInfo types.PoolInfo, ok bool)
- func (k Keeper) GetInvestorToPool(ctx sdk.Context, poolIndex string) (currentInvestorPool types.PoolWithInvestors, found bool)
- func (k Keeper) GetOrCreate(ctx sdk.Context, classID string) (nfttypes.Class, error)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetParamsV21(ctx sdk.Context) sdkmath.Int
- func (k Keeper) GetPoolBorrowed(ctx sdk.Context, poolIndex string) (borrowed math.Int, ok bool)
- func (k Keeper) GetPools(ctx sdk.Context, index string) (poolInfo types.PoolInfo, ok bool)
- func (k Keeper) GetReserve(ctx sdk.Context, denom string) (amount sdk.Coin, ok bool)
- func (k Keeper) HandleInterest(ctx sdk.Context, poolInfo *types.PoolInfo) error
- func (k Keeper) HandlePartialPrincipalPayment(ctx sdk.Context, poolInfo *types.PoolInfo, withdrawAccounts []sdk.AccAddress) bool
- func (k Keeper) HandlePrincipalPayment(ctx sdk.Context, poolInfo *types.PoolInfo) bool
- func (k Keeper) HandleTransfer(ctx sdk.Context, poolInfo *types.PoolInfo) bool
- func (k *Keeper) IsHookSet() bool
- func (k Keeper) IterSPVReserve(ctx sdk.Context, cb func(coin sdk.Coin) (stop bool))
- func (k Keeper) IterateDepositors(ctx sdk.Context, poolIndex string, ...)
- func (k Keeper) IterateInvestorPools(ctx sdk.Context, ...)
- func (k Keeper) IteratePool(ctx sdk.Context, cb func(poolInfo types.PoolInfo) (stop bool))
- func (k Keeper) IterateReserve(ctx sdk.Context, cb func(coin sdk.Coin) (stop bool))
- func (k Keeper) IteratorAllDepositorHistory(ctx sdk.Context, poolIndex string, ...)
- func (k Keeper) ListHistoryPools(goCtx context.Context, req *types.QueryListPoolsRequest) (*types.QueryListPoolsResponse, error)
- func (k Keeper) ListPools(goCtx context.Context, req *types.QueryListPoolsRequest) (*types.QueryListPoolsResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OutstandingInterest(goCtx context.Context, req *types.QueryOutstandingInterestRequest) (*types.QueryOutstandingInterestResponse, error)
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) PoolInvestors(goCtx context.Context, req *types.QueryPoolInvestorsRequest) (*types.QueryPoolInvestorsResponse, error)
- func (k Keeper) QueryHistoryPool(goCtx context.Context, req *types.QueryQueryPoolRequest) (*types.QueryQueryPoolResponse, error)
- func (k Keeper) QueryPool(goCtx context.Context, req *types.QueryQueryPoolRequest) (*types.QueryQueryPoolResponse, error)
- func (k Keeper) RunSurplusAuctions(ctx sdk.Context)
- func (k Keeper) SetDepositor(ctx sdk.Context, depositor types.DepositorInfo)
- func (k Keeper) SetDepositorHistory(ctx sdk.Context, depositor types.DepositorInfo)
- func (k Keeper) SetHistoryPool(ctx sdk.Context, poolInfo types.PoolInfo)
- func (k *Keeper) SetHooks(sh types.SPVHooks) *Keeper
- func (k *Keeper) SetIncentiveKeeper(incentiveKeeper types.IncentiveKeeper) *Keeper
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPool(ctx sdk.Context, poolInfo types.PoolInfo)
- func (k Keeper) SetReserve(ctx sdk.Context, reserved sdk.Coin)
- func (k Keeper) TotalReserve(goCtx context.Context, req *types.QueryTotalReserveRequest) (*types.QueryTotalReserveResponse, error)
- func (k Keeper) UpdateIncentive(ctx sdk.Context, poolInfo types.PoolInfo)
- func (k Keeper) WithdrawalPrincipal(goCtx context.Context, req *types.QuerywithdrawalPrincipalRequest) (*types.QuerywithdrawalPrincipalResponse, error)
Constants ¶
const ( OneWeek = 7 * 24 * 3600 OneYear = OneWeek * 52 OneMonth = OneWeek * 4 BASE = 1 )
Variables ¶
This section is empty.
Functions ¶
func CalculateInterestAmount ¶
func CalculateInterestFactor ¶
CalculateInterestFactor calculates the simple interest scaling factor, which is equal to: (per-second interest rate * number of seconds elapsed) Will return 1.000x, multiply by principal to get new principal with added interest
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, kycKeeper types.KycKeeper, bankKeeper types.BankKeeper, accKeeper types.AccountKeeper, nftKeeper types.NFTKeeper, pricefeedkeeper types.PriceFeedKeeper, auctionKeeper types.AuctionKeeper, incentiveKeeper types.IncentiveKeeper, ) *Keeper
func (Keeper) AddInvestorToPool ¶
func (k Keeper) AddInvestorToPool(ctx sdk.Context, poolWithInvestors *types.PoolWithInvestors)
AddInvestorToPool add investors to the give pool
func (Keeper) AfterSPVInterestPaid ¶ added in v0.1.0
AfterSPVInterestPaid - call hook if registered to update the pool's incentives
func (Keeper) AllowedPools ¶
func (k Keeper) AllowedPools(goCtx context.Context, req *types.QueryAllowedPoolsRequest) (*types.QueryAllowedPoolsResponse, error)
func (Keeper) ArchieveDepositor ¶ added in v0.1.0
func (k Keeper) ArchieveDepositor(ctx sdk.Context, depositor types.DepositorInfo)
ArchieveDepositor archives the depositor
func (Keeper) ArchiveClass ¶ added in v0.1.0
ArchiveClass archives the class
func (Keeper) ArchiveNFT ¶ added in v0.1.0
ArchiveNFT archives the NFT
func (Keeper) ArchivePool ¶ added in v0.1.0
ArchivePool archives the pool
func (Keeper) BeforeNFTBurned ¶ added in v0.1.0
func (Keeper) ClaimableInterest ¶
func (k Keeper) ClaimableInterest(goCtx context.Context, req *types.QueryClaimableInterestRequest) (*types.QueryClaimableInterestResponse, error)
func (Keeper) DelDepositor ¶
func (k Keeper) DelDepositor(ctx sdk.Context, depositor types.DepositorInfo)
DelDepositor sets the depositor
func (Keeper) Depositor ¶
func (k Keeper) Depositor(goCtx context.Context, req *types.QueryDepositorRequest) (*types.QueryDepositorResponse, error)
func (Keeper) DepositorHistory ¶ added in v0.1.0
func (k Keeper) DepositorHistory(goCtx context.Context, req *types.QueryDepositorHistoryRequest) (*types.QueryHistoryDepositorResponse, error)
func (Keeper) GetDepositor ¶
func (k Keeper) GetDepositor(ctx sdk.Context, poolIndex string, walletAddress sdk.AccAddress) (depositor types.DepositorInfo, found bool)
func (Keeper) GetDepositorHistory ¶
func (k Keeper) GetDepositorHistory(ctx sdk.Context, timeStamp time.Time, poolIndex string, addr sdk.AccAddress) (types.DepositorInfo, bool)
GetDepositorHistory sets the depositor to history store
func (Keeper) GetDepositorTotalBorrowedAmount ¶ added in v0.1.0
func (Keeper) GetHistoryPools ¶ added in v0.1.0
GetHistoryPools gets the poolInfo with given pool index
func (Keeper) GetInvestorToPool ¶
func (Keeper) GetOrCreate ¶ added in v0.1.0
func (Keeper) GetParamsV21 ¶ added in v0.1.0
GetParams get all parameters as types.Params
func (Keeper) GetPoolBorrowed ¶ added in v0.1.0
func (Keeper) GetReserve ¶
GetReserve gets the poolInfo with given pool index
func (Keeper) HandleInterest ¶
func (Keeper) HandlePartialPrincipalPayment ¶
func (Keeper) HandlePrincipalPayment ¶
func (Keeper) HandleTransfer ¶
HandleTransfer if the pool have enough withdrawal amount, we can return the full amount of the investors otherwise, we can only return the partial of the principal
func (Keeper) IterSPVReserve ¶ added in v0.1.2
func (Keeper) IterateDepositors ¶
func (k Keeper) IterateDepositors(ctx sdk.Context, poolIndex string, cb func(depositor types.DepositorInfo) (stop bool))
IterateDepositors iterates over all deposit objects in the store and performs a callback function
func (Keeper) IterateInvestorPools ¶
func (k Keeper) IterateInvestorPools(ctx sdk.Context, cb func(poolWithInvestors types.PoolWithInvestors) (stop bool))
IterateInvestorPools iterates over all pools objects in the store and performs a callback function
func (Keeper) IteratePool ¶
IteratePool iterates over all deposit objects in the store and performs a callback function
func (Keeper) IterateReserve ¶
IterateReserve get the spv reserve token
func (Keeper) IteratorAllDepositorHistory ¶ added in v0.1.0
func (k Keeper) IteratorAllDepositorHistory(ctx sdk.Context, poolIndex string, cb func(depositor types.DepositorInfo) (stop bool))
IteratorAllDepositorHistory gets all the depositor to history store
func (Keeper) ListHistoryPools ¶ added in v0.1.0
func (k Keeper) ListHistoryPools(goCtx context.Context, req *types.QueryListPoolsRequest) (*types.QueryListPoolsResponse, error)
func (Keeper) ListPools ¶
func (k Keeper) ListPools(goCtx context.Context, req *types.QueryListPoolsRequest) (*types.QueryListPoolsResponse, error)
func (Keeper) OutstandingInterest ¶
func (k Keeper) OutstandingInterest(goCtx context.Context, req *types.QueryOutstandingInterestRequest) (*types.QueryOutstandingInterestResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) PoolInvestors ¶
func (k Keeper) PoolInvestors(goCtx context.Context, req *types.QueryPoolInvestorsRequest) (*types.QueryPoolInvestorsResponse, error)
func (Keeper) QueryHistoryPool ¶ added in v0.1.0
func (k Keeper) QueryHistoryPool(goCtx context.Context, req *types.QueryQueryPoolRequest) (*types.QueryQueryPoolResponse, error)
func (Keeper) QueryPool ¶
func (k Keeper) QueryPool(goCtx context.Context, req *types.QueryQueryPoolRequest) (*types.QueryQueryPoolResponse, error)
func (Keeper) RunSurplusAuctions ¶ added in v0.0.6
RunSurplusAuctions nets the surplus and debt balances and then creates surplus or debt auctions if the remaining balance is above the auction threshold parameter
func (Keeper) SetDepositor ¶
func (k Keeper) SetDepositor(ctx sdk.Context, depositor types.DepositorInfo)
SetDepositor sets the depositor
func (Keeper) SetDepositorHistory ¶
func (k Keeper) SetDepositorHistory(ctx sdk.Context, depositor types.DepositorInfo)
SetDepositorHistory sets the depositor to history store
func (Keeper) SetHistoryPool ¶
SetHistoryPool sets the pool
func (*Keeper) SetIncentiveKeeper ¶ added in v0.1.2
func (k *Keeper) SetIncentiveKeeper(incentiveKeeper types.IncentiveKeeper) *Keeper
func (Keeper) SetReserve ¶
SetReserve sets the pool
func (Keeper) TotalReserve ¶
func (k Keeper) TotalReserve(goCtx context.Context, req *types.QueryTotalReserveRequest) (*types.QueryTotalReserveResponse, error)
func (Keeper) UpdateIncentive ¶ added in v0.1.2
UpdateIncentive updates the incentive for the pool to the incentive module
func (Keeper) WithdrawalPrincipal ¶
func (k Keeper) WithdrawalPrincipal(goCtx context.Context, req *types.QuerywithdrawalPrincipalRequest) (*types.QuerywithdrawalPrincipalResponse, error)
Source Files
¶
- archive.go
- auction.go
- common.go
- exchange_converter.go
- grpc_query.go
- grpc_query_allowed_pools.go
- grpc_query_claimable_interest.go
- grpc_query_depositor.go
- grpc_query_list_pools.go
- grpc_query_outstanding_interest.go
- grpc_query_params.go
- grpc_query_pool_investors.go
- grpc_query_query_pool.go
- grpc_query_total_reserve.go
- grpc_query_withdrawable_principal.go
- handle_routine.go
- helper.go
- hooks.go
- incentive.go
- interest.go
- keeper.go
- msg_server.go
- msg_server_active_pool.go
- msg_server_add_investors.go
- msg_server_borrow.go
- msg_server_claim_interest.go
- msg_server_create_pool.go
- msg_server_deposit.go
- msg_server_liquidate.go
- msg_server_pay_principal.go
- msg_server_repay_interest.go
- msg_server_submit_withdraw_proposal.go
- msg_server_transfer_ownership.go
- msg_server_update_pool.go
- msg_server_withdraw_principal.go
- params.go