Documentation ¶
Index ¶
- func CalPoolUnit(...) (totalUnit, addUnit sdk.Int)
- func CalRemoveAmount(poolUnit, rmUnit, swapUnit, baseTokenBalance, tokenBalance sdk.Int, ...) (baseTokenAmount, tokenAmount, swapAmount sdk.Int)
- func CalSwapResult(baseTokenBalance, tokenBalance, inputAmount sdk.Int, inputIsBase bool) (y, fee sdk.Int)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AddPoolCreator(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) AddProvider(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPoolCreatorList(ctx sdk.Context) []string
- func (k Keeper) GetProviderList(ctx sdk.Context) []string
- func (k Keeper) GetProviderSwitch(ctx sdk.Context) bool
- func (k Keeper) GetSwapPool(ctx sdk.Context, denom string) (*types.SwapPool, bool)
- func (k Keeper) GetSwapPoolList(ctx sdk.Context) []*types.SwapPool
- func (k Keeper) GetSwapPoolNextIndex(ctx sdk.Context) uint32
- func (k Keeper) HasPoolCreator(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) HasProvider(ctx sdk.Context, addr sdk.AccAddress) bool
- func (k Keeper) IsRDexLpToken(ctx sdk.Context, denom string) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) PoolCreatorList(goCtx context.Context, req *types.QueryPoolCreatorListRequest) (*types.QueryPoolCreatorListResponse, error)
- func (k Keeper) ProviderList(goCtx context.Context, req *types.QueryProviderListRequest) (*types.QueryProviderListResponse, error)
- func (k Keeper) ProviderSwitch(goCtx context.Context, req *types.QueryProviderSwitchRequest) (*types.QueryProviderSwitchResponse, error)
- func (k Keeper) RemovePoolCreator(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) RemoveProvider(ctx sdk.Context, addr sdk.AccAddress)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetProviderSwitch(ctx sdk.Context, isOpen bool)
- func (k Keeper) SetSwapPool(ctx sdk.Context, denom string, swapPool *types.SwapPool)
- func (k Keeper) SetSwapPoolIndex(ctx sdk.Context, index uint32)
- func (k Keeper) SwapPoolInfo(goCtx context.Context, req *types.QuerySwapPoolInfoRequest) (*types.QuerySwapPoolInfoResponse, error)
- func (k Keeper) SwapPoolList(goCtx context.Context, req *types.QuerySwapPoolListRequest) (*types.QuerySwapPoolListResponse, error)
- func (k Keeper) ToggleProviderSwitch(ctx sdk.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalPoolUnit ¶
func CalPoolUnit(oldPoolUnit, baseTokenBalance, tokenBalance, baseTokenAmount, tokenAmount sdk.Int) (totalUnit, addUnit sdk.Int)
F = pool baseToken Balance (before) R = poo token Balance (before) f = baseToken added; r = token added P = existing Pool Units slipAdjustment = (1 - ABS((F r - f R)/((f + F) (r + R)))) units = ((P (r F + R f))/(2 R F))*slipAdjustment
func CalRemoveAmount ¶
func CalSwapResult ¶
func CalSwapResult(baseTokenBalance, tokenBalance, inputAmount sdk.Int, inputIsBase bool) (y, fee sdk.Int)
y = (x * X * Y) / (x + X)^2 fee = (x^2 * Y)/(x + X)^2
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 sdk.StoreKey, ps paramtypes.Subspace, bankKeeper types.BankKeeper, sudoKeeper types.SudoKeeper, ) *Keeper
func (Keeper) AddPoolCreator ¶
func (k Keeper) AddPoolCreator(ctx sdk.Context, addr sdk.AccAddress)
func (Keeper) AddProvider ¶
func (k Keeper) AddProvider(ctx sdk.Context, addr sdk.AccAddress)
func (Keeper) GetSwapPool ¶
func (Keeper) HasPoolCreator ¶
func (Keeper) HasProvider ¶
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) PoolCreatorList ¶
func (k Keeper) PoolCreatorList(goCtx context.Context, req *types.QueryPoolCreatorListRequest) (*types.QueryPoolCreatorListResponse, error)
func (Keeper) ProviderList ¶
func (k Keeper) ProviderList(goCtx context.Context, req *types.QueryProviderListRequest) (*types.QueryProviderListResponse, error)
func (Keeper) ProviderSwitch ¶
func (k Keeper) ProviderSwitch(goCtx context.Context, req *types.QueryProviderSwitchRequest) (*types.QueryProviderSwitchResponse, error)
func (Keeper) RemovePoolCreator ¶
func (k Keeper) RemovePoolCreator(ctx sdk.Context, addr sdk.AccAddress)
func (Keeper) RemoveProvider ¶
func (k Keeper) RemoveProvider(ctx sdk.Context, addr sdk.AccAddress)
func (Keeper) SetSwapPool ¶
func (Keeper) SwapPoolInfo ¶
func (k Keeper) SwapPoolInfo(goCtx context.Context, req *types.QuerySwapPoolInfoRequest) (*types.QuerySwapPoolInfoResponse, error)
func (Keeper) SwapPoolList ¶
func (k Keeper) SwapPoolList(goCtx context.Context, req *types.QuerySwapPoolListRequest) (*types.QuerySwapPoolListResponse, error)
func (Keeper) ToggleProviderSwitch ¶
Source Files ¶
- cal.go
- grpc_query.go
- grpc_query_params.go
- grpc_query_pool_creator_list.go
- grpc_query_provider_list.go
- grpc_query_provider_switch.go
- grpc_query_swap_pool_info.go
- grpc_query_swap_pool_list.go
- keeper.go
- msg_server.go
- msg_server_add_liquidity.go
- msg_server_add_pool_creator.go
- msg_server_add_provider.go
- msg_server_create_pool.go
- msg_server_remove_liquidity.go
- msg_server_rm_pool_creator.go
- msg_server_rm_provider.go
- msg_server_swap.go
- msg_server_toggle_provider_switch.go
- params.go
Click to show internal directories.
Click to hide internal directories.