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) AllowedPools(goCtx context.Context, req *types.QueryAllowedPoolsRequest) (*types.QueryAllowedPoolsResponse, 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) 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) GetInvestorToPool(ctx sdk.Context, poolIndex string) (currentInvestorPool types.PoolWithInvestors, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- 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) 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) 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) QueryPool(goCtx context.Context, req *types.QueryQueryPoolRequest) (*types.QueryQueryPoolResponse, error)
- func (k Keeper) RunSurplusAuctions(ctx sdk.Context) error
- 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) 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) 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 ¶
type Keeper struct {
// contains filtered or unexported fields
}
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, ) *Keeper
func (Keeper) AddInvestorToPool ¶
func (k Keeper) AddInvestorToPool(ctx sdk.Context, poolWithInvestors *types.PoolWithInvestors)
AddInvestorToPool add investors to the give pool
func (Keeper) AllowedPools ¶
func (k Keeper) AllowedPools(goCtx context.Context, req *types.QueryAllowedPoolsRequest) (*types.QueryAllowedPoolsResponse, error)
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) 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) GetInvestorToPool ¶
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) 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) 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) 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) SetReserve ¶
SetReserve sets the pool
func (Keeper) TotalReserve ¶
func (k Keeper) TotalReserve(goCtx context.Context, req *types.QueryTotalReserveRequest) (*types.QueryTotalReserveResponse, error)
func (Keeper) WithdrawalPrincipal ¶
func (k Keeper) WithdrawalPrincipal(goCtx context.Context, req *types.QuerywithdrawalPrincipalRequest) (*types.QuerywithdrawalPrincipalResponse, error)
Source Files
¶
- 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
- 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