Documentation ¶
Index ¶
- Constants
- Variables
- func AddrLiquidityKeyPrefix(addr sdk.CUAddress) []byte
- func AddrLiquidityKeyPrefixWithDexID(addr sdk.CUAddress, dexID uint32) []byte
- func AddrMaskKey(addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func AddrTradeVolumeKey(addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func AddrTradeVolumeKeyWithAddrPrefix(addr sdk.CUAddress) []byte
- func AddrTradeVolumeKeyWithDexID(addr sdk.CUAddress, dexID uint32) []byte
- func DecodeAddrTradeVolumeKey(key []byte) (uint32, sdk.Symbol, sdk.Symbol)
- func DecodeLiquidityKey(key []byte) (uint32, sdk.Symbol, sdk.Symbol)
- func DexKey(dexID uint32) []byte
- func GetOrderIDFromUnfinishedOrderKey(key []byte) string
- func GetSymbolFromRepurchaseFundKey(key []byte) string
- func GlobalMaskKey(dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func LiquidityKey(addr sdk.CUAddress, dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func OrderKey(orderID string) []byte
- func PairTradeRewardKey(dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func RefererKey(addr sdk.CUAddress) []byte
- func RegisterCodec(cdc *codec.Codec)
- func RepurchaseFundKey(symbol string) []byte
- func TotalShareKey(dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func TradingPairKey(dexID uint32, tokenA, tokenB sdk.Symbol) []byte
- func TradingPairKeyPrefixWithDexID(dexID uint32) []byte
- func UnfinishedOrderKey(order *Order) []byte
- func UnfinishedOrderKeyPrefixWithAddr(addr sdk.CUAddress) []byte
- func UnfinishedOrderKeyPrefixWithPair(addr sdk.CUAddress, dexID uint32, baseSymbol, quoteSymbol sdk.Symbol) []byte
- type AddrLiquidity
- type DepthBook
- type Dex
- type Earning
- type EventLiquidity
- type EventOrderStatusChanged
- type EventSwap
- type EventSwaps
- type FeeRate
- type MiningWeight
- type MsgAddLiquidity
- type MsgCancelLimitSwap
- type MsgClaimLPEarning
- type MsgClaimTradeEarning
- type MsgCreateDex
- type MsgCreateTradingPair
- type MsgEditDex
- type MsgEditTradingPair
- type MsgLimitSwap
- type MsgRemoveLiquidity
- type MsgSwapExactIn
- type MsgSwapExactOut
- type Order
- type OrderByCreatedTime
- type Params
- type QueryAddrLiquidityParams
- type QueryAllTradingPairParams
- type QueryDexParams
- type QueryOrderParams
- type QueryOrderbookParams
- type QueryTradingPairParams
- type QueryUnclaimedEarningParams
- type QueryUnfinishedOrderParams
- type ReceiptKeeper
- type ResOrder
- type ResTradingPair
- type SupplyKeeper
- type TokenKeeper
- type TradeReward
- type TradingPair
- type TransferKeeper
Constants ¶
View Source
const ( EventTypeCreateDex = "create_dex" EventTypeEditDex = "edit_dex" EventTypeCreateTradingPair = "create_trading_pair" EventTypeEditTradingPair = "edit_trading_pair" EventTypeAddLiquidity = "add_liquidity" EventTypeRemoveLiquidity = "remove_liquidity" EventTypeSwap = "swap" EventTypeCancelOrders = "cancel_orders" EventTypeExpireOrders = "expire_orders" EventTypeWithdrawLPEarning = "withdraw_lp_earning" EventTypeWithdrawTradeEarning = "withdraw_trade_earning" EventTypeMining = "mining" EventTypeRepurchase = "repurchase" AttributeKeyDexID = "dex_id" AttributeKeyTokenA = "token_a" AttributeKeyTokenB = "token_b" AttributeKeyLiquidity = "liquidity" AttributeKeySwapResult = "swap" AttributeKeyBurned = "burned" AttributeKeyOrders = "orders" AttributeKeyLPAmount = "lp_amount" AttributeKeyTradeAmount = "trade_amount" AttributeKeyValidatorAmount = "validator_amount" AttributeKeyAddress = "address" AttributeKeyAmount = "amount" AttributeKeySymbol = "symbol" )
View Source
const ( // ModuleName is the name of this module ModuleName = "openswap" // RouterKey is used to route governance proposals RouterKey = ModuleName // StoreKey is the prefix under which we store this module's data StoreKey = ModuleName // QuerierKey is used to handle abci_query requests QuerierKey = ModuleName // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName BonusCollectorName = "openswap_collector" )
View Source
const ( TypeMsgCreateDex = "createdex" TypeMsgEditDex = "editdex" TypeMsgCreateTradingPair = "createtradingpair" TypeMsgEditTradingPair = "edittradingpair" TypeMsgAddLiquidity = "addliquidity" TypeMsgRemoveLiquidity = "removeliquidity" TypeMsgSwapExactIn = "swapexactin" TypeMsgSwapExactOut = "swapexactout" TypeMsgLimitSwap = "limitswap" TypeMsgCancelLimitSwap = "cancellimitswap" TypeMsgClaimLpEarning = "withdrawlpearning" TypeMsgClaimTradeEarning = "withdrawtradeearning" )
View Source
const ( OrderStatusNew = 0x00 OrderStatusPartiallyFilled = 0x01 OrderStatusFilled = 0x02 OrderStatusCanceled = 0x03 OrderStatusExpired = 0x04 )
View Source
const ( OrderSideBuy = 0x0 OrderSideSell = 0x1 )
View Source
const ( QueryDex = "dex" QueryAllDex = "all-dex" QueryTradingPair = "trading_pair" QueryAllTradingPair = "all_trading_pair" QueryAddrLiquidity = "addr_liquidity" QueryOrderbook = "orderbook" QueryOrder = "order" QueryUnfinishedOrder = "unfinished_order" QueryUnclaimedEarnings = "unclaimed_earnings" QueryRepurchaseFunds = "repurchase_funds" QueryParameters = "parameters" )
query endpoints supported by the upgrade Querier
Variables ¶
View Source
var ( DexKeyPrefix = []byte{0x00} DexIDKey = []byte{0x01} TradingPairKeyPrefix = []byte{0x02} LiquidityKeyPrefix = []byte{0x03} OrderKeyPrefix = []byte{0x04} UnfinishedOrderKeyPrefix = []byte{0x05} WaitToInsertMatchingKey = []byte{0x06} WaitToRemoveFromMatchingKey = []byte{0x07} RefererKeyPrefix = []byte{0x08} GlobalMaskKeyPrefix = []byte{0x0a} AddrMaskKeyPrefix = []byte{0x0b} RepurchaseFundKeyPrefix = []byte{0x0c} PairTradeRewardKeyPrefix = []byte{0x0d} AddrTradeVolumeKeyPrefix = []byte{0x0e} )
View Source
var ( DefaultMinimumLiquidity = sdk.NewInt(1000) DefaultLimitSwapMatchingGas = sdk.NewUint(50000) DefaultMaxFeeRate = sdk.NewDecWithPrec(1, 1) // 0.1 DefaultLpRewardRate = sdk.NewDecWithPrec(125, 5) // 0.00125 DefaultRefererTransactionBonusRate = sdk.NewDecWithPrec(0, 4) // 0.0001 DefaultRepurchaseRate = sdk.NewDecWithPrec(125, 5) // 0.00125 DefaultRepurchaseDuration = int64(1000) DefaultRepurchaseToken = sdk.NativeToken DefaultRepurchaseRoutingToken = tokentypes.CalSymbol("usdt", sdk.NativeToken).String() DefaultLPMiningWeights = []*MiningWeight{} DefaultTradeMiningWeights = []*MiningWeight{} DefaultLPMiningRewardRate = sdk.NewDecWithPrec(9, 1) // 0.9 )
View Source
var ( KeyMinimumLiquidity = []byte("MinimumLiquidity") KeyLimitSwapMatchingGas = []byte("LimitSwapMatchingGas") KeyMaxFeeRate = []byte("MaxFeeRate") KeyLpRewardRate = []byte("LpRewardRate") KeyRepurchaseRate = []byte("RepurchaseRate") KeyRefererTransactionBonusRate = []byte("RefererTransactionBonusRate") KeyRepurchaseDuration = []byte("RepurchaseDuration") KeyRepurchaseToken = []byte("RepurchaseToken") KeyRepurchaseRoutingToken = []byte("RepurchaseRoutingToken") KeyLPMiningWeights = []byte("LPMiningWeights") KeyTradeMiningWeights = []byte("TradeMiningWeights") KeyLPMiningRewardRate = []byte("LPMiningRewardRate") )
View Source
var (
ModuleCUAddress = sdk.CUAddress(crypto.AddressHash([]byte(ModuleName)))
)
View Source
var ModuleCdc = codec.New()
Functions ¶
func AddrLiquidityKeyPrefix ¶
func AddrMaskKey ¶
func AddrTradeVolumeKey ¶
func LiquidityKey ¶
func RefererKey ¶
func RepurchaseFundKey ¶
func UnfinishedOrderKey ¶
Types ¶
type AddrLiquidity ¶
type AddrLiquidity struct { *TradingPair `json:"trading_pair"` Liquidity sdk.Int `json:"liquidity"` }
func NewAddrLiquidity ¶
func NewAddrLiquidity(pair *TradingPair, liquidity sdk.Int) *AddrLiquidity
type DepthBook ¶
type Dex ¶
type Earning ¶
type EventLiquidity ¶
type EventLiquidity struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` TokenAAmount sdk.Int `json:"token_a_amount"` TokenBAmount sdk.Int `json:"token_b_amount"` ChangedTokenAAmount sdk.Int `json:"changed_a_amount"` ChangedTokenBAmount sdk.Int `json:"changed_b_amount"` }
func NewEventLiquidity ¶
func (*EventLiquidity) String ¶
func (e *EventLiquidity) String() string
type EventOrderStatusChanged ¶
type EventOrderStatusChanged struct {
OrderIDs []string `json:"order_ids"`
}
func NewEventOrderStatusChanged ¶
func NewEventOrderStatusChanged(orderIDs []string) *EventOrderStatusChanged
func (*EventOrderStatusChanged) String ¶
func (e *EventOrderStatusChanged) String() string
type EventSwap ¶
type EventSwap struct { From sdk.CUAddress `json:"from"` OrderID string `json:"order_id"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` TokenAAmount sdk.Int `json:"token_a_amount"` TokenBAmount sdk.Int `json:"token_b_amount"` TokenIn sdk.Symbol `json:"token_in"` AmountIn sdk.Int `json:"amount_in"` AmountOut sdk.Int `json:"amount_out"` }
type EventSwaps ¶
type EventSwaps []*EventSwap
func (*EventSwaps) String ¶
func (e *EventSwaps) String() string
type FeeRate ¶
type FeeRate struct { LPRewardRate sdk.Dec `json:"lp_reward_rate"` RepurchaseRate sdk.Dec `json:"repurchase_rate"` RefererRewardRate sdk.Dec `json:"referer_reward_rate"` }
func NewFeeRate ¶
func (*FeeRate) TotalFeeRate ¶
type MiningWeight ¶
type MiningWeight struct { DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` Weight sdk.Int `json:"weight"` }
func NewMiningWeight ¶
type MsgAddLiquidity ¶
type MsgAddLiquidity struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` TokenAAmount sdk.Int `json:"token_a_amount"` TokenBAmount sdk.Int `json:"token_b_amount"` MinTokenAAmount sdk.Int `json:"min_token_a_amount"` MinTokenBAmount sdk.Int `json:"min_token_b_amount"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgAddLiquidity ¶
func (MsgAddLiquidity) GetSignBytes ¶
func (msg MsgAddLiquidity) GetSignBytes() []byte
func (MsgAddLiquidity) GetSigners ¶
func (msg MsgAddLiquidity) GetSigners() []sdk.CUAddress
func (MsgAddLiquidity) Route ¶
func (msg MsgAddLiquidity) Route() string
func (MsgAddLiquidity) Type ¶
func (msg MsgAddLiquidity) Type() string
func (MsgAddLiquidity) ValidateBasic ¶
func (msg MsgAddLiquidity) ValidateBasic() sdk.Error
type MsgCancelLimitSwap ¶
type MsgCancelLimitSwap struct { From sdk.CUAddress `json:"from"` OrderIDs []string `json:"order_ids"` }
func NewMsgCancelLimitSwap ¶
func NewMsgCancelLimitSwap(from sdk.CUAddress, orderIDs []string) MsgCancelLimitSwap
func (MsgCancelLimitSwap) GetSignBytes ¶
func (msg MsgCancelLimitSwap) GetSignBytes() []byte
func (MsgCancelLimitSwap) GetSigners ¶
func (msg MsgCancelLimitSwap) GetSigners() []sdk.CUAddress
func (MsgCancelLimitSwap) Route ¶
func (msg MsgCancelLimitSwap) Route() string
func (MsgCancelLimitSwap) Type ¶
func (msg MsgCancelLimitSwap) Type() string
func (MsgCancelLimitSwap) ValidateBasic ¶
func (msg MsgCancelLimitSwap) ValidateBasic() sdk.Error
type MsgClaimLPEarning ¶
type MsgClaimLPEarning struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` }
func NewMsgClaimLPEarning ¶
func (MsgClaimLPEarning) GetSignBytes ¶
func (msg MsgClaimLPEarning) GetSignBytes() []byte
func (MsgClaimLPEarning) GetSigners ¶
func (msg MsgClaimLPEarning) GetSigners() []sdk.CUAddress
func (MsgClaimLPEarning) Route ¶
func (msg MsgClaimLPEarning) Route() string
func (MsgClaimLPEarning) Type ¶
func (msg MsgClaimLPEarning) Type() string
func (MsgClaimLPEarning) ValidateBasic ¶
func (msg MsgClaimLPEarning) ValidateBasic() sdk.Error
type MsgClaimTradeEarning ¶
type MsgClaimTradeEarning struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` }
func NewMsgClaimTradeEarning ¶
func (MsgClaimTradeEarning) GetSignBytes ¶
func (msg MsgClaimTradeEarning) GetSignBytes() []byte
func (MsgClaimTradeEarning) GetSigners ¶
func (msg MsgClaimTradeEarning) GetSigners() []sdk.CUAddress
func (MsgClaimTradeEarning) Route ¶
func (msg MsgClaimTradeEarning) Route() string
func (MsgClaimTradeEarning) Type ¶
func (msg MsgClaimTradeEarning) Type() string
func (MsgClaimTradeEarning) ValidateBasic ¶
func (msg MsgClaimTradeEarning) ValidateBasic() sdk.Error
type MsgCreateDex ¶
type MsgCreateDex struct { From sdk.CUAddress `json:"from"` Name string `json:"name"` IncomeReceiver sdk.CUAddress `json:"income_receiver"` }
func NewMsgCreateDex ¶
func (MsgCreateDex) GetSignBytes ¶
func (msg MsgCreateDex) GetSignBytes() []byte
func (MsgCreateDex) GetSigners ¶
func (msg MsgCreateDex) GetSigners() []sdk.CUAddress
func (MsgCreateDex) Route ¶
func (msg MsgCreateDex) Route() string
func (MsgCreateDex) Type ¶
func (msg MsgCreateDex) Type() string
func (MsgCreateDex) ValidateBasic ¶
func (msg MsgCreateDex) ValidateBasic() sdk.Error
type MsgCreateTradingPair ¶
type MsgCreateTradingPair struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` IsPublic bool `json:"is_public"` LPRewardRate sdk.Dec `json:"lp_reward_rate"` RefererRewardRate sdk.Dec `json:"referer_reward_rate"` }
func NewMsgCreateTradingPair ¶
func (MsgCreateTradingPair) GetSignBytes ¶
func (msg MsgCreateTradingPair) GetSignBytes() []byte
func (MsgCreateTradingPair) GetSigners ¶
func (msg MsgCreateTradingPair) GetSigners() []sdk.CUAddress
func (MsgCreateTradingPair) Route ¶
func (msg MsgCreateTradingPair) Route() string
func (MsgCreateTradingPair) Type ¶
func (msg MsgCreateTradingPair) Type() string
func (MsgCreateTradingPair) ValidateBasic ¶
func (msg MsgCreateTradingPair) ValidateBasic() sdk.Error
type MsgEditDex ¶
type MsgEditDex struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` Name string `json:"name"` IncomeReceiver *sdk.CUAddress `json:"income_receiver,omitempty"` }
func NewMsgEditDex ¶
func (MsgEditDex) GetSignBytes ¶
func (msg MsgEditDex) GetSignBytes() []byte
func (MsgEditDex) GetSigners ¶
func (msg MsgEditDex) GetSigners() []sdk.CUAddress
func (MsgEditDex) Route ¶
func (msg MsgEditDex) Route() string
func (MsgEditDex) Type ¶
func (msg MsgEditDex) Type() string
func (MsgEditDex) ValidateBasic ¶
func (msg MsgEditDex) ValidateBasic() sdk.Error
type MsgEditTradingPair ¶
type MsgEditTradingPair struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` IsPublic *bool `json:"is_public,omitempty"` LPRewardRate *sdk.Dec `json:"lp_reward_rate,omitempty"` RefererRewardRate *sdk.Dec `json:"referer_reward_rate,omitempty"` }
func NewMsgEditTradingPair ¶
func (MsgEditTradingPair) GetSignBytes ¶
func (msg MsgEditTradingPair) GetSignBytes() []byte
func (MsgEditTradingPair) GetSigners ¶
func (msg MsgEditTradingPair) GetSigners() []sdk.CUAddress
func (MsgEditTradingPair) Route ¶
func (msg MsgEditTradingPair) Route() string
func (MsgEditTradingPair) Type ¶
func (msg MsgEditTradingPair) Type() string
func (MsgEditTradingPair) ValidateBasic ¶
func (msg MsgEditTradingPair) ValidateBasic() sdk.Error
type MsgLimitSwap ¶
type MsgLimitSwap struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` OrderID string `json:"order_id"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` AmountIn sdk.Int `json:"amount_in"` Price sdk.Dec `json:"price"` BaseSymbol sdk.Symbol `json:"base_symbol"` QuoteSymbol sdk.Symbol `json:"quote_symbol"` Side int `json:"side"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgLimitSwap ¶
func (MsgLimitSwap) GetSignBytes ¶
func (msg MsgLimitSwap) GetSignBytes() []byte
func (MsgLimitSwap) GetSigners ¶
func (msg MsgLimitSwap) GetSigners() []sdk.CUAddress
func (MsgLimitSwap) Route ¶
func (msg MsgLimitSwap) Route() string
func (MsgLimitSwap) Type ¶
func (msg MsgLimitSwap) Type() string
func (MsgLimitSwap) ValidateBasic ¶
func (msg MsgLimitSwap) ValidateBasic() sdk.Error
type MsgRemoveLiquidity ¶
type MsgRemoveLiquidity struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` Liquidity sdk.Int `json:"liquidity"` MinTokenAAmount sdk.Int `json:"min_token_a_amount"` MinTokenBAmount sdk.Int `json:"min_token_b_amount"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgRemoveLiquidity ¶
func (MsgRemoveLiquidity) GetSignBytes ¶
func (msg MsgRemoveLiquidity) GetSignBytes() []byte
func (MsgRemoveLiquidity) GetSigners ¶
func (msg MsgRemoveLiquidity) GetSigners() []sdk.CUAddress
func (MsgRemoveLiquidity) Route ¶
func (msg MsgRemoveLiquidity) Route() string
func (MsgRemoveLiquidity) Type ¶
func (msg MsgRemoveLiquidity) Type() string
func (MsgRemoveLiquidity) ValidateBasic ¶
func (msg MsgRemoveLiquidity) ValidateBasic() sdk.Error
type MsgSwapExactIn ¶
type MsgSwapExactIn struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` AmountIn sdk.Int `json:"amount_in"` MinAmountOut sdk.Int `json:"min_amount_out"` SwapPath []sdk.Symbol `json:"swap_path"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgSwapExactIn ¶
func (MsgSwapExactIn) GetSignBytes ¶
func (msg MsgSwapExactIn) GetSignBytes() []byte
func (MsgSwapExactIn) GetSigners ¶
func (msg MsgSwapExactIn) GetSigners() []sdk.CUAddress
func (MsgSwapExactIn) Route ¶
func (msg MsgSwapExactIn) Route() string
func (MsgSwapExactIn) Type ¶
func (msg MsgSwapExactIn) Type() string
func (MsgSwapExactIn) ValidateBasic ¶
func (msg MsgSwapExactIn) ValidateBasic() sdk.Error
type MsgSwapExactOut ¶
type MsgSwapExactOut struct { From sdk.CUAddress `json:"from"` DexID uint32 `json:"dex_id"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` MaxAmountIn sdk.Int `json:"max_amount_in"` AmountOut sdk.Int `json:"amount_out"` SwapPath []sdk.Symbol `json:"swap_path"` ExpiredAt int64 `json:"expired_at"` }
func NewMsgSwapExactOut ¶
func (MsgSwapExactOut) GetSignBytes ¶
func (msg MsgSwapExactOut) GetSignBytes() []byte
func (MsgSwapExactOut) GetSigners ¶
func (msg MsgSwapExactOut) GetSigners() []sdk.CUAddress
func (MsgSwapExactOut) Route ¶
func (msg MsgSwapExactOut) Route() string
func (MsgSwapExactOut) Type ¶
func (msg MsgSwapExactOut) Type() string
func (MsgSwapExactOut) ValidateBasic ¶
func (msg MsgSwapExactOut) ValidateBasic() sdk.Error
type Order ¶
type Order struct { OrderID string `json:"order_id"` DexID uint32 `json:"dex_id"` From sdk.CUAddress `json:"from"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` CreatedTime int64 `json:"created_time"` ExpiredTime int64 `json:"expired_time"` FinishedTime int64 `json:"finished_time"` Status byte `json:"status"` Side byte `json:"side"` BaseSymbol sdk.Symbol `json:"base_symbol"` QuoteSymbol sdk.Symbol `json:"quote_symbol"` Price sdk.Dec `json:"price"` AmountIn sdk.Int `json:"amount_int"` LockedFund sdk.Int `json:"locked_fund"` FeeRate *FeeRate `json:"fee_rate"` }
func (*Order) IsFinished ¶
func (*Order) RemainQuantity ¶
type OrderByCreatedTime ¶
type OrderByCreatedTime []*Order
func (OrderByCreatedTime) Len ¶
func (o OrderByCreatedTime) Len() int
func (OrderByCreatedTime) Less ¶
func (o OrderByCreatedTime) Less(i, j int) bool
func (OrderByCreatedTime) Swap ¶
func (o OrderByCreatedTime) Swap(i, j int)
type Params ¶
type Params struct { MinimumLiquidity sdk.Int `json:"minimum_liquidity"` LimitSwapMatchingGas sdk.Uint `json:"limit_swap_matching_gas"` MaxFeeRate sdk.Dec `json:"max_fee_rate"` LpRewardRate sdk.Dec `json:"lp_reward_rate"` RepurchaseRate sdk.Dec `json:"repurchase_rate"` RefererTransactionBonusRate sdk.Dec `json:"referer_transaction_bonus_rate"` RepurchaseDuration int64 `json:"repurchase_duration"` LPMiningWeights []*MiningWeight `json:"lp_mining_weights"` TradeMiningWeights []*MiningWeight `json:"trade_mining_weights"` LPMiningRewardRate sdk.Dec `json:"lp_mining_reward_rate"` RepurchaseToken string `json:"repurchase_token"` RepurchaseRoutingToken string `json:"repurchase_routing_token"` }
Params defines the high level settings for staking
func MustUnmarshalParams ¶
unmarshal the current staking params value from store key or panic
func NewParams ¶
func NewParams(minLiquidity sdk.Int, limitSwapMatchingGas sdk.Uint, maxFeeRate, lpRewardRate, repurchaseRate, refererTransactionBonusRate sdk.Dec, repurchaseDuration int64, lpMiningWeights, tradeMiningWeights []*MiningWeight, lpMiningRewardRate sdk.Dec, repurchaseToken, repurchaseRoutingToken string) Params
NewParams creates a new Params instance
func UnmarshalParams ¶
unmarshal the current staking params value from store key
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type QueryAddrLiquidityParams ¶
func NewQueryAddrLiquidityParams ¶
func NewQueryAddrLiquidityParams(addr sdk.CUAddress, dexID *uint32) QueryAddrLiquidityParams
type QueryAllTradingPairParams ¶
type QueryAllTradingPairParams struct {
DexID *uint32
}
func NewQueryAllTradingPairParams ¶
func NewQueryAllTradingPairParams(dexID *uint32) QueryAllTradingPairParams
type QueryDexParams ¶
type QueryDexParams struct {
DexID uint32
}
func NewQueryDexParams ¶
func NewQueryDexParams(dexID uint32) QueryDexParams
type QueryOrderParams ¶
type QueryOrderParams struct {
OrderID string
}
func NewQueryOrderParams ¶
func NewQueryOrderParams(orderID string) QueryOrderParams
type QueryOrderbookParams ¶
type QueryOrderbookParams struct { DexID uint32 BaseSymbol sdk.Symbol QuoteSymbol sdk.Symbol Merge bool }
func NewQueryOrderbookParams ¶
func NewQueryOrderbookParams(dexID uint32, baseSymbol, quoteSymbol sdk.Symbol, merge bool) QueryOrderbookParams
type QueryTradingPairParams ¶
func NewQueryTradingPairParams ¶
func NewQueryTradingPairParams(dexID uint32, tokenA, tokenB sdk.Symbol) QueryTradingPairParams
type QueryUnclaimedEarningParams ¶
func NewQueryUnclaimedEarningParams ¶
func NewQueryUnclaimedEarningParams(addr sdk.CUAddress) QueryUnclaimedEarningParams
type QueryUnfinishedOrderParams ¶
type QueryUnfinishedOrderParams struct { Addr sdk.CUAddress DexID uint32 BaseSymbol sdk.Symbol QuoteSymbol sdk.Symbol }
type ReceiptKeeper ¶
type ResOrder ¶
type ResOrder struct { OrderID string `json:"order_id"` From sdk.CUAddress `json:"from"` Referer sdk.CUAddress `json:"referer"` Receiver sdk.CUAddress `json:"receiver"` CreatedTime int64 `json:"created_time"` ExpiredTime int64 `json:"expired_time"` FinishedTime int64 `json:"finished_time"` Status byte `json:"status"` Side byte `json:"side"` BaseSymbol sdk.Symbol `json:"base_symbol"` QuoteSymbol sdk.Symbol `json:"quote_symbol"` Price sdk.Dec `json:"price"` AmountIn sdk.Int `json:"amount_int"` LockedFund sdk.Int `json:"locked_fund"` RemainQuantity sdk.Int `json:"remain_quantity"` DexID uint32 `json:"dex_id"` FeeRate *FeeRate `json:"fee_rate"` }
func NewResOrder ¶
func NewResOrders ¶
type ResTradingPair ¶
type ResTradingPair struct { DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` TokenAAmount sdk.Int `json:"token_a_amount"` TokenBAmount sdk.Int `json:"token_b_amount"` TotalLiquidity sdk.Int `json:"total_liquidity"` IsPublic bool `json:"is_public"` LPRewardRate sdk.Dec `json:"lp_reward_rate"` RefererRewardRate sdk.Dec `json:"referer_reward_rate"` UnclaimedTradingReward sdk.Int `json:"unclaimed_trading_reward"` UnclaimedTradingVolume sdk.Int `json:"unclaimed_trading_volume"` }
func NewResTradingPair ¶
func NewResTradingPair(pair *TradingPair, reward *TradeReward) *ResTradingPair
func NewResTradingPairs ¶
func NewResTradingPairs(pairs []*TradingPair) []*ResTradingPair
type SupplyKeeper ¶
type SupplyKeeper interface { GetModuleAccount(ctx sdk.Context, name string) supplyI.ModuleAccountI SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) (sdk.Result, sdk.Error) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.CUAddress, amt sdk.Coins) (sdk.Result, sdk.Error) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.CUAddress, recipientModule string, amt sdk.Coins) (sdk.Result, sdk.Error) MintCoins(ctx sdk.Context, name string, amt sdk.Coins) sdk.Error BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Error GetSupply(ctx sdk.Context) (supply supplyI.SupplyI) }
SupplyKeeper defines the expected supply keeper
type TokenKeeper ¶
type TradeReward ¶
type TradeReward struct { DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` Reward sdk.Int `json:"reward"` TradingVolume sdk.Int `json:"trading_volume"` }
func NewTradeReward ¶
func NewTradeReward(dexID uint32, tokenA, tokenB sdk.Symbol) *TradeReward
type TradingPair ¶
type TradingPair struct { DexID uint32 `json:"dex_id"` TokenA sdk.Symbol `json:"token_a"` TokenB sdk.Symbol `json:"token_b"` TokenAAmount sdk.Int `json:"token_a_amount"` TokenBAmount sdk.Int `json:"token_b_amount"` TotalLiquidity sdk.Int `json:"total_liquidity"` IsPublic bool `json:"is_public"` LPRewardRate sdk.Dec `json:"lp_reward_rate"` RefererRewardRate sdk.Dec `json:"referer_reward_rate"` }
func NewCustomTradingPair ¶
func NewDefaultTradingPair ¶
func NewDefaultTradingPair(tokenA, tokenB sdk.Symbol, initialLiquidity sdk.Int) *TradingPair
func (*TradingPair) Price ¶
func (t *TradingPair) Price() sdk.Dec
func (*TradingPair) Validate ¶
func (t *TradingPair) Validate() error
type TransferKeeper ¶
type TransferKeeper interface { GetBalance(ctx sdk.Context, addr sdk.CUAddress, symbol string) sdk.Int GetAllBalance(ctx sdk.Context, addr sdk.CUAddress) sdk.Coins AddCoins(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error) AddCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error) SubCoins(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coins) (sdk.Coins, []sdk.Flow, sdk.Error) SubCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error) SubCoinHold(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) (sdk.Coin, sdk.Flow, sdk.Error) LockCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) ([]sdk.Flow, sdk.Error) UnlockCoin(ctx sdk.Context, addr sdk.CUAddress, amt sdk.Coin) ([]sdk.Flow, sdk.Error) SendCoin(ctx sdk.Context, fromAddr sdk.CUAddress, toAddr sdk.CUAddress, amt sdk.Coin) (sdk.Result, []sdk.Flow, sdk.Error) }
Click to show internal directories.
Click to hide internal directories.