Documentation
¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func ParamKeyTable() paramtypes.KeyTable
- func RegisterCodec(cdc *codec.LegacyAmino)
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error
- func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- type AccountKeeper
- type BankKeeper
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetModuleAccountBalance() types.Coin
- func (m *GenesisState) GetParams() Params
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (gs GenesisState) Validate() error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type LiquidateResp
- func (*LiquidateResp) Descriptor() ([]byte, []int)
- func (m *LiquidateResp) GetLiquidator() github_com_cosmos_cosmos_sdk_types.AccAddress
- func (m *LiquidateResp) GetPositionResp() *PositionResp
- func (m *LiquidateResp) Marshal() (dAtA []byte, err error)
- func (m *LiquidateResp) MarshalTo(dAtA []byte) (int, error)
- func (m *LiquidateResp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LiquidateResp) ProtoMessage()
- func (m *LiquidateResp) Reset()
- func (m *LiquidateResp) Size() (n int)
- func (m *LiquidateResp) String() string
- func (m *LiquidateResp) Unmarshal(dAtA []byte) error
- func (l *LiquidateResp) Validate() error
- func (m *LiquidateResp) XXX_DiscardUnknown()
- func (m *LiquidateResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LiquidateResp) XXX_Merge(src proto.Message)
- func (m *LiquidateResp) XXX_Size() int
- func (m *LiquidateResp) XXX_Unmarshal(b []byte) error
- type MarginCalculationPriceOption
- type MsgAddMargin
- func (*MsgAddMargin) Descriptor() ([]byte, []int)
- func (m *MsgAddMargin) GetMargin() types.Coin
- func (m *MsgAddMargin) GetSender() string
- func (m MsgAddMargin) GetSignBytes() []byte
- func (m MsgAddMargin) GetSigners() []sdk.AccAddress
- func (m *MsgAddMargin) GetTokenPair() string
- func (m *MsgAddMargin) Marshal() (dAtA []byte, err error)
- func (m *MsgAddMargin) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgAddMargin) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgAddMargin) ProtoMessage()
- func (m *MsgAddMargin) Reset()
- func (m MsgAddMargin) Route() string
- func (m *MsgAddMargin) Size() (n int)
- func (m *MsgAddMargin) String() string
- func (m MsgAddMargin) Type() string
- func (m *MsgAddMargin) Unmarshal(dAtA []byte) error
- func (m MsgAddMargin) ValidateBasic() error
- func (m *MsgAddMargin) XXX_DiscardUnknown()
- func (m *MsgAddMargin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgAddMargin) XXX_Merge(src proto.Message)
- func (m *MsgAddMargin) XXX_Size() int
- func (m *MsgAddMargin) XXX_Unmarshal(b []byte) error
- type MsgAddMarginResponse
- func (*MsgAddMarginResponse) Descriptor() ([]byte, []int)
- func (m *MsgAddMarginResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgAddMarginResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgAddMarginResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgAddMarginResponse) ProtoMessage()
- func (m *MsgAddMarginResponse) Reset()
- func (m *MsgAddMarginResponse) Size() (n int)
- func (m *MsgAddMarginResponse) String() string
- func (m *MsgAddMarginResponse) Unmarshal(dAtA []byte) error
- func (m *MsgAddMarginResponse) XXX_DiscardUnknown()
- func (m *MsgAddMarginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgAddMarginResponse) XXX_Merge(src proto.Message)
- func (m *MsgAddMarginResponse) XXX_Size() int
- func (m *MsgAddMarginResponse) XXX_Unmarshal(b []byte) error
- type MsgClient
- type MsgLiquidate
- func (*MsgLiquidate) Descriptor() ([]byte, []int)
- func (m *MsgLiquidate) GetSender() string
- func (m *MsgLiquidate) GetTokenPair() string
- func (m *MsgLiquidate) GetTrader() string
- func (m *MsgLiquidate) Marshal() (dAtA []byte, err error)
- func (m *MsgLiquidate) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgLiquidate) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgLiquidate) ProtoMessage()
- func (m *MsgLiquidate) Reset()
- func (m *MsgLiquidate) Size() (n int)
- func (m *MsgLiquidate) String() string
- func (m *MsgLiquidate) Unmarshal(dAtA []byte) error
- func (m *MsgLiquidate) XXX_DiscardUnknown()
- func (m *MsgLiquidate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgLiquidate) XXX_Merge(src proto.Message)
- func (m *MsgLiquidate) XXX_Size() int
- func (m *MsgLiquidate) XXX_Unmarshal(b []byte) error
- type MsgLiquidateResponse
- func (*MsgLiquidateResponse) Descriptor() ([]byte, []int)
- func (m *MsgLiquidateResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgLiquidateResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgLiquidateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgLiquidateResponse) ProtoMessage()
- func (m *MsgLiquidateResponse) Reset()
- func (m *MsgLiquidateResponse) Size() (n int)
- func (m *MsgLiquidateResponse) String() string
- func (m *MsgLiquidateResponse) Unmarshal(dAtA []byte) error
- func (m *MsgLiquidateResponse) XXX_DiscardUnknown()
- func (m *MsgLiquidateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgLiquidateResponse) XXX_Merge(src proto.Message)
- func (m *MsgLiquidateResponse) XXX_Size() int
- func (m *MsgLiquidateResponse) XXX_Unmarshal(b []byte) error
- type MsgOpenPosition
- func (*MsgOpenPosition) Descriptor() ([]byte, []int)
- func (m *MsgOpenPosition) GetSender() string
- func (m *MsgOpenPosition) GetSide() Side
- func (m *MsgOpenPosition) GetSigners() []sdk.AccAddress
- func (m *MsgOpenPosition) GetTokenPair() string
- func (m *MsgOpenPosition) Marshal() (dAtA []byte, err error)
- func (m *MsgOpenPosition) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgOpenPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgOpenPosition) ProtoMessage()
- func (m *MsgOpenPosition) Reset()
- func (m *MsgOpenPosition) Size() (n int)
- func (m *MsgOpenPosition) String() string
- func (m *MsgOpenPosition) Unmarshal(dAtA []byte) error
- func (m *MsgOpenPosition) ValidateBasic() error
- func (m *MsgOpenPosition) XXX_DiscardUnknown()
- func (m *MsgOpenPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgOpenPosition) XXX_Merge(src proto.Message)
- func (m *MsgOpenPosition) XXX_Size() int
- func (m *MsgOpenPosition) XXX_Unmarshal(b []byte) error
- type MsgOpenPositionResponse
- func (*MsgOpenPositionResponse) Descriptor() ([]byte, []int)
- func (m *MsgOpenPositionResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgOpenPositionResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgOpenPositionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgOpenPositionResponse) ProtoMessage()
- func (m *MsgOpenPositionResponse) Reset()
- func (m *MsgOpenPositionResponse) Size() (n int)
- func (m *MsgOpenPositionResponse) String() string
- func (m *MsgOpenPositionResponse) Unmarshal(dAtA []byte) error
- func (m *MsgOpenPositionResponse) XXX_DiscardUnknown()
- func (m *MsgOpenPositionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgOpenPositionResponse) XXX_Merge(src proto.Message)
- func (m *MsgOpenPositionResponse) XXX_Size() int
- func (m *MsgOpenPositionResponse) XXX_Unmarshal(b []byte) error
- type MsgRemoveMargin
- func (*MsgRemoveMargin) Descriptor() ([]byte, []int)
- func (m *MsgRemoveMargin) GetMargin() types.Coin
- func (m *MsgRemoveMargin) GetSender() string
- func (m MsgRemoveMargin) GetSignBytes() []byte
- func (m MsgRemoveMargin) GetSigners() []sdk.AccAddress
- func (m *MsgRemoveMargin) GetTokenPair() string
- func (m *MsgRemoveMargin) Marshal() (dAtA []byte, err error)
- func (m *MsgRemoveMargin) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgRemoveMargin) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgRemoveMargin) ProtoMessage()
- func (m *MsgRemoveMargin) Reset()
- func (m MsgRemoveMargin) Route() string
- func (m *MsgRemoveMargin) Size() (n int)
- func (m *MsgRemoveMargin) String() string
- func (m MsgRemoveMargin) Type() string
- func (m *MsgRemoveMargin) Unmarshal(dAtA []byte) error
- func (m MsgRemoveMargin) ValidateBasic() error
- func (m *MsgRemoveMargin) XXX_DiscardUnknown()
- func (m *MsgRemoveMargin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgRemoveMargin) XXX_Merge(src proto.Message)
- func (m *MsgRemoveMargin) XXX_Size() int
- func (m *MsgRemoveMargin) XXX_Unmarshal(b []byte) error
- type MsgRemoveMarginResponse
- func (*MsgRemoveMarginResponse) Descriptor() ([]byte, []int)
- func (m *MsgRemoveMarginResponse) GetMarginOut() types.Coin
- func (m *MsgRemoveMarginResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgRemoveMarginResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgRemoveMarginResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgRemoveMarginResponse) ProtoMessage()
- func (m *MsgRemoveMarginResponse) Reset()
- func (m *MsgRemoveMarginResponse) Size() (n int)
- func (m *MsgRemoveMarginResponse) String() string
- func (m *MsgRemoveMarginResponse) Unmarshal(dAtA []byte) error
- func (m *MsgRemoveMarginResponse) XXX_DiscardUnknown()
- func (m *MsgRemoveMarginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgRemoveMarginResponse) XXX_Merge(src proto.Message)
- func (m *MsgRemoveMarginResponse) XXX_Size() int
- func (m *MsgRemoveMarginResponse) XXX_Unmarshal(b []byte) error
- type MsgServer
- type PairMetadata
- func (*PairMetadata) Descriptor() ([]byte, []int)
- func (m *PairMetadata) GetPair() string
- func (m *PairMetadata) Marshal() (dAtA []byte, err error)
- func (m *PairMetadata) MarshalTo(dAtA []byte) (int, error)
- func (m *PairMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PairMetadata) ProtoMessage()
- func (m *PairMetadata) Reset()
- func (m *PairMetadata) Size() (n int)
- func (m *PairMetadata) String() string
- func (m *PairMetadata) Unmarshal(dAtA []byte) error
- func (m *PairMetadata) XXX_DiscardUnknown()
- func (m *PairMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PairMetadata) XXX_Merge(src proto.Message)
- func (m *PairMetadata) XXX_Size() int
- func (m *PairMetadata) XXX_Unmarshal(b []byte) error
- type Params
- func (*Params) Descriptor() ([]byte, []int)
- func (m *Params) GetLiquidationFee() int64
- func (p *Params) GetLiquidationFeeAsDec() sdk.Dec
- func (m *Params) GetPartialLiquidationRatio() int64
- func (p *Params) GetPartialLiquidationRatioAsDec() sdk.Dec
- func (m *Params) GetSpreadRatio() int64
- func (p *Params) GetSpreadRatioAsDec() sdk.Dec
- func (m *Params) GetStopped() bool
- func (m *Params) GetTollRatio() int64
- func (p *Params) GetTollRatioAsDec() sdk.Dec
- func (m *Params) Marshal() (dAtA []byte, err error)
- func (m *Params) MarshalTo(dAtA []byte) (int, error)
- func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
- func (*Params) ProtoMessage()
- func (m *Params) Reset()
- func (m *Params) Size() (n int)
- func (m *Params) String() string
- func (m *Params) Unmarshal(dAtA []byte) error
- func (p *Params) Validate() error
- func (m *Params) XXX_DiscardUnknown()
- func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Params) XXX_Merge(src proto.Message)
- func (m *Params) XXX_Size() int
- func (m *Params) XXX_Unmarshal(b []byte) error
- type PnLCalcOption
- type PnLPreferenceOption
- type Position
- func (*Position) Descriptor() ([]byte, []int)
- func (m *Position) GetAddress() string
- func (m *Position) GetBlockNumber() int64
- func (m *Position) GetLiquidityHistoryIndex() int64
- func (m *Position) GetPair() string
- func (m *Position) Marshal() (dAtA []byte, err error)
- func (m *Position) MarshalTo(dAtA []byte) (int, error)
- func (m *Position) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Position) ProtoMessage()
- func (m *Position) Reset()
- func (m *Position) Size() (n int)
- func (m *Position) String() string
- func (m *Position) Unmarshal(dAtA []byte) error
- func (m *Position) XXX_DiscardUnknown()
- func (m *Position) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Position) XXX_Merge(src proto.Message)
- func (m *Position) XXX_Size() int
- func (m *Position) XXX_Unmarshal(b []byte) error
- type PositionChangedEvent
- func (*PositionChangedEvent) Descriptor() ([]byte, []int)
- func (m *PositionChangedEvent) GetPair() string
- func (m *PositionChangedEvent) GetTrader() string
- func (m *PositionChangedEvent) Marshal() (dAtA []byte, err error)
- func (m *PositionChangedEvent) MarshalTo(dAtA []byte) (int, error)
- func (m *PositionChangedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PositionChangedEvent) ProtoMessage()
- func (m *PositionChangedEvent) Reset()
- func (m *PositionChangedEvent) Size() (n int)
- func (m *PositionChangedEvent) String() string
- func (m *PositionChangedEvent) Unmarshal(dAtA []byte) error
- func (m *PositionChangedEvent) XXX_DiscardUnknown()
- func (m *PositionChangedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PositionChangedEvent) XXX_Merge(src proto.Message)
- func (m *PositionChangedEvent) XXX_Size() int
- func (m *PositionChangedEvent) XXX_Unmarshal(b []byte) error
- type PositionResp
- func (*PositionResp) Descriptor() ([]byte, []int)
- func (m *PositionResp) GetPosition() *Position
- func (m *PositionResp) Marshal() (dAtA []byte, err error)
- func (m *PositionResp) MarshalTo(dAtA []byte) (int, error)
- func (m *PositionResp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PositionResp) ProtoMessage()
- func (m *PositionResp) Reset()
- func (m *PositionResp) Size() (n int)
- func (m *PositionResp) String() string
- func (m *PositionResp) Unmarshal(dAtA []byte) error
- func (m *PositionResp) XXX_DiscardUnknown()
- func (m *PositionResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PositionResp) XXX_Merge(src proto.Message)
- func (m *PositionResp) XXX_Size() int
- func (m *PositionResp) XXX_Unmarshal(b []byte) error
- type PriceKeeper
- type QueryClient
- type QueryParamsRequest
- func (*QueryParamsRequest) Descriptor() ([]byte, []int)
- func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryParamsRequest) ProtoMessage()
- func (m *QueryParamsRequest) Reset()
- func (m *QueryParamsRequest) Size() (n int)
- func (m *QueryParamsRequest) String() string
- func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error
- func (m *QueryParamsRequest) XXX_DiscardUnknown()
- func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryParamsRequest) XXX_Merge(src proto.Message)
- func (m *QueryParamsRequest) XXX_Size() int
- func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error
- type QueryParamsResponse
- func (*QueryParamsResponse) Descriptor() ([]byte, []int)
- func (m *QueryParamsResponse) GetParams() Params
- func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryParamsResponse) ProtoMessage()
- func (m *QueryParamsResponse) Reset()
- func (m *QueryParamsResponse) Size() (n int)
- func (m *QueryParamsResponse) String() string
- func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error
- func (m *QueryParamsResponse) XXX_DiscardUnknown()
- func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryParamsResponse) XXX_Merge(src proto.Message)
- func (m *QueryParamsResponse) XXX_Size() int
- func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error
- type QueryServer
- type Side
- type UnimplementedMsgServer
- func (*UnimplementedMsgServer) AddMargin(ctx context.Context, req *MsgAddMargin) (*MsgAddMarginResponse, error)
- func (*UnimplementedMsgServer) OpenPosition(ctx context.Context, req *MsgOpenPosition) (*MsgOpenPositionResponse, error)
- func (*UnimplementedMsgServer) RemoveMargin(ctx context.Context, req *MsgRemoveMargin) (*MsgRemoveMarginResponse, error)
- type UnimplementedQueryServer
- type VirtualPoolInfo
- func (*VirtualPoolInfo) Descriptor() ([]byte, []int)
- func (m *VirtualPoolInfo) GetLastRestrictionBlock() int64
- func (m *VirtualPoolInfo) GetPair() string
- func (m *VirtualPoolInfo) Marshal() (dAtA []byte, err error)
- func (m *VirtualPoolInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *VirtualPoolInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*VirtualPoolInfo) ProtoMessage()
- func (m *VirtualPoolInfo) Reset()
- func (m *VirtualPoolInfo) Size() (n int)
- func (m *VirtualPoolInfo) String() string
- func (m *VirtualPoolInfo) Unmarshal(dAtA []byte) error
- func (m *VirtualPoolInfo) XXX_DiscardUnknown()
- func (m *VirtualPoolInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VirtualPoolInfo) XXX_Merge(src proto.Message)
- func (m *VirtualPoolInfo) XXX_Size() int
- func (m *VirtualPoolInfo) XXX_Unmarshal(b []byte) error
- type VpoolKeeper
Constants ¶
const ( ModuleName = "perp" VaultModuleAccount = "vault" PerpEFModuleAccount = "perp_ef" FeePoolModuleAccount = "fee_pool" )
const DefaultIndex uint64 = 1
DefaultIndex is the default capability global index
Variables ¶
var ( Amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) )
var ( // StoreKey defines the primary module store key. StoreKey = ModuleName MemStoreKey = "mem_perp" // RouterKey is the message route for slashing. RouterKey = ModuleName // QuerierRoute defines the module's query routing key. QuerierRoute = ModuleName )
var ( ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowState = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var ( ErrMarginHighEnough = sdkerrors.Register(ModuleName, 1, "Margin is higher than required maintenant margin ratio") ErrPositionNotFound = errors.New("no position found") ErrPairNotFound = errors.New("pair doesn't have live vpool") ErrPositionZero = errors.New("position is zero") )
x/perp module sentinel errors
var MarginCalculationPriceOption_name = map[int32]string{
0: "SPOT",
1: "INDEX",
2: "MAX_PNL",
}
var MarginCalculationPriceOption_value = map[string]int32{
"SPOT": 0,
"INDEX": 1,
"MAX_PNL": 2,
}
var PnLCalcOption_name = map[int32]string{
0: "SPOT_PRICE",
1: "TWAP",
2: "ORACLE",
}
var PnLCalcOption_value = map[string]int32{
"SPOT_PRICE": 0,
"TWAP": 1,
"ORACLE": 2,
}
var PnLPreferenceOption_name = map[int32]string{
0: "MAX",
1: "MIN",
}
var PnLPreferenceOption_value = map[string]int32{
"MAX": 0,
"MIN": 1,
}
var Side_name = map[int32]string{
0: "BUY",
1: "SELL",
}
var Side_value = map[string]int32{
"BUY": 0,
"SELL": 1,
}
Functions ¶
func ParamKeyTable ¶
func ParamKeyTable() paramtypes.KeyTable
ParamKeyTable the param key table for launch module
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
func RegisterMsgHandler ¶
RegisterMsgHandler registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMsgHandlerClient ¶
RegisterMsgHandlerClient registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MsgClient" to call the correct interceptors.
func RegisterMsgHandlerFromEndpoint ¶
func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMsgHandlerServer ¶
RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". UnaryRPC :call MsgServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterMsgHandlerFromEndpoint instead.
func RegisterMsgServer ¶
func RegisterQueryHandler ¶
RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandlerClient ¶
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.
func RegisterQueryHandlerFromEndpoint ¶
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryHandlerServer ¶
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { // Methods imported from account should be defined here GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI GetModuleAddress(name string) sdk.AccAddress GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI }
AccountKeeper defines the expected account keeper used for simulations (noalias)
type BankKeeper ¶
type BankKeeper interface { // Methods imported from bank should be defined here SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error SendCoinsFromAccountToModule( ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, ) error SendCoinsFromModuleToModule( ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error SendCoinsFromModuleToAccount( ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, ) error BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin }
BankKeeper defines the expected interface needed to retrieve account balances.
type GenesisState ¶
type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` ModuleAccountBalance types.Coin `` /* 143-byte string literal not displayed */ }
GenesisState defines the perp module's genesis state.
func DefaultGenesis ¶
func DefaultGenesis() *GenesisState
DefaultGenesis returns the default Capability genesis state
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetModuleAccountBalance ¶
func (m *GenesisState) GetModuleAccountBalance() types.Coin
func (*GenesisState) GetParams ¶
func (m *GenesisState) GetParams() Params
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic genesis state validation returning an error upon any failure.
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type LiquidateResp ¶
type LiquidateResp struct { // Amount of bad debt created by the liquidation event BadDebt github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=bad_debt,json=badDebt,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bad_debt"` // Fee paid to the liquidator FeeToLiquidator github_com_cosmos_cosmos_sdk_types.Dec `` /* 148-byte string literal not displayed */ // Fee paid to the Perp EF fund FeeToPerpEcosystemFund github_com_cosmos_cosmos_sdk_types.Dec `` /* 173-byte string literal not displayed */ // Address of the liquidator Liquidator github_com_cosmos_cosmos_sdk_types.AccAddress `` /* 128-byte string literal not displayed */ // Position response from the close or open reverse position PositionResp *PositionResp `protobuf:"bytes,5,opt,name=position_resp,json=positionResp,proto3" json:"position_resp,omitempty"` }
func (*LiquidateResp) Descriptor ¶
func (*LiquidateResp) Descriptor() ([]byte, []int)
func (*LiquidateResp) GetLiquidator ¶
func (m *LiquidateResp) GetLiquidator() github_com_cosmos_cosmos_sdk_types.AccAddress
func (*LiquidateResp) GetPositionResp ¶
func (m *LiquidateResp) GetPositionResp() *PositionResp
func (*LiquidateResp) Marshal ¶
func (m *LiquidateResp) Marshal() (dAtA []byte, err error)
func (*LiquidateResp) MarshalToSizedBuffer ¶
func (m *LiquidateResp) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LiquidateResp) ProtoMessage ¶
func (*LiquidateResp) ProtoMessage()
func (*LiquidateResp) Reset ¶
func (m *LiquidateResp) Reset()
func (*LiquidateResp) Size ¶
func (m *LiquidateResp) Size() (n int)
func (*LiquidateResp) String ¶
func (m *LiquidateResp) String() string
func (*LiquidateResp) Unmarshal ¶
func (m *LiquidateResp) Unmarshal(dAtA []byte) error
func (*LiquidateResp) Validate ¶
func (l *LiquidateResp) Validate() error
func (*LiquidateResp) XXX_DiscardUnknown ¶
func (m *LiquidateResp) XXX_DiscardUnknown()
func (*LiquidateResp) XXX_Marshal ¶
func (m *LiquidateResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LiquidateResp) XXX_Merge ¶
func (m *LiquidateResp) XXX_Merge(src proto.Message)
func (*LiquidateResp) XXX_Size ¶
func (m *LiquidateResp) XXX_Size() int
func (*LiquidateResp) XXX_Unmarshal ¶
func (m *LiquidateResp) XXX_Unmarshal(b []byte) error
type MarginCalculationPriceOption ¶
type MarginCalculationPriceOption int32
const ( MarginCalculationPriceOption_SPOT MarginCalculationPriceOption = 0 MarginCalculationPriceOption_INDEX MarginCalculationPriceOption = 1 MarginCalculationPriceOption_MAX_PNL MarginCalculationPriceOption = 2 )
func (MarginCalculationPriceOption) EnumDescriptor ¶
func (MarginCalculationPriceOption) EnumDescriptor() ([]byte, []int)
func (MarginCalculationPriceOption) String ¶
func (x MarginCalculationPriceOption) String() string
type MsgAddMargin ¶
type MsgAddMargin struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` TokenPair string `protobuf:"bytes,2,opt,name=token_pair,json=tokenPair,proto3" json:"token_pair,omitempty"` Margin types.Coin `protobuf:"bytes,3,opt,name=margin,proto3" json:"margin"` }
MsgAddMargin: Msg to remove margin.
func (*MsgAddMargin) Descriptor ¶
func (*MsgAddMargin) Descriptor() ([]byte, []int)
func (*MsgAddMargin) GetMargin ¶
func (m *MsgAddMargin) GetMargin() types.Coin
func (*MsgAddMargin) GetSender ¶
func (m *MsgAddMargin) GetSender() string
func (MsgAddMargin) GetSignBytes ¶
func (m MsgAddMargin) GetSignBytes() []byte
func (MsgAddMargin) GetSigners ¶
func (m MsgAddMargin) GetSigners() []sdk.AccAddress
func (*MsgAddMargin) GetTokenPair ¶
func (m *MsgAddMargin) GetTokenPair() string
func (*MsgAddMargin) Marshal ¶
func (m *MsgAddMargin) Marshal() (dAtA []byte, err error)
func (*MsgAddMargin) MarshalToSizedBuffer ¶
func (m *MsgAddMargin) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgAddMargin) ProtoMessage ¶
func (*MsgAddMargin) ProtoMessage()
func (*MsgAddMargin) Reset ¶
func (m *MsgAddMargin) Reset()
func (MsgAddMargin) Route ¶
func (m MsgAddMargin) Route() string
func (*MsgAddMargin) Size ¶
func (m *MsgAddMargin) Size() (n int)
func (*MsgAddMargin) String ¶
func (m *MsgAddMargin) String() string
func (MsgAddMargin) Type ¶
func (m MsgAddMargin) Type() string
func (*MsgAddMargin) Unmarshal ¶
func (m *MsgAddMargin) Unmarshal(dAtA []byte) error
func (MsgAddMargin) ValidateBasic ¶
func (m MsgAddMargin) ValidateBasic() error
func (*MsgAddMargin) XXX_DiscardUnknown ¶
func (m *MsgAddMargin) XXX_DiscardUnknown()
func (*MsgAddMargin) XXX_Marshal ¶
func (m *MsgAddMargin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgAddMargin) XXX_Merge ¶
func (m *MsgAddMargin) XXX_Merge(src proto.Message)
func (*MsgAddMargin) XXX_Size ¶
func (m *MsgAddMargin) XXX_Size() int
func (*MsgAddMargin) XXX_Unmarshal ¶
func (m *MsgAddMargin) XXX_Unmarshal(b []byte) error
type MsgAddMarginResponse ¶
type MsgAddMarginResponse struct { }
func (*MsgAddMarginResponse) Descriptor ¶
func (*MsgAddMarginResponse) Descriptor() ([]byte, []int)
func (*MsgAddMarginResponse) Marshal ¶
func (m *MsgAddMarginResponse) Marshal() (dAtA []byte, err error)
func (*MsgAddMarginResponse) MarshalTo ¶
func (m *MsgAddMarginResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgAddMarginResponse) MarshalToSizedBuffer ¶
func (m *MsgAddMarginResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgAddMarginResponse) ProtoMessage ¶
func (*MsgAddMarginResponse) ProtoMessage()
func (*MsgAddMarginResponse) Reset ¶
func (m *MsgAddMarginResponse) Reset()
func (*MsgAddMarginResponse) Size ¶
func (m *MsgAddMarginResponse) Size() (n int)
func (*MsgAddMarginResponse) String ¶
func (m *MsgAddMarginResponse) String() string
func (*MsgAddMarginResponse) Unmarshal ¶
func (m *MsgAddMarginResponse) Unmarshal(dAtA []byte) error
func (*MsgAddMarginResponse) XXX_DiscardUnknown ¶
func (m *MsgAddMarginResponse) XXX_DiscardUnknown()
func (*MsgAddMarginResponse) XXX_Marshal ¶
func (m *MsgAddMarginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgAddMarginResponse) XXX_Merge ¶
func (m *MsgAddMarginResponse) XXX_Merge(src proto.Message)
func (*MsgAddMarginResponse) XXX_Size ¶
func (m *MsgAddMarginResponse) XXX_Size() int
func (*MsgAddMarginResponse) XXX_Unmarshal ¶
func (m *MsgAddMarginResponse) XXX_Unmarshal(b []byte) error
type MsgClient ¶
type MsgClient interface { RemoveMargin(ctx context.Context, in *MsgRemoveMargin, opts ...grpc.CallOption) (*MsgRemoveMarginResponse, error) AddMargin(ctx context.Context, in *MsgAddMargin, opts ...grpc.CallOption) (*MsgAddMarginResponse, error) OpenPosition(ctx context.Context, in *MsgOpenPosition, opts ...grpc.CallOption) (*MsgOpenPositionResponse, error) }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type MsgLiquidate ¶ added in v0.2.3
type MsgLiquidate struct { // Sender is the liquidator address Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` // TokenPair is the identifier for the position's virtual pool TokenPair string `protobuf:"bytes,2,opt,name=token_pair,json=tokenPair,proto3" json:"token_pair,omitempty"` // Trader is the address of the owner of the position Trader string `protobuf:"bytes,3,opt,name=trader,proto3" json:"trader,omitempty"` }
func (*MsgLiquidate) Descriptor ¶ added in v0.2.3
func (*MsgLiquidate) Descriptor() ([]byte, []int)
func (*MsgLiquidate) GetSender ¶ added in v0.2.3
func (m *MsgLiquidate) GetSender() string
func (*MsgLiquidate) GetTokenPair ¶ added in v0.2.3
func (m *MsgLiquidate) GetTokenPair() string
func (*MsgLiquidate) GetTrader ¶ added in v0.2.3
func (m *MsgLiquidate) GetTrader() string
func (*MsgLiquidate) Marshal ¶ added in v0.2.3
func (m *MsgLiquidate) Marshal() (dAtA []byte, err error)
func (*MsgLiquidate) MarshalTo ¶ added in v0.2.3
func (m *MsgLiquidate) MarshalTo(dAtA []byte) (int, error)
func (*MsgLiquidate) MarshalToSizedBuffer ¶ added in v0.2.3
func (m *MsgLiquidate) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgLiquidate) ProtoMessage ¶ added in v0.2.3
func (*MsgLiquidate) ProtoMessage()
func (*MsgLiquidate) Reset ¶ added in v0.2.3
func (m *MsgLiquidate) Reset()
func (*MsgLiquidate) Size ¶ added in v0.2.3
func (m *MsgLiquidate) Size() (n int)
func (*MsgLiquidate) String ¶ added in v0.2.3
func (m *MsgLiquidate) String() string
func (*MsgLiquidate) Unmarshal ¶ added in v0.2.3
func (m *MsgLiquidate) Unmarshal(dAtA []byte) error
func (*MsgLiquidate) XXX_DiscardUnknown ¶ added in v0.2.3
func (m *MsgLiquidate) XXX_DiscardUnknown()
func (*MsgLiquidate) XXX_Marshal ¶ added in v0.2.3
func (m *MsgLiquidate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgLiquidate) XXX_Merge ¶ added in v0.2.3
func (m *MsgLiquidate) XXX_Merge(src proto.Message)
func (*MsgLiquidate) XXX_Size ¶ added in v0.2.3
func (m *MsgLiquidate) XXX_Size() int
func (*MsgLiquidate) XXX_Unmarshal ¶ added in v0.2.3
func (m *MsgLiquidate) XXX_Unmarshal(b []byte) error
type MsgLiquidateResponse ¶ added in v0.2.3
type MsgLiquidateResponse struct { }
func (*MsgLiquidateResponse) Descriptor ¶ added in v0.2.3
func (*MsgLiquidateResponse) Descriptor() ([]byte, []int)
func (*MsgLiquidateResponse) Marshal ¶ added in v0.2.3
func (m *MsgLiquidateResponse) Marshal() (dAtA []byte, err error)
func (*MsgLiquidateResponse) MarshalTo ¶ added in v0.2.3
func (m *MsgLiquidateResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgLiquidateResponse) MarshalToSizedBuffer ¶ added in v0.2.3
func (m *MsgLiquidateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgLiquidateResponse) ProtoMessage ¶ added in v0.2.3
func (*MsgLiquidateResponse) ProtoMessage()
func (*MsgLiquidateResponse) Reset ¶ added in v0.2.3
func (m *MsgLiquidateResponse) Reset()
func (*MsgLiquidateResponse) Size ¶ added in v0.2.3
func (m *MsgLiquidateResponse) Size() (n int)
func (*MsgLiquidateResponse) String ¶ added in v0.2.3
func (m *MsgLiquidateResponse) String() string
func (*MsgLiquidateResponse) Unmarshal ¶ added in v0.2.3
func (m *MsgLiquidateResponse) Unmarshal(dAtA []byte) error
func (*MsgLiquidateResponse) XXX_DiscardUnknown ¶ added in v0.2.3
func (m *MsgLiquidateResponse) XXX_DiscardUnknown()
func (*MsgLiquidateResponse) XXX_Marshal ¶ added in v0.2.3
func (m *MsgLiquidateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgLiquidateResponse) XXX_Merge ¶ added in v0.2.3
func (m *MsgLiquidateResponse) XXX_Merge(src proto.Message)
func (*MsgLiquidateResponse) XXX_Size ¶ added in v0.2.3
func (m *MsgLiquidateResponse) XXX_Size() int
func (*MsgLiquidateResponse) XXX_Unmarshal ¶ added in v0.2.3
func (m *MsgLiquidateResponse) XXX_Unmarshal(b []byte) error
type MsgOpenPosition ¶ added in v0.1.2
type MsgOpenPosition struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` TokenPair string `protobuf:"bytes,2,opt,name=token_pair,json=tokenPair,proto3" json:"token_pair,omitempty"` Side Side `protobuf:"varint,3,opt,name=side,proto3,enum=nibiru.perp.v1.Side" json:"side,omitempty"` QuoteAssetAmount github_com_cosmos_cosmos_sdk_types.Int `` /* 151-byte string literal not displayed */ Leverage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,5,opt,name=leverage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"leverage"` BaseAssetAmountLimit github_com_cosmos_cosmos_sdk_types.Int `` /* 165-byte string literal not displayed */ }
func (*MsgOpenPosition) Descriptor ¶ added in v0.1.2
func (*MsgOpenPosition) Descriptor() ([]byte, []int)
func (*MsgOpenPosition) GetSender ¶ added in v0.1.2
func (m *MsgOpenPosition) GetSender() string
func (*MsgOpenPosition) GetSide ¶ added in v0.1.2
func (m *MsgOpenPosition) GetSide() Side
func (*MsgOpenPosition) GetSigners ¶ added in v0.1.2
func (m *MsgOpenPosition) GetSigners() []sdk.AccAddress
func (*MsgOpenPosition) GetTokenPair ¶ added in v0.1.2
func (m *MsgOpenPosition) GetTokenPair() string
func (*MsgOpenPosition) Marshal ¶ added in v0.1.2
func (m *MsgOpenPosition) Marshal() (dAtA []byte, err error)
func (*MsgOpenPosition) MarshalTo ¶ added in v0.1.2
func (m *MsgOpenPosition) MarshalTo(dAtA []byte) (int, error)
func (*MsgOpenPosition) MarshalToSizedBuffer ¶ added in v0.1.2
func (m *MsgOpenPosition) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgOpenPosition) ProtoMessage ¶ added in v0.1.2
func (*MsgOpenPosition) ProtoMessage()
func (*MsgOpenPosition) Reset ¶ added in v0.1.2
func (m *MsgOpenPosition) Reset()
func (*MsgOpenPosition) Size ¶ added in v0.1.2
func (m *MsgOpenPosition) Size() (n int)
func (*MsgOpenPosition) String ¶ added in v0.1.2
func (m *MsgOpenPosition) String() string
func (*MsgOpenPosition) Unmarshal ¶ added in v0.1.2
func (m *MsgOpenPosition) Unmarshal(dAtA []byte) error
func (*MsgOpenPosition) ValidateBasic ¶ added in v0.1.2
func (m *MsgOpenPosition) ValidateBasic() error
func (*MsgOpenPosition) XXX_DiscardUnknown ¶ added in v0.1.2
func (m *MsgOpenPosition) XXX_DiscardUnknown()
func (*MsgOpenPosition) XXX_Marshal ¶ added in v0.1.2
func (m *MsgOpenPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgOpenPosition) XXX_Merge ¶ added in v0.1.2
func (m *MsgOpenPosition) XXX_Merge(src proto.Message)
func (*MsgOpenPosition) XXX_Size ¶ added in v0.1.2
func (m *MsgOpenPosition) XXX_Size() int
func (*MsgOpenPosition) XXX_Unmarshal ¶ added in v0.1.2
func (m *MsgOpenPosition) XXX_Unmarshal(b []byte) error
type MsgOpenPositionResponse ¶ added in v0.1.2
type MsgOpenPositionResponse struct { }
func (*MsgOpenPositionResponse) Descriptor ¶ added in v0.1.2
func (*MsgOpenPositionResponse) Descriptor() ([]byte, []int)
func (*MsgOpenPositionResponse) Marshal ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) Marshal() (dAtA []byte, err error)
func (*MsgOpenPositionResponse) MarshalTo ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgOpenPositionResponse) MarshalToSizedBuffer ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgOpenPositionResponse) ProtoMessage ¶ added in v0.1.2
func (*MsgOpenPositionResponse) ProtoMessage()
func (*MsgOpenPositionResponse) Reset ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) Reset()
func (*MsgOpenPositionResponse) Size ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) Size() (n int)
func (*MsgOpenPositionResponse) String ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) String() string
func (*MsgOpenPositionResponse) Unmarshal ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) Unmarshal(dAtA []byte) error
func (*MsgOpenPositionResponse) XXX_DiscardUnknown ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) XXX_DiscardUnknown()
func (*MsgOpenPositionResponse) XXX_Marshal ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgOpenPositionResponse) XXX_Merge ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) XXX_Merge(src proto.Message)
func (*MsgOpenPositionResponse) XXX_Size ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) XXX_Size() int
func (*MsgOpenPositionResponse) XXX_Unmarshal ¶ added in v0.1.2
func (m *MsgOpenPositionResponse) XXX_Unmarshal(b []byte) error
type MsgRemoveMargin ¶
type MsgRemoveMargin struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` TokenPair string `protobuf:"bytes,2,opt,name=token_pair,json=tokenPair,proto3" json:"token_pair,omitempty"` Margin types.Coin `protobuf:"bytes,3,opt,name=margin,proto3" json:"margin"` }
MsgRemoveMargin: Msg to remove margin.
func (*MsgRemoveMargin) Descriptor ¶
func (*MsgRemoveMargin) Descriptor() ([]byte, []int)
func (*MsgRemoveMargin) GetMargin ¶
func (m *MsgRemoveMargin) GetMargin() types.Coin
func (*MsgRemoveMargin) GetSender ¶
func (m *MsgRemoveMargin) GetSender() string
func (MsgRemoveMargin) GetSignBytes ¶
func (m MsgRemoveMargin) GetSignBytes() []byte
func (MsgRemoveMargin) GetSigners ¶
func (m MsgRemoveMargin) GetSigners() []sdk.AccAddress
func (*MsgRemoveMargin) GetTokenPair ¶
func (m *MsgRemoveMargin) GetTokenPair() string
func (*MsgRemoveMargin) Marshal ¶
func (m *MsgRemoveMargin) Marshal() (dAtA []byte, err error)
func (*MsgRemoveMargin) MarshalToSizedBuffer ¶
func (m *MsgRemoveMargin) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgRemoveMargin) ProtoMessage ¶
func (*MsgRemoveMargin) ProtoMessage()
func (*MsgRemoveMargin) Reset ¶
func (m *MsgRemoveMargin) Reset()
func (MsgRemoveMargin) Route ¶
func (m MsgRemoveMargin) Route() string
func (*MsgRemoveMargin) Size ¶
func (m *MsgRemoveMargin) Size() (n int)
func (*MsgRemoveMargin) String ¶
func (m *MsgRemoveMargin) String() string
func (MsgRemoveMargin) Type ¶
func (m MsgRemoveMargin) Type() string
func (*MsgRemoveMargin) Unmarshal ¶
func (m *MsgRemoveMargin) Unmarshal(dAtA []byte) error
func (MsgRemoveMargin) ValidateBasic ¶
func (m MsgRemoveMargin) ValidateBasic() error
func (*MsgRemoveMargin) XXX_DiscardUnknown ¶
func (m *MsgRemoveMargin) XXX_DiscardUnknown()
func (*MsgRemoveMargin) XXX_Marshal ¶
func (m *MsgRemoveMargin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgRemoveMargin) XXX_Merge ¶
func (m *MsgRemoveMargin) XXX_Merge(src proto.Message)
func (*MsgRemoveMargin) XXX_Size ¶
func (m *MsgRemoveMargin) XXX_Size() int
func (*MsgRemoveMargin) XXX_Unmarshal ¶
func (m *MsgRemoveMargin) XXX_Unmarshal(b []byte) error
type MsgRemoveMarginResponse ¶
type MsgRemoveMarginResponse struct { // MarginOut: tokens transferred back to the trader MarginOut types.Coin `protobuf:"bytes,1,opt,name=margin_out,json=marginOut,proto3" json:"margin_out"` FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */ }
func (*MsgRemoveMarginResponse) Descriptor ¶
func (*MsgRemoveMarginResponse) Descriptor() ([]byte, []int)
func (*MsgRemoveMarginResponse) GetMarginOut ¶
func (m *MsgRemoveMarginResponse) GetMarginOut() types.Coin
func (*MsgRemoveMarginResponse) Marshal ¶
func (m *MsgRemoveMarginResponse) Marshal() (dAtA []byte, err error)
func (*MsgRemoveMarginResponse) MarshalTo ¶
func (m *MsgRemoveMarginResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgRemoveMarginResponse) MarshalToSizedBuffer ¶
func (m *MsgRemoveMarginResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgRemoveMarginResponse) ProtoMessage ¶
func (*MsgRemoveMarginResponse) ProtoMessage()
func (*MsgRemoveMarginResponse) Reset ¶
func (m *MsgRemoveMarginResponse) Reset()
func (*MsgRemoveMarginResponse) Size ¶
func (m *MsgRemoveMarginResponse) Size() (n int)
func (*MsgRemoveMarginResponse) String ¶
func (m *MsgRemoveMarginResponse) String() string
func (*MsgRemoveMarginResponse) Unmarshal ¶
func (m *MsgRemoveMarginResponse) Unmarshal(dAtA []byte) error
func (*MsgRemoveMarginResponse) XXX_DiscardUnknown ¶
func (m *MsgRemoveMarginResponse) XXX_DiscardUnknown()
func (*MsgRemoveMarginResponse) XXX_Marshal ¶
func (m *MsgRemoveMarginResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgRemoveMarginResponse) XXX_Merge ¶
func (m *MsgRemoveMarginResponse) XXX_Merge(src proto.Message)
func (*MsgRemoveMarginResponse) XXX_Size ¶
func (m *MsgRemoveMarginResponse) XXX_Size() int
func (*MsgRemoveMarginResponse) XXX_Unmarshal ¶
func (m *MsgRemoveMarginResponse) XXX_Unmarshal(b []byte) error
type MsgServer ¶
type MsgServer interface { RemoveMargin(context.Context, *MsgRemoveMargin) (*MsgRemoveMarginResponse, error) AddMargin(context.Context, *MsgAddMargin) (*MsgAddMarginResponse, error) OpenPosition(context.Context, *MsgOpenPosition) (*MsgOpenPositionResponse, error) }
MsgServer is the server API for Msg service.
type PairMetadata ¶
type PairMetadata struct { Pair string `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` CumulativePremiumFractions []github_com_cosmos_cosmos_sdk_types.Dec `` /* 181-byte string literal not displayed */ }
func (*PairMetadata) Descriptor ¶
func (*PairMetadata) Descriptor() ([]byte, []int)
func (*PairMetadata) GetPair ¶
func (m *PairMetadata) GetPair() string
func (*PairMetadata) Marshal ¶
func (m *PairMetadata) Marshal() (dAtA []byte, err error)
func (*PairMetadata) MarshalToSizedBuffer ¶
func (m *PairMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PairMetadata) ProtoMessage ¶
func (*PairMetadata) ProtoMessage()
func (*PairMetadata) Reset ¶
func (m *PairMetadata) Reset()
func (*PairMetadata) Size ¶
func (m *PairMetadata) Size() (n int)
func (*PairMetadata) String ¶
func (m *PairMetadata) String() string
func (*PairMetadata) Unmarshal ¶
func (m *PairMetadata) Unmarshal(dAtA []byte) error
func (*PairMetadata) XXX_DiscardUnknown ¶
func (m *PairMetadata) XXX_DiscardUnknown()
func (*PairMetadata) XXX_Marshal ¶
func (m *PairMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PairMetadata) XXX_Merge ¶
func (m *PairMetadata) XXX_Merge(src proto.Message)
func (*PairMetadata) XXX_Size ¶
func (m *PairMetadata) XXX_Size() int
func (*PairMetadata) XXX_Unmarshal ¶
func (m *PairMetadata) XXX_Unmarshal(b []byte) error
type Params ¶
type Params struct { // stopped identifies if the perp exchange is stopped or not Stopped bool `protobuf:"varint,1,opt,name=stopped,proto3" json:"stopped,omitempty"` MaintenanceMarginRatio github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */ // toll_ratio is the ratio transferred to the the fee pool TollRatio int64 `protobuf:"varint,3,opt,name=toll_ratio,json=tollRatio,proto3" json:"toll_ratio,omitempty"` // spread_ratio is the ratio transferred to the PerpEF. SpreadRatio int64 `protobuf:"varint,4,opt,name=spread_ratio,json=spreadRatio,proto3" json:"spread_ratio,omitempty"` // LiquidationFee is the percentage of liquidated position that will be given // to out as a reward. Half of the liquidation fee is given to the liquidator, // and the other half is given to the ecosystem fund. LiquidationFee int64 `protobuf:"varint,5,opt,name=liquidation_fee,json=liquidationFee,proto3" json:"liquidation_fee,omitempty"` // partial_liquidation_ratio is the share we try to liquidate if the margin is higher than liquidation fee PartialLiquidationRatio int64 `` /* 133-byte string literal not displayed */ }
func DefaultParams ¶
func DefaultParams() Params
DefaultParams returns the default parameters for the x/perp module.
func NewParams ¶
func NewParams( stopped bool, maintenanceMarginRatio sdk.Dec, tollRatio sdk.Dec, spreadRatio sdk.Dec, liquidationFee sdk.Dec, partialLiquidationRatio sdk.Dec, ) Params
NewParams creates a new Params instance
func (*Params) Descriptor ¶
func (*Params) GetLiquidationFee ¶
func (*Params) GetLiquidationFeeAsDec ¶
func (*Params) GetPartialLiquidationRatio ¶
func (*Params) GetPartialLiquidationRatioAsDec ¶
func (*Params) GetSpreadRatio ¶
func (*Params) GetSpreadRatioAsDec ¶
func (*Params) GetStopped ¶
func (*Params) GetTollRatio ¶
func (*Params) GetTollRatioAsDec ¶
func (*Params) MarshalToSizedBuffer ¶
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
ParamSetPairs get the params.ParamSet
func (*Params) ProtoMessage ¶
func (*Params) ProtoMessage()
func (*Params) XXX_DiscardUnknown ¶
func (m *Params) XXX_DiscardUnknown()
func (*Params) XXX_Marshal ¶
func (*Params) XXX_Unmarshal ¶
type PnLCalcOption ¶
type PnLCalcOption int32
const ( PnLCalcOption_SPOT_PRICE PnLCalcOption = 0 PnLCalcOption_TWAP PnLCalcOption = 1 PnLCalcOption_ORACLE PnLCalcOption = 2 )
func (PnLCalcOption) EnumDescriptor ¶
func (PnLCalcOption) EnumDescriptor() ([]byte, []int)
func (PnLCalcOption) String ¶
func (x PnLCalcOption) String() string
type PnLPreferenceOption ¶
type PnLPreferenceOption int32
const ( PnLPreferenceOption_MAX PnLPreferenceOption = 0 PnLPreferenceOption_MIN PnLPreferenceOption = 1 )
func (PnLPreferenceOption) EnumDescriptor ¶
func (PnLPreferenceOption) EnumDescriptor() ([]byte, []int)
func (PnLPreferenceOption) String ¶
func (x PnLPreferenceOption) String() string
type Position ¶
type Position struct { // address identifies the address owner of this position Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // pair identifies the pair associated with this position Pair string `protobuf:"bytes,2,opt,name=pair,proto3" json:"pair,omitempty"` Size_ github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=size,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"size"` Margin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=margin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin"` // OpenNotional is the quote denom value of the position when opening. OpenNotional github_com_cosmos_cosmos_sdk_types.Dec `` /* 137-byte string literal not displayed */ LastUpdateCumulativePremiumFraction github_com_cosmos_cosmos_sdk_types.Dec `` /* 212-byte string literal not displayed */ LiquidityHistoryIndex int64 `` /* 127-byte string literal not displayed */ // BlockNumber is the block number of the change to the position. BlockNumber int64 `protobuf:"varint,8,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` }
Position identifies and records information on a user's position on one of the virtual liquidity pools.
func ZeroPosition ¶
func (*Position) Descriptor ¶
func (*Position) GetAddress ¶
func (*Position) GetBlockNumber ¶
func (*Position) GetLiquidityHistoryIndex ¶
func (*Position) MarshalToSizedBuffer ¶
func (*Position) ProtoMessage ¶
func (*Position) ProtoMessage()
func (*Position) XXX_DiscardUnknown ¶
func (m *Position) XXX_DiscardUnknown()
func (*Position) XXX_Marshal ¶
func (*Position) XXX_Unmarshal ¶
type PositionChangedEvent ¶
type PositionChangedEvent struct { Trader string `protobuf:"bytes,1,opt,name=trader,proto3" json:"trader,omitempty"` Pair string `protobuf:"bytes,2,opt,name=pair,proto3" json:"pair,omitempty"` Margin github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=margin,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"margin"` PositionNotional github_com_cosmos_cosmos_sdk_types.Dec `` /* 149-byte string literal not displayed */ ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */ Fee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=fee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"fee"` PositionSizeAfter github_com_cosmos_cosmos_sdk_types.Dec `` /* 154-byte string literal not displayed */ RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `` /* 134-byte string literal not displayed */ UnrealizedPnlAfter github_com_cosmos_cosmos_sdk_types.Dec `` /* 157-byte string literal not displayed */ BadDebt github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,10,opt,name=bad_debt,json=badDebt,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bad_debt"` LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `` /* 156-byte string literal not displayed */ SpotPrice github_com_cosmos_cosmos_sdk_types.Dec `` /* 129-byte string literal not displayed */ FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `` /* 144-byte string literal not displayed */ }
func (*PositionChangedEvent) Descriptor ¶
func (*PositionChangedEvent) Descriptor() ([]byte, []int)
func (*PositionChangedEvent) GetPair ¶
func (m *PositionChangedEvent) GetPair() string
func (*PositionChangedEvent) GetTrader ¶
func (m *PositionChangedEvent) GetTrader() string
func (*PositionChangedEvent) Marshal ¶
func (m *PositionChangedEvent) Marshal() (dAtA []byte, err error)
func (*PositionChangedEvent) MarshalTo ¶
func (m *PositionChangedEvent) MarshalTo(dAtA []byte) (int, error)
func (*PositionChangedEvent) MarshalToSizedBuffer ¶
func (m *PositionChangedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PositionChangedEvent) ProtoMessage ¶
func (*PositionChangedEvent) ProtoMessage()
func (*PositionChangedEvent) Reset ¶
func (m *PositionChangedEvent) Reset()
func (*PositionChangedEvent) Size ¶
func (m *PositionChangedEvent) Size() (n int)
func (*PositionChangedEvent) String ¶
func (m *PositionChangedEvent) String() string
func (*PositionChangedEvent) Unmarshal ¶
func (m *PositionChangedEvent) Unmarshal(dAtA []byte) error
func (*PositionChangedEvent) XXX_DiscardUnknown ¶
func (m *PositionChangedEvent) XXX_DiscardUnknown()
func (*PositionChangedEvent) XXX_Marshal ¶
func (m *PositionChangedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PositionChangedEvent) XXX_Merge ¶
func (m *PositionChangedEvent) XXX_Merge(src proto.Message)
func (*PositionChangedEvent) XXX_Size ¶
func (m *PositionChangedEvent) XXX_Size() int
func (*PositionChangedEvent) XXX_Unmarshal ¶
func (m *PositionChangedEvent) XXX_Unmarshal(b []byte) error
type PositionResp ¶
type PositionResp struct { Position *Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"` ExchangedQuoteAssetAmount github_com_cosmos_cosmos_sdk_types.Dec `` /* 180-byte string literal not displayed */ BadDebt github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=bad_debt,json=badDebt,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bad_debt"` ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */ FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */ RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `` /* 134-byte string literal not displayed */ MarginToVault github_com_cosmos_cosmos_sdk_types.Dec `` /* 142-byte string literal not displayed */ UnrealizedPnlAfter github_com_cosmos_cosmos_sdk_types.Dec `` /* 157-byte string literal not displayed */ }
func (*PositionResp) Descriptor ¶
func (*PositionResp) Descriptor() ([]byte, []int)
func (*PositionResp) GetPosition ¶
func (m *PositionResp) GetPosition() *Position
func (*PositionResp) Marshal ¶
func (m *PositionResp) Marshal() (dAtA []byte, err error)
func (*PositionResp) MarshalToSizedBuffer ¶
func (m *PositionResp) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PositionResp) ProtoMessage ¶
func (*PositionResp) ProtoMessage()
func (*PositionResp) Reset ¶
func (m *PositionResp) Reset()
func (*PositionResp) Size ¶
func (m *PositionResp) Size() (n int)
func (*PositionResp) String ¶
func (m *PositionResp) String() string
func (*PositionResp) Unmarshal ¶
func (m *PositionResp) Unmarshal(dAtA []byte) error
func (*PositionResp) XXX_DiscardUnknown ¶
func (m *PositionResp) XXX_DiscardUnknown()
func (*PositionResp) XXX_Marshal ¶
func (m *PositionResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PositionResp) XXX_Merge ¶
func (m *PositionResp) XXX_Merge(src proto.Message)
func (*PositionResp) XXX_Size ¶
func (m *PositionResp) XXX_Size() int
func (*PositionResp) XXX_Unmarshal ¶
func (m *PositionResp) XXX_Unmarshal(b []byte) error
type PriceKeeper ¶
type PriceKeeper interface { GetCurrentPrice(ctx sdk.Context, token0 string, token1 string, ) (pftypes.CurrentPrice, error) GetCurrentPrices(ctx sdk.Context) pftypes.CurrentPrices GetRawPrices(ctx sdk.Context, marketId string) pftypes.PostedPrices GetPair(ctx sdk.Context, pairID string) (pftypes.Pair, bool) // Returns the pairs from the x/pricefeed params GetPairs(ctx sdk.Context) pftypes.Pairs GetOracle(ctx sdk.Context, pairID string, address sdk.AccAddress, ) (sdk.AccAddress, error) GetOracles(ctx sdk.Context, pairID string) ([]sdk.AccAddress, error) SetCurrentPrices(ctx sdk.Context, token0 string, token1 string) error }
type QueryClient ¶
type QueryClient interface { // Parameters queries the parameters of the x/perp module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type QueryParamsRequest ¶
type QueryParamsRequest struct { }
QueryParamsRequest is request type for the Query/Params RPC method.
func (*QueryParamsRequest) Descriptor ¶
func (*QueryParamsRequest) Descriptor() ([]byte, []int)
func (*QueryParamsRequest) Marshal ¶
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)
func (*QueryParamsRequest) MarshalTo ¶
func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryParamsRequest) MarshalToSizedBuffer ¶
func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryParamsRequest) ProtoMessage ¶
func (*QueryParamsRequest) ProtoMessage()
func (*QueryParamsRequest) Reset ¶
func (m *QueryParamsRequest) Reset()
func (*QueryParamsRequest) Size ¶
func (m *QueryParamsRequest) Size() (n int)
func (*QueryParamsRequest) String ¶
func (m *QueryParamsRequest) String() string
func (*QueryParamsRequest) Unmarshal ¶
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error
func (*QueryParamsRequest) XXX_DiscardUnknown ¶
func (m *QueryParamsRequest) XXX_DiscardUnknown()
func (*QueryParamsRequest) XXX_Marshal ¶
func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryParamsRequest) XXX_Merge ¶
func (m *QueryParamsRequest) XXX_Merge(src proto.Message)
func (*QueryParamsRequest) XXX_Size ¶
func (m *QueryParamsRequest) XXX_Size() int
func (*QueryParamsRequest) XXX_Unmarshal ¶
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error
type QueryParamsResponse ¶
type QueryParamsResponse struct { // params holds all the parameters of this module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` }
QueryParamsResponse is response type for the Query/Params RPC method.
func (*QueryParamsResponse) Descriptor ¶
func (*QueryParamsResponse) Descriptor() ([]byte, []int)
func (*QueryParamsResponse) GetParams ¶
func (m *QueryParamsResponse) GetParams() Params
func (*QueryParamsResponse) Marshal ¶
func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)
func (*QueryParamsResponse) MarshalTo ¶
func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryParamsResponse) MarshalToSizedBuffer ¶
func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryParamsResponse) ProtoMessage ¶
func (*QueryParamsResponse) ProtoMessage()
func (*QueryParamsResponse) Reset ¶
func (m *QueryParamsResponse) Reset()
func (*QueryParamsResponse) Size ¶
func (m *QueryParamsResponse) Size() (n int)
func (*QueryParamsResponse) String ¶
func (m *QueryParamsResponse) String() string
func (*QueryParamsResponse) Unmarshal ¶
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error
func (*QueryParamsResponse) XXX_DiscardUnknown ¶
func (m *QueryParamsResponse) XXX_DiscardUnknown()
func (*QueryParamsResponse) XXX_Marshal ¶
func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryParamsResponse) XXX_Merge ¶
func (m *QueryParamsResponse) XXX_Merge(src proto.Message)
func (*QueryParamsResponse) XXX_Size ¶
func (m *QueryParamsResponse) XXX_Size() int
func (*QueryParamsResponse) XXX_Unmarshal ¶
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error
type QueryServer ¶
type QueryServer interface { // Parameters queries the parameters of the x/perp module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) }
QueryServer is the server API for Query service.
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) AddMargin ¶
func (*UnimplementedMsgServer) AddMargin(ctx context.Context, req *MsgAddMargin) (*MsgAddMarginResponse, error)
func (*UnimplementedMsgServer) OpenPosition ¶ added in v0.1.2
func (*UnimplementedMsgServer) OpenPosition(ctx context.Context, req *MsgOpenPosition) (*MsgOpenPositionResponse, error)
func (*UnimplementedMsgServer) RemoveMargin ¶
func (*UnimplementedMsgServer) RemoveMargin(ctx context.Context, req *MsgRemoveMargin) (*MsgRemoveMarginResponse, error)
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) Params ¶
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error)
type VirtualPoolInfo ¶
type VirtualPoolInfo struct { Pair string `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"` LastRestrictionBlock int64 `protobuf:"varint,2,opt,name=last_restriction_block,json=lastRestrictionBlock,proto3" json:"last_restriction_block,omitempty"` CumulativePremiumFractions []github_com_cosmos_cosmos_sdk_types.Dec `` /* 181-byte string literal not displayed */ }
func (*VirtualPoolInfo) Descriptor ¶
func (*VirtualPoolInfo) Descriptor() ([]byte, []int)
func (*VirtualPoolInfo) GetLastRestrictionBlock ¶
func (m *VirtualPoolInfo) GetLastRestrictionBlock() int64
func (*VirtualPoolInfo) GetPair ¶
func (m *VirtualPoolInfo) GetPair() string
func (*VirtualPoolInfo) Marshal ¶
func (m *VirtualPoolInfo) Marshal() (dAtA []byte, err error)
func (*VirtualPoolInfo) MarshalToSizedBuffer ¶
func (m *VirtualPoolInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*VirtualPoolInfo) ProtoMessage ¶
func (*VirtualPoolInfo) ProtoMessage()
func (*VirtualPoolInfo) Reset ¶
func (m *VirtualPoolInfo) Reset()
func (*VirtualPoolInfo) Size ¶
func (m *VirtualPoolInfo) Size() (n int)
func (*VirtualPoolInfo) String ¶
func (m *VirtualPoolInfo) String() string
func (*VirtualPoolInfo) Unmarshal ¶
func (m *VirtualPoolInfo) Unmarshal(dAtA []byte) error
func (*VirtualPoolInfo) XXX_DiscardUnknown ¶
func (m *VirtualPoolInfo) XXX_DiscardUnknown()
func (*VirtualPoolInfo) XXX_Marshal ¶
func (m *VirtualPoolInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VirtualPoolInfo) XXX_Merge ¶
func (m *VirtualPoolInfo) XXX_Merge(src proto.Message)
func (*VirtualPoolInfo) XXX_Size ¶
func (m *VirtualPoolInfo) XXX_Size() int
func (*VirtualPoolInfo) XXX_Unmarshal ¶
func (m *VirtualPoolInfo) XXX_Unmarshal(b []byte) error
type VpoolKeeper ¶
type VpoolKeeper interface { /* Trades baseAssets in exchange for quoteAssets. The "output" asset here refers to baseAsset, which is a crypto asset like BTC. The quote asset is a stablecoin like NUSD. args: - ctx: cosmos-sdk context - pair: a token pair like BTC:NUSD - dir: either add or remove from pool - baseAssetAmount: the amount of quote asset being traded - quoteAmountLimit: a limiter to ensure the trader doesn't get screwed by slippage ret: - quoteAssetAmount: the amount of quote asset swapped - err: error */ SwapBaseForQuote( ctx sdk.Context, pair common.TokenPair, dir vpooltypes.Direction, abs sdk.Dec, limit sdk.Dec, ) (sdk.Dec, error) /* Trades quoteAssets in exchange for baseAssets. The "input" asset here refers to quoteAsset, which is usually a stablecoin like NUSD. The base asset is a crypto asset like BTC or ETH. args: - ctx: cosmos-sdk context - pair: a token pair like BTC:NUSD - dir: either add or remove from pool - quoteAssetAmount: the amount of quote asset being traded - baseAmountLimit: a limiter to ensure the trader doesn't get screwed by slippage ret: - baseAssetAmount: the amount of base asset traded from the pool - err: error */ SwapQuoteForBase( ctx sdk.Context, pair common.TokenPair, dir vpooltypes.Direction, quoteAssetAmount sdk.Dec, baseAmountLimit sdk.Dec, ) (sdk.Dec, error) /* Returns the amount of quote assets required to achieve a move of baseAssetAmount in a direction, based on historical snapshots. e.g. if removing <baseAssetAmount> base assets from the pool, returns the amount of quote assets do so. args: - ctx: cosmos-sdk context - pair: the token pair - direction: add or remove - baseAssetAmount: amount of base asset to add or remove - lookbackInterval: how far back to calculate TWAP ret: - quoteAssetAmount: the amount of quote asset to make the desired move, as sdk.Dec - err: error */ GetBaseAssetTWAP( ctx sdk.Context, pair common.TokenPair, direction vpooltypes.Direction, baseAssetAmount sdk.Dec, lookbackInterval time.Duration, ) (quoteAssetAmount sdk.Dec, err error) /* Returns the amount of base assets required to achieve a move of quoteAssetAmount in a direction, based on historical snapshots. e.g. if removing <quoteAssetAmount> quote assets from the pool, returns the amount of base assets do so. args: - ctx: cosmos-sdk context - pair: the token pair - direction: add or remove - quoteAssetAmount: amount of base asset to add or remove - lookbackInterval: how far back to calculate TWAP ret: - baseAssetAmount: the amount of quote asset to make the desired move, as sdk.Dec - err: error */ GetQuoteAssetTWAP( ctx sdk.Context, pair common.TokenPair, direction vpooltypes.Direction, quoteAssetAmount sdk.Dec, lookbackInterval time.Duration, ) (baseAssetAmount sdk.Dec, err error) /* Returns the amount of quote assets required to achieve a move of baseAssetAmount in a direction. e.g. if removing <baseAssetAmount> base assets from the pool, returns the amount of quote assets do so. args: - ctx: cosmos-sdk context - pair: the trading token pair - dir: add or remove - baseAssetAmount: the amount of base asset ret: - quoteAmount: the amount of quote assets required to make the desired swap - err: error */ GetBaseAssetPrice( ctx sdk.Context, pair common.TokenPair, direction vpooltypes.Direction, baseAssetAmount sdk.Dec, ) (quoteAssetAmount sdk.Dec, err error) /* Returns the amount of base assets required to achieve a move of quoteAmount in a direction. e.g. if removing <quoteAmount> quote assets from the pool, returns the amount of base assets do so. args: - ctx: cosmos-sdk context - pair: the trading token pair - dir: add or remove - quoteAmount: the amount of quote asset ret: - baseAssetAmount: the amount of base assets required to make the desired swap - err: error */ GetQuoteAssetPrice( ctx sdk.Context, pair common.TokenPair, dir vpooltypes.Direction, quoteAmount sdk.Dec, ) (baseAssetAmount sdk.Dec, err error) /* GetSpotPrice retrieves the price of the base asset denominated in quote asset. The convention is the amount of quote assets required to buy one base asset. e.g. If the tokenPair is BTC:NUSD, the method would return sdk.Dec(40,000.00) because the instantaneous tangent slope on the vpool curve is 40,000.00, so it would cost ~40,000.00 to buy one BTC:NUSD perp. args: - ctx: cosmos-sdk context - pair: the token pair to get price for ret: - price: the price of the token pair as sdk.Dec - err: error */ GetSpotPrice( ctx sdk.Context, pair common.TokenPair, ) (price sdk.Dec, err error) /* Retrieves the base asset's price from PricefeedKeeper (oracle). The price is denominated in quote asset, so # of quote asset to buy one base asset. args: - ctx: cosmos-sdk context - pair: token pair ret: - price: price as sdk.Dec - err: error */ GetUnderlyingPrice( ctx sdk.Context, pair common.TokenPair, ) (price sdk.Dec, err error) CalcPerpTxFee(ctx sdk.Context, pair common.TokenPair, quoteAmt sdk.Int, ) (toll sdk.Int, spread sdk.Int, err error) IsOverSpreadLimit(ctx sdk.Context, pair common.TokenPair) bool // ExistsPool returns true if pool exists, false if not. ExistsPool(ctx sdk.Context, pair common.TokenPair) bool GetSettlementPrice(ctx sdk.Context, pair common.TokenPair) (sdk.Dec, error) }