types

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

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

View Source
const (
	ModuleName           = "perp"
	VaultModuleAccount   = "vault"
	PerpEFModuleAccount  = "perp_ef"
	FeePoolModuleAccount = "fee_pool"
)

Variables

View Source
var (
	ErrInvalidLengthEvent        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvent          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// StoreKey defines the primary module store key.
	StoreKey = ModuleName

	MemStoreKey = "mem_perp"

	// RouterKey is the message route for perp.
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key.
	QuerierRoute = ModuleName
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthState        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowState          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrMarginHighEnough                  = sdkerrors.Register(ModuleName, 1, "margin is higher than required maintenance margin ratio")
	ErrPairNotFound                      = sdkerrors.Register(ModuleName, 2, "pair doesn't have live vpool")
	ErrPositionZero                      = sdkerrors.Register(ModuleName, 3, "position is zero")
	ErrFailedRemoveMarginCanCauseBadDebt = sdkerrors.Register(ModuleName, 4, "failed to remove margin; position would have bad debt if removed")
	ErrQuoteAmountIsZero                 = sdkerrors.Register(ModuleName, 5, "quote amount cannot be zero")
	ErrLeverageIsZero                    = sdkerrors.Register(ModuleName, 6, "leverage cannot be zero")
	ErrMarginRatioTooLow                 = sdkerrors.Register(ModuleName, 7, "margin ratio did not meet maintenance margin ratio")
	ErrLeverageIsTooHigh                 = sdkerrors.Register(ModuleName, 8, "leverage cannot be higher than vpool parameter")
	ErrUnauthorized                      = sdkerrors.Register(ModuleName, 9, "operation not authorized")
)

x/perp module sentinel errors

View Source
var MarginCalculationPriceOption_name = map[int32]string{
	0: "MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED",
	1: "SPOT",
	2: "INDEX",
	3: "MAX_PNL",
}
View Source
var MarginCalculationPriceOption_value = map[string]int32{
	"MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED": 0,
	"SPOT":    1,
	"INDEX":   2,
	"MAX_PNL": 3,
}
View Source
var PnLCalcOption_name = map[int32]string{
	0: "PNL_CALC_OPTION_UNSPECIFIED",
	1: "SPOT_PRICE",
	2: "TWAP",
	3: "ORACLE",
}
View Source
var PnLCalcOption_value = map[string]int32{
	"PNL_CALC_OPTION_UNSPECIFIED": 0,
	"SPOT_PRICE":                  1,
	"TWAP":                        2,
	"ORACLE":                      3,
}
View Source
var PnLPreferenceOption_name = map[int32]string{
	0: "PNL_PREFERENCE_UNSPECIFIED",
	1: "MAX",
	2: "MIN",
}
View Source
var PnLPreferenceOption_value = map[string]int32{
	"PNL_PREFERENCE_UNSPECIFIED": 0,
	"MAX":                        1,
	"MIN":                        2,
}
View Source
var Side_name = map[int32]string{
	0: "SIDE_UNSPECIFIED",
	1: "BUY",
	2: "SELL",
}
View Source
var Side_value = map[string]int32{
	"SIDE_UNSPECIFIED": 0,
	"BUY":              1,
	"SELL":             2,
}

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

func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterMsgHandler registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterMsgHandlerClient

func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error

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

func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error

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 RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

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 {
	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 {
	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
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
}

BankKeeper defines the expected interface needed to retrieve account balances.

type EpochKeeper added in v0.5.1

type EpochKeeper interface {
	// GetEpochInfo returns epoch info by identifier.
	GetEpochInfo(ctx sdk.Context, identifier string) types.EpochInfo
}

type FundingRateChangedEvent added in v0.10.0

type FundingRateChangedEvent struct {
	// The pair for which the funding rate was calculated.
	Pair string `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"`
	// The mark price of the pair.
	MarkPrice github_com_cosmos_cosmos_sdk_types.Dec `` /* 128-byte string literal not displayed */
	// The oracle index price of the pair.
	IndexPrice github_com_cosmos_cosmos_sdk_types.Dec `` /* 131-byte string literal not displayed */
	// The latest funding rate.
	LatestFundingRate github_com_cosmos_cosmos_sdk_types.Dec `` /* 154-byte string literal not displayed */
	// The latest premium fraction just calculated.
	LatestPremiumFraction github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */
	// The latest cumulative premium fraction.
	// The funding payment a position will pay is the difference between this value
	// and the latest cumulative premium fraction on the position, multiplied by the position size.
	CumulativePremiumFraction github_com_cosmos_cosmos_sdk_types.Dec `` /* 178-byte string literal not displayed */
	// The block number at which the funding rate was calculated.
	BlockHeight int64 `protobuf:"varint,7,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	// The block time in unix milliseconds at which the funding rate was calculated.
	BlockTimeMs int64 `protobuf:"varint,8,opt,name=block_time_ms,json=blockTimeMs,proto3" json:"block_time_ms,omitempty"`
}

Emitted when a new funding rate is calculated.

func (*FundingRateChangedEvent) Descriptor added in v0.10.0

func (*FundingRateChangedEvent) Descriptor() ([]byte, []int)

func (*FundingRateChangedEvent) GetBlockHeight added in v0.10.0

func (m *FundingRateChangedEvent) GetBlockHeight() int64

func (*FundingRateChangedEvent) GetBlockTimeMs added in v0.10.0

func (m *FundingRateChangedEvent) GetBlockTimeMs() int64

func (*FundingRateChangedEvent) GetPair added in v0.10.0

func (m *FundingRateChangedEvent) GetPair() string

func (*FundingRateChangedEvent) Marshal added in v0.10.0

func (m *FundingRateChangedEvent) Marshal() (dAtA []byte, err error)

func (*FundingRateChangedEvent) MarshalTo added in v0.10.0

func (m *FundingRateChangedEvent) MarshalTo(dAtA []byte) (int, error)

func (*FundingRateChangedEvent) MarshalToSizedBuffer added in v0.10.0

func (m *FundingRateChangedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*FundingRateChangedEvent) ProtoMessage added in v0.10.0

func (*FundingRateChangedEvent) ProtoMessage()

func (*FundingRateChangedEvent) Reset added in v0.10.0

func (m *FundingRateChangedEvent) Reset()

func (*FundingRateChangedEvent) Size added in v0.10.0

func (m *FundingRateChangedEvent) Size() (n int)

func (*FundingRateChangedEvent) String added in v0.10.0

func (m *FundingRateChangedEvent) String() string

func (*FundingRateChangedEvent) Unmarshal added in v0.10.0

func (m *FundingRateChangedEvent) Unmarshal(dAtA []byte) error

func (*FundingRateChangedEvent) XXX_DiscardUnknown added in v0.10.0

func (m *FundingRateChangedEvent) XXX_DiscardUnknown()

func (*FundingRateChangedEvent) XXX_Marshal added in v0.10.0

func (m *FundingRateChangedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FundingRateChangedEvent) XXX_Merge added in v0.10.0

func (m *FundingRateChangedEvent) XXX_Merge(src proto.Message)

func (*FundingRateChangedEvent) XXX_Size added in v0.10.0

func (m *FundingRateChangedEvent) XXX_Size() int

func (*FundingRateChangedEvent) XXX_Unmarshal added in v0.10.0

func (m *FundingRateChangedEvent) XXX_Unmarshal(b []byte) error

type GenesisState

type GenesisState struct {
	Params          Params           `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	PairMetadata    []PairMetadata   `protobuf:"bytes,2,rep,name=pair_metadata,json=pairMetadata,proto3" json:"pair_metadata"`
	Positions       []Position       `protobuf:"bytes,3,rep,name=positions,proto3" json:"positions"`
	PrepaidBadDebts []PrepaidBadDebt `protobuf:"bytes,4,rep,name=prepaid_bad_debts,json=prepaidBadDebts,proto3" json:"prepaid_bad_debts"`
}

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) GetPairMetadata added in v0.4.2

func (m *GenesisState) GetPairMetadata() []PairMetadata

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) GetPositions added in v0.5.0

func (m *GenesisState) GetPositions() []Position

func (*GenesisState) GetPrepaidBadDebts added in v0.5.0

func (m *GenesisState) GetPrepaidBadDebts() []PrepaidBadDebt

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, 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.Int `protobuf:"bytes,1,opt,name=bad_debt,json=badDebt,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bad_debt"`
	// Fee paid to the liquidator
	FeeToLiquidator github_com_cosmos_cosmos_sdk_types.Int `` /* 148-byte string literal not displayed */
	// Fee paid to the Perp EF fund
	FeeToPerpEcosystemFund github_com_cosmos_cosmos_sdk_types.Int `` /* 173-byte string literal not displayed */
	// Address of the liquidator
	Liquidator string `protobuf:"bytes,4,opt,name=liquidator,proto3" json:"liquidator,omitempty"`
	// 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() string

func (*LiquidateResp) GetPositionResp

func (m *LiquidateResp) GetPositionResp() *PositionResp

func (*LiquidateResp) Marshal

func (m *LiquidateResp) Marshal() (dAtA []byte, err error)

func (*LiquidateResp) MarshalTo

func (m *LiquidateResp) MarshalTo(dAtA []byte) (int, 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_MARGIN_CALCULATION_PRICE_OPTION_UNSPECIFIED MarginCalculationPriceOption = 0
	MarginCalculationPriceOption_SPOT                                        MarginCalculationPriceOption = 1
	MarginCalculationPriceOption_INDEX                                       MarginCalculationPriceOption = 2
	MarginCalculationPriceOption_MAX_PNL                                     MarginCalculationPriceOption = 3
)

func (MarginCalculationPriceOption) EnumDescriptor

func (MarginCalculationPriceOption) EnumDescriptor() ([]byte, []int)

func (MarginCalculationPriceOption) 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) MarshalTo

func (m *MsgAddMargin) MarshalTo(dAtA []byte) (int, 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 {
	FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */
	Position       *Position                              `protobuf:"bytes,2,opt,name=position,proto3" json:"position,omitempty"`
}

func (*MsgAddMarginResponse) Descriptor

func (*MsgAddMarginResponse) Descriptor() ([]byte, []int)

func (*MsgAddMarginResponse) GetPosition added in v0.5.0

func (m *MsgAddMarginResponse) GetPosition() *Position

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)
	// Liquidate is a transaction that allows the caller to fully or partially
	// liquidate an existing position.
	Liquidate(ctx context.Context, in *MsgLiquidate, opts ...grpc.CallOption) (*MsgLiquidateResponse, error)
	MultiLiquidate(ctx context.Context, in *MsgMultiLiquidate, opts ...grpc.CallOption) (*MsgMultiLiquidateResponse, error)
	OpenPosition(ctx context.Context, in *MsgOpenPosition, opts ...grpc.CallOption) (*MsgOpenPositionResponse, error)
	ClosePosition(ctx context.Context, in *MsgClosePosition, opts ...grpc.CallOption) (*MsgClosePositionResponse, error)
	DonateToEcosystemFund(ctx context.Context, in *MsgDonateToEcosystemFund, opts ...grpc.CallOption) (*MsgDonateToEcosystemFundResponse, 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 MsgClosePosition added in v0.4.20

type MsgClosePosition 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"`
}

func (*MsgClosePosition) Descriptor added in v0.4.20

func (*MsgClosePosition) Descriptor() ([]byte, []int)

func (*MsgClosePosition) GetSender added in v0.4.20

func (m *MsgClosePosition) GetSender() string

func (MsgClosePosition) GetSignBytes added in v0.4.20

func (m MsgClosePosition) GetSignBytes() []byte

func (MsgClosePosition) GetSigners added in v0.4.20

func (m MsgClosePosition) GetSigners() []sdk.AccAddress

func (*MsgClosePosition) GetTokenPair added in v0.4.20

func (m *MsgClosePosition) GetTokenPair() string

func (*MsgClosePosition) Marshal added in v0.4.20

func (m *MsgClosePosition) Marshal() (dAtA []byte, err error)

func (*MsgClosePosition) MarshalTo added in v0.4.20

func (m *MsgClosePosition) MarshalTo(dAtA []byte) (int, error)

func (*MsgClosePosition) MarshalToSizedBuffer added in v0.4.20

func (m *MsgClosePosition) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgClosePosition) ProtoMessage added in v0.4.20

func (*MsgClosePosition) ProtoMessage()

func (*MsgClosePosition) Reset added in v0.4.20

func (m *MsgClosePosition) Reset()

func (MsgClosePosition) Route added in v0.4.20

func (m MsgClosePosition) Route() string

func (*MsgClosePosition) Size added in v0.4.20

func (m *MsgClosePosition) Size() (n int)

func (*MsgClosePosition) String added in v0.4.20

func (m *MsgClosePosition) String() string

func (MsgClosePosition) Type added in v0.4.20

func (m MsgClosePosition) Type() string

func (*MsgClosePosition) Unmarshal added in v0.4.20

func (m *MsgClosePosition) Unmarshal(dAtA []byte) error

func (MsgClosePosition) ValidateBasic added in v0.4.20

func (m MsgClosePosition) ValidateBasic() error

func (*MsgClosePosition) XXX_DiscardUnknown added in v0.4.20

func (m *MsgClosePosition) XXX_DiscardUnknown()

func (*MsgClosePosition) XXX_Marshal added in v0.4.20

func (m *MsgClosePosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgClosePosition) XXX_Merge added in v0.4.20

func (m *MsgClosePosition) XXX_Merge(src proto.Message)

func (*MsgClosePosition) XXX_Size added in v0.4.20

func (m *MsgClosePosition) XXX_Size() int

func (*MsgClosePosition) XXX_Unmarshal added in v0.4.20

func (m *MsgClosePosition) XXX_Unmarshal(b []byte) error

type MsgClosePositionResponse added in v0.4.20

type MsgClosePositionResponse struct {
	// The amount of quote assets exchanged.
	ExchangedNotionalValue github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */
	// The amount of base assets exchanged.
	ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */
	// The funding payment applied on this position change, measured in quote units.
	FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */
	// The amount of PnL realized on this position changed, measured in quote units.
	RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `` /* 134-byte string literal not displayed */
	// The amount of margin the trader receives after closing the position, from the vault.
	// Should never be negative.
	MarginToTrader github_com_cosmos_cosmos_sdk_types.Dec `` /* 145-byte string literal not displayed */
}

func (*MsgClosePositionResponse) Descriptor added in v0.4.20

func (*MsgClosePositionResponse) Descriptor() ([]byte, []int)

func (*MsgClosePositionResponse) Marshal added in v0.4.20

func (m *MsgClosePositionResponse) Marshal() (dAtA []byte, err error)

func (*MsgClosePositionResponse) MarshalTo added in v0.4.20

func (m *MsgClosePositionResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgClosePositionResponse) MarshalToSizedBuffer added in v0.4.20

func (m *MsgClosePositionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgClosePositionResponse) ProtoMessage added in v0.4.20

func (*MsgClosePositionResponse) ProtoMessage()

func (*MsgClosePositionResponse) Reset added in v0.4.20

func (m *MsgClosePositionResponse) Reset()

func (*MsgClosePositionResponse) Size added in v0.4.20

func (m *MsgClosePositionResponse) Size() (n int)

func (*MsgClosePositionResponse) String added in v0.4.20

func (m *MsgClosePositionResponse) String() string

func (*MsgClosePositionResponse) Unmarshal added in v0.4.20

func (m *MsgClosePositionResponse) Unmarshal(dAtA []byte) error

func (*MsgClosePositionResponse) XXX_DiscardUnknown added in v0.4.20

func (m *MsgClosePositionResponse) XXX_DiscardUnknown()

func (*MsgClosePositionResponse) XXX_Marshal added in v0.4.20

func (m *MsgClosePositionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgClosePositionResponse) XXX_Merge added in v0.4.20

func (m *MsgClosePositionResponse) XXX_Merge(src proto.Message)

func (*MsgClosePositionResponse) XXX_Size added in v0.4.20

func (m *MsgClosePositionResponse) XXX_Size() int

func (*MsgClosePositionResponse) XXX_Unmarshal added in v0.4.20

func (m *MsgClosePositionResponse) XXX_Unmarshal(b []byte) error

type MsgDonateToEcosystemFund added in v0.15.0

type MsgDonateToEcosystemFund struct {
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// donation to the EF
	Donation types.Coin `protobuf:"bytes,2,opt,name=donation,proto3" json:"donation" yaml:"donation"`
}

func (*MsgDonateToEcosystemFund) Descriptor added in v0.15.0

func (*MsgDonateToEcosystemFund) Descriptor() ([]byte, []int)

func (*MsgDonateToEcosystemFund) GetDonation added in v0.15.0

func (m *MsgDonateToEcosystemFund) GetDonation() types.Coin

func (*MsgDonateToEcosystemFund) GetSender added in v0.15.0

func (m *MsgDonateToEcosystemFund) GetSender() string

func (MsgDonateToEcosystemFund) GetSignBytes added in v0.15.0

func (m MsgDonateToEcosystemFund) GetSignBytes() []byte

func (MsgDonateToEcosystemFund) GetSigners added in v0.15.0

func (m MsgDonateToEcosystemFund) GetSigners() []sdk.AccAddress

func (*MsgDonateToEcosystemFund) Marshal added in v0.15.0

func (m *MsgDonateToEcosystemFund) Marshal() (dAtA []byte, err error)

func (*MsgDonateToEcosystemFund) MarshalTo added in v0.15.0

func (m *MsgDonateToEcosystemFund) MarshalTo(dAtA []byte) (int, error)

func (*MsgDonateToEcosystemFund) MarshalToSizedBuffer added in v0.15.0

func (m *MsgDonateToEcosystemFund) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgDonateToEcosystemFund) ProtoMessage added in v0.15.0

func (*MsgDonateToEcosystemFund) ProtoMessage()

func (*MsgDonateToEcosystemFund) Reset added in v0.15.0

func (m *MsgDonateToEcosystemFund) Reset()

func (MsgDonateToEcosystemFund) Route added in v0.15.0

func (m MsgDonateToEcosystemFund) Route() string

func (*MsgDonateToEcosystemFund) Size added in v0.15.0

func (m *MsgDonateToEcosystemFund) Size() (n int)

func (*MsgDonateToEcosystemFund) String added in v0.15.0

func (m *MsgDonateToEcosystemFund) String() string

func (MsgDonateToEcosystemFund) Type added in v0.15.0

func (*MsgDonateToEcosystemFund) Unmarshal added in v0.15.0

func (m *MsgDonateToEcosystemFund) Unmarshal(dAtA []byte) error

func (MsgDonateToEcosystemFund) ValidateBasic added in v0.15.0

func (m MsgDonateToEcosystemFund) ValidateBasic() error

func (*MsgDonateToEcosystemFund) XXX_DiscardUnknown added in v0.15.0

func (m *MsgDonateToEcosystemFund) XXX_DiscardUnknown()

func (*MsgDonateToEcosystemFund) XXX_Marshal added in v0.15.0

func (m *MsgDonateToEcosystemFund) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgDonateToEcosystemFund) XXX_Merge added in v0.15.0

func (m *MsgDonateToEcosystemFund) XXX_Merge(src proto.Message)

func (*MsgDonateToEcosystemFund) XXX_Size added in v0.15.0

func (m *MsgDonateToEcosystemFund) XXX_Size() int

func (*MsgDonateToEcosystemFund) XXX_Unmarshal added in v0.15.0

func (m *MsgDonateToEcosystemFund) XXX_Unmarshal(b []byte) error

type MsgDonateToEcosystemFundResponse added in v0.15.0

type MsgDonateToEcosystemFundResponse struct {
}

func (*MsgDonateToEcosystemFundResponse) Descriptor added in v0.15.0

func (*MsgDonateToEcosystemFundResponse) Descriptor() ([]byte, []int)

func (*MsgDonateToEcosystemFundResponse) Marshal added in v0.15.0

func (m *MsgDonateToEcosystemFundResponse) Marshal() (dAtA []byte, err error)

func (*MsgDonateToEcosystemFundResponse) MarshalTo added in v0.15.0

func (m *MsgDonateToEcosystemFundResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgDonateToEcosystemFundResponse) MarshalToSizedBuffer added in v0.15.0

func (m *MsgDonateToEcosystemFundResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgDonateToEcosystemFundResponse) ProtoMessage added in v0.15.0

func (*MsgDonateToEcosystemFundResponse) ProtoMessage()

func (*MsgDonateToEcosystemFundResponse) Reset added in v0.15.0

func (*MsgDonateToEcosystemFundResponse) Size added in v0.15.0

func (m *MsgDonateToEcosystemFundResponse) Size() (n int)

func (*MsgDonateToEcosystemFundResponse) String added in v0.15.0

func (*MsgDonateToEcosystemFundResponse) Unmarshal added in v0.15.0

func (m *MsgDonateToEcosystemFundResponse) Unmarshal(dAtA []byte) error

func (*MsgDonateToEcosystemFundResponse) XXX_DiscardUnknown added in v0.15.0

func (m *MsgDonateToEcosystemFundResponse) XXX_DiscardUnknown()

func (*MsgDonateToEcosystemFundResponse) XXX_Marshal added in v0.15.0

func (m *MsgDonateToEcosystemFundResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgDonateToEcosystemFundResponse) XXX_Merge added in v0.15.0

func (*MsgDonateToEcosystemFundResponse) XXX_Size added in v0.15.0

func (m *MsgDonateToEcosystemFundResponse) XXX_Size() int

func (*MsgDonateToEcosystemFundResponse) XXX_Unmarshal added in v0.15.0

func (m *MsgDonateToEcosystemFundResponse) XXX_Unmarshal(b []byte) error

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) GetSignBytes added in v0.4.15

func (m MsgLiquidate) GetSignBytes() []byte

func (MsgLiquidate) GetSigners added in v0.4.15

func (m MsgLiquidate) GetSigners() []sdk.AccAddress

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) Route added in v0.4.15

func (m MsgLiquidate) Route() string

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) Type added in v0.4.15

func (m MsgLiquidate) Type() string

func (*MsgLiquidate) Unmarshal added in v0.2.3

func (m *MsgLiquidate) Unmarshal(dAtA []byte) error

func (MsgLiquidate) ValidateBasic added in v0.4.15

func (m MsgLiquidate) ValidateBasic() (err 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 {
	FeeToLiquidator        types.Coin `protobuf:"bytes,1,opt,name=fee_to_liquidator,json=feeToLiquidator,proto3" json:"fee_to_liquidator"`
	FeeToPerpEcosystemFund types.Coin `protobuf:"bytes,2,opt,name=fee_to_perp_ecosystem_fund,json=feeToPerpEcosystemFund,proto3" json:"fee_to_perp_ecosystem_fund"`
}

func (*MsgLiquidateResponse) Descriptor added in v0.2.3

func (*MsgLiquidateResponse) Descriptor() ([]byte, []int)

func (*MsgLiquidateResponse) GetFeeToLiquidator added in v0.3.2

func (m *MsgLiquidateResponse) GetFeeToLiquidator() types.Coin

func (*MsgLiquidateResponse) GetFeeToPerpEcosystemFund added in v0.3.2

func (m *MsgLiquidateResponse) GetFeeToPerpEcosystemFund() types.Coin

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 MsgMultiLiquidate added in v0.15.0

type MsgMultiLiquidate struct {
	Sender       string                                `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	Liquidations []*MsgMultiLiquidate_MultiLiquidation `protobuf:"bytes,2,rep,name=liquidations,proto3" json:"liquidations,omitempty"`
}

func (*MsgMultiLiquidate) Descriptor added in v0.15.0

func (*MsgMultiLiquidate) Descriptor() ([]byte, []int)

func (*MsgMultiLiquidate) GetLiquidations added in v0.15.0

func (m *MsgMultiLiquidate) GetLiquidations() []*MsgMultiLiquidate_MultiLiquidation

func (*MsgMultiLiquidate) GetSender added in v0.15.0

func (m *MsgMultiLiquidate) GetSender() string

func (*MsgMultiLiquidate) GetSigners added in v0.15.0

func (m *MsgMultiLiquidate) GetSigners() []sdk.AccAddress

func (*MsgMultiLiquidate) Marshal added in v0.15.0

func (m *MsgMultiLiquidate) Marshal() (dAtA []byte, err error)

func (*MsgMultiLiquidate) MarshalTo added in v0.15.0

func (m *MsgMultiLiquidate) MarshalTo(dAtA []byte) (int, error)

func (*MsgMultiLiquidate) MarshalToSizedBuffer added in v0.15.0

func (m *MsgMultiLiquidate) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgMultiLiquidate) ProtoMessage added in v0.15.0

func (*MsgMultiLiquidate) ProtoMessage()

func (*MsgMultiLiquidate) Reset added in v0.15.0

func (m *MsgMultiLiquidate) Reset()

func (*MsgMultiLiquidate) Size added in v0.15.0

func (m *MsgMultiLiquidate) Size() (n int)

func (*MsgMultiLiquidate) String added in v0.15.0

func (m *MsgMultiLiquidate) String() string

func (*MsgMultiLiquidate) Unmarshal added in v0.15.0

func (m *MsgMultiLiquidate) Unmarshal(dAtA []byte) error

func (*MsgMultiLiquidate) ValidateBasic added in v0.15.0

func (m *MsgMultiLiquidate) ValidateBasic() error

func (*MsgMultiLiquidate) XXX_DiscardUnknown added in v0.15.0

func (m *MsgMultiLiquidate) XXX_DiscardUnknown()

func (*MsgMultiLiquidate) XXX_Marshal added in v0.15.0

func (m *MsgMultiLiquidate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgMultiLiquidate) XXX_Merge added in v0.15.0

func (m *MsgMultiLiquidate) XXX_Merge(src proto.Message)

func (*MsgMultiLiquidate) XXX_Size added in v0.15.0

func (m *MsgMultiLiquidate) XXX_Size() int

func (*MsgMultiLiquidate) XXX_Unmarshal added in v0.15.0

func (m *MsgMultiLiquidate) XXX_Unmarshal(b []byte) error

type MsgMultiLiquidateResponse added in v0.15.0

type MsgMultiLiquidateResponse struct {
	LiquidationResponses []*MsgMultiLiquidateResponse_MultiLiquidateResponse `protobuf:"bytes,1,rep,name=liquidation_responses,json=liquidationResponses,proto3" json:"liquidation_responses,omitempty"`
}

func (*MsgMultiLiquidateResponse) Descriptor added in v0.15.0

func (*MsgMultiLiquidateResponse) Descriptor() ([]byte, []int)

func (*MsgMultiLiquidateResponse) GetLiquidationResponses added in v0.15.0

func (*MsgMultiLiquidateResponse) Marshal added in v0.15.0

func (m *MsgMultiLiquidateResponse) Marshal() (dAtA []byte, err error)

func (*MsgMultiLiquidateResponse) MarshalTo added in v0.15.0

func (m *MsgMultiLiquidateResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgMultiLiquidateResponse) MarshalToSizedBuffer added in v0.15.0

func (m *MsgMultiLiquidateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgMultiLiquidateResponse) ProtoMessage added in v0.15.0

func (*MsgMultiLiquidateResponse) ProtoMessage()

func (*MsgMultiLiquidateResponse) Reset added in v0.15.0

func (m *MsgMultiLiquidateResponse) Reset()

func (*MsgMultiLiquidateResponse) Size added in v0.15.0

func (m *MsgMultiLiquidateResponse) Size() (n int)

func (*MsgMultiLiquidateResponse) String added in v0.15.0

func (m *MsgMultiLiquidateResponse) String() string

func (*MsgMultiLiquidateResponse) Unmarshal added in v0.15.0

func (m *MsgMultiLiquidateResponse) Unmarshal(dAtA []byte) error

func (*MsgMultiLiquidateResponse) XXX_DiscardUnknown added in v0.15.0

func (m *MsgMultiLiquidateResponse) XXX_DiscardUnknown()

func (*MsgMultiLiquidateResponse) XXX_Marshal added in v0.15.0

func (m *MsgMultiLiquidateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgMultiLiquidateResponse) XXX_Merge added in v0.15.0

func (m *MsgMultiLiquidateResponse) XXX_Merge(src proto.Message)

func (*MsgMultiLiquidateResponse) XXX_Size added in v0.15.0

func (m *MsgMultiLiquidateResponse) XXX_Size() int

func (*MsgMultiLiquidateResponse) XXX_Unmarshal added in v0.15.0

func (m *MsgMultiLiquidateResponse) XXX_Unmarshal(b []byte) error

type MsgMultiLiquidateResponse_MultiLiquidateResponse added in v0.15.0

type MsgMultiLiquidateResponse_MultiLiquidateResponse struct {
	// Types that are valid to be assigned to Response:
	//	*MsgMultiLiquidateResponse_MultiLiquidateResponse_Error
	//	*MsgMultiLiquidateResponse_MultiLiquidateResponse_Liquidation
	Response isMsgMultiLiquidateResponse_MultiLiquidateResponse_Response `protobuf_oneof:"response"`
}

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) Descriptor added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) GetError added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) GetLiquidation added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) GetResponse added in v0.15.0

func (m *MsgMultiLiquidateResponse_MultiLiquidateResponse) GetResponse() isMsgMultiLiquidateResponse_MultiLiquidateResponse_Response

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) Marshal added in v0.15.0

func (m *MsgMultiLiquidateResponse_MultiLiquidateResponse) Marshal() (dAtA []byte, err error)

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) MarshalTo added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) MarshalToSizedBuffer added in v0.15.0

func (m *MsgMultiLiquidateResponse_MultiLiquidateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) ProtoMessage added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) Reset added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) Size added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) String added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) Unmarshal added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) XXX_DiscardUnknown added in v0.15.0

func (m *MsgMultiLiquidateResponse_MultiLiquidateResponse) XXX_DiscardUnknown()

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) XXX_Marshal added in v0.15.0

func (m *MsgMultiLiquidateResponse_MultiLiquidateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) XXX_Merge added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) XXX_OneofWrappers added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) XXX_Size added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse) XXX_Unmarshal added in v0.15.0

type MsgMultiLiquidateResponse_MultiLiquidateResponse_Error added in v0.15.0

type MsgMultiLiquidateResponse_MultiLiquidateResponse_Error struct {
	Error string `protobuf:"bytes,1,opt,name=error,proto3,oneof" json:"error,omitempty"`
}

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse_Error) MarshalTo added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse_Error) MarshalToSizedBuffer added in v0.15.0

func (m *MsgMultiLiquidateResponse_MultiLiquidateResponse_Error) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse_Error) Size added in v0.15.0

type MsgMultiLiquidateResponse_MultiLiquidateResponse_Liquidation added in v0.15.0

type MsgMultiLiquidateResponse_MultiLiquidateResponse_Liquidation struct {
	Liquidation *MsgLiquidateResponse `protobuf:"bytes,2,opt,name=liquidation,proto3,oneof" json:"liquidation,omitempty"`
}

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse_Liquidation) MarshalTo added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse_Liquidation) MarshalToSizedBuffer added in v0.15.0

func (*MsgMultiLiquidateResponse_MultiLiquidateResponse_Liquidation) Size added in v0.15.0

type MsgMultiLiquidate_MultiLiquidation added in v0.15.0

type MsgMultiLiquidate_MultiLiquidation struct {
	TokenPair string `protobuf:"bytes,2,opt,name=token_pair,json=tokenPair,proto3" json:"token_pair,omitempty"`
	Trader    string `protobuf:"bytes,3,opt,name=trader,proto3" json:"trader,omitempty"`
}

func (*MsgMultiLiquidate_MultiLiquidation) Descriptor added in v0.15.0

func (*MsgMultiLiquidate_MultiLiquidation) Descriptor() ([]byte, []int)

func (*MsgMultiLiquidate_MultiLiquidation) GetTokenPair added in v0.15.0

func (m *MsgMultiLiquidate_MultiLiquidation) GetTokenPair() string

func (*MsgMultiLiquidate_MultiLiquidation) GetTrader added in v0.15.0

func (*MsgMultiLiquidate_MultiLiquidation) Marshal added in v0.15.0

func (m *MsgMultiLiquidate_MultiLiquidation) Marshal() (dAtA []byte, err error)

func (*MsgMultiLiquidate_MultiLiquidation) MarshalTo added in v0.15.0

func (m *MsgMultiLiquidate_MultiLiquidation) MarshalTo(dAtA []byte) (int, error)

func (*MsgMultiLiquidate_MultiLiquidation) MarshalToSizedBuffer added in v0.15.0

func (m *MsgMultiLiquidate_MultiLiquidation) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgMultiLiquidate_MultiLiquidation) ProtoMessage added in v0.15.0

func (*MsgMultiLiquidate_MultiLiquidation) ProtoMessage()

func (*MsgMultiLiquidate_MultiLiquidation) Reset added in v0.15.0

func (*MsgMultiLiquidate_MultiLiquidation) Size added in v0.15.0

func (*MsgMultiLiquidate_MultiLiquidation) String added in v0.15.0

func (*MsgMultiLiquidate_MultiLiquidation) Unmarshal added in v0.15.0

func (m *MsgMultiLiquidate_MultiLiquidation) Unmarshal(dAtA []byte) error

func (*MsgMultiLiquidate_MultiLiquidation) XXX_DiscardUnknown added in v0.15.0

func (m *MsgMultiLiquidate_MultiLiquidation) XXX_DiscardUnknown()

func (*MsgMultiLiquidate_MultiLiquidation) XXX_Marshal added in v0.15.0

func (m *MsgMultiLiquidate_MultiLiquidation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgMultiLiquidate_MultiLiquidation) XXX_Merge added in v0.15.0

func (*MsgMultiLiquidate_MultiLiquidation) XXX_Size added in v0.15.0

func (*MsgMultiLiquidate_MultiLiquidation) XXX_Unmarshal added in v0.15.0

func (m *MsgMultiLiquidate_MultiLiquidation) 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) GetSignBytes added in v0.15.0

func (m MsgOpenPosition) GetSignBytes() []byte

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) Route added in v0.15.0

func (m MsgOpenPosition) Route() string

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) Type added in v0.15.0

func (m MsgOpenPosition) Type() 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 {
	Position *Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"`
	// The amount of quote assets exchanged.
	ExchangedNotionalValue github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */
	// The amount of base assets exchanged.
	ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */
	// The funding payment applied on this position change, measured in quote units.
	FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */
	// The amount of PnL realized on this position changed, measured in quote units.
	RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `` /* 134-byte string literal not displayed */
	// The unrealized PnL in the position after the position change, measured in quote units.
	UnrealizedPnlAfter github_com_cosmos_cosmos_sdk_types.Dec `` /* 157-byte string literal not displayed */
	// The amount of margin the trader has to give to the vault.
	// A negative value means the vault pays the trader.
	MarginToVault github_com_cosmos_cosmos_sdk_types.Dec `` /* 142-byte string literal not displayed */
	// The position's notional value after the position change, measured in quote units.
	PositionNotional github_com_cosmos_cosmos_sdk_types.Dec `` /* 149-byte string literal not displayed */
}

func (*MsgOpenPositionResponse) Descriptor added in v0.1.2

func (*MsgOpenPositionResponse) Descriptor() ([]byte, []int)

func (*MsgOpenPositionResponse) GetPosition added in v0.10.0

func (m *MsgOpenPositionResponse) GetPosition() *Position

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) MarshalTo

func (m *MsgRemoveMargin) MarshalTo(dAtA []byte) (int, 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 {
	// tokens transferred back to the trader
	MarginOut types.Coin `protobuf:"bytes,1,opt,name=margin_out,json=marginOut,proto3" json:"margin_out"`
	// the funding payment applied on this position interaction
	FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */
	// The resulting position
	Position *Position `protobuf:"bytes,3,opt,name=position,proto3" json:"position,omitempty"`
}

func (*MsgRemoveMarginResponse) Descriptor

func (*MsgRemoveMarginResponse) Descriptor() ([]byte, []int)

func (*MsgRemoveMarginResponse) GetMarginOut

func (m *MsgRemoveMarginResponse) GetMarginOut() types.Coin

func (*MsgRemoveMarginResponse) GetPosition added in v0.11.0

func (m *MsgRemoveMarginResponse) GetPosition() *Position

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)
	// Liquidate is a transaction that allows the caller to fully or partially
	// liquidate an existing position.
	Liquidate(context.Context, *MsgLiquidate) (*MsgLiquidateResponse, error)
	MultiLiquidate(context.Context, *MsgMultiLiquidate) (*MsgMultiLiquidateResponse, error)
	OpenPosition(context.Context, *MsgOpenPosition) (*MsgOpenPositionResponse, error)
	ClosePosition(context.Context, *MsgClosePosition) (*MsgClosePositionResponse, error)
	DonateToEcosystemFund(context.Context, *MsgDonateToEcosystemFund) (*MsgDonateToEcosystemFundResponse, error)
}

MsgServer is the server API for Msg service.

type PairMetadata

type PairMetadata struct {
	Pair common.AssetPair `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair"`
	// The historical list of cumulative premium fractions for a given pair.
	// Calculated once per epoch.
	// A premium fraction is the difference between mark and index, divided by the number of payments per day.
	// (mark - index) / # payments in a day
	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() common.AssetPair

func (*PairMetadata) Marshal

func (m *PairMetadata) Marshal() (dAtA []byte, err error)

func (*PairMetadata) MarshalTo

func (m *PairMetadata) MarshalTo(dAtA []byte) (int, 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) Validate added in v0.15.0

func (m *PairMetadata) Validate() 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"`
	// FeePoolFeeRatio is the ratio transferred to the the fee pool
	FeePoolFeeRatio github_com_cosmos_cosmos_sdk_types.Dec `` /* 150-byte string literal not displayed */
	// EcosystemFundFeeRatio is the ratio transferred to the PerpEF.
	EcosystemFundFeeRatio github_com_cosmos_cosmos_sdk_types.Dec `` /* 168-byte string literal not displayed */
	// LiquidationFeeRatio 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.
	LiquidationFeeRatio github_com_cosmos_cosmos_sdk_types.Dec `` /* 160-byte string literal not displayed */
	// PartialLiquidationRatio is the share we try to liquidate if the margin is
	// higher than liquidation fee
	PartialLiquidationRatio github_com_cosmos_cosmos_sdk_types.Dec `` /* 172-byte string literal not displayed */
	// specifies the interval on which the funding rate is updated
	FundingRateInterval string `protobuf:"bytes,7,opt,name=funding_rate_interval,json=fundingRateInterval,proto3" json:"funding_rate_interval,omitempty"`
	// amount of time to look back for TWAP calculations
	TwapLookbackWindow time.Duration `` /* 157-byte string literal not displayed */
	// whitelisted_liquidators defines the list of addresses
	// which are allowed to liquidate a position.
	WhitelistedLiquidators []string `` /* 127-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,
	feePoolFeeRatio sdk.Dec,
	ecosystemFundFeeRatio sdk.Dec,
	liquidationFeeRatio sdk.Dec,
	partialLiquidationRatio sdk.Dec,
	fundingRateInterval string,
	twapLookbackWindow time.Duration,
) Params

NewParams creates a new Params instance

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetFundingRateInterval added in v0.11.0

func (m *Params) GetFundingRateInterval() string

func (*Params) GetStopped

func (m *Params) GetStopped() bool

func (*Params) GetTwapLookbackWindow added in v0.7.2

func (m *Params) GetTwapLookbackWindow() time.Duration

func (*Params) GetWhitelistedLiquidators added in v0.15.0

func (m *Params) GetWhitelistedLiquidators() []string

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs get the params.ParamSet

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (*Params) Validate

func (p *Params) Validate() error

Validate validates the set of params

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type PnLCalcOption

type PnLCalcOption int32
const (
	PnLCalcOption_PNL_CALC_OPTION_UNSPECIFIED PnLCalcOption = 0
	PnLCalcOption_SPOT_PRICE                  PnLCalcOption = 1
	PnLCalcOption_TWAP                        PnLCalcOption = 2
	PnLCalcOption_ORACLE                      PnLCalcOption = 3
)

func (PnLCalcOption) EnumDescriptor

func (PnLCalcOption) EnumDescriptor() ([]byte, []int)

func (PnLCalcOption) String

func (x PnLCalcOption) String() string

type PnLPreferenceOption

type PnLPreferenceOption int32
const (
	PnLPreferenceOption_PNL_PREFERENCE_UNSPECIFIED PnLPreferenceOption = 0
	PnLPreferenceOption_MAX                        PnLPreferenceOption = 1
	PnLPreferenceOption_MIN                        PnLPreferenceOption = 2
)

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
	TraderAddress string `protobuf:"bytes,1,opt,name=trader_address,json=traderAddress,proto3" json:"trader_address,omitempty"`
	// pair identifies the pair associated with this position
	Pair common.AssetPair `protobuf:"bytes,2,opt,name=pair,proto3" json:"pair"`
	// Position size.
	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"`
	// Amount of margin remaining in the position.
	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.
	// Used to calculate PnL.
	OpenNotional github_com_cosmos_cosmos_sdk_types.Dec `` /* 137-byte string literal not displayed */
	// The most recent cumulative premium fraction this position has.
	// Used to calculate the next funding payment.
	LatestCumulativePremiumFraction github_com_cosmos_cosmos_sdk_types.Dec `` /* 198-byte string literal not displayed */
	// BlockNumber is the last block number when this position was updated.
	BlockNumber int64 `protobuf:"varint,7,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 ZeroPosition(ctx sdk.Context, tokenPair common.AssetPair, traderAddr sdk.AccAddress) Position

func (*Position) Descriptor

func (*Position) Descriptor() ([]byte, []int)

func (*Position) GetBlockNumber

func (m *Position) GetBlockNumber() int64

func (*Position) GetPair

func (m *Position) GetPair() common.AssetPair

func (*Position) GetTraderAddress added in v0.3.1

func (m *Position) GetTraderAddress() string

func (*Position) Marshal

func (m *Position) Marshal() (dAtA []byte, err error)

func (*Position) MarshalTo

func (m *Position) MarshalTo(dAtA []byte) (int, error)

func (*Position) MarshalToSizedBuffer

func (m *Position) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Position) ProtoMessage

func (*Position) ProtoMessage()

func (*Position) Reset

func (m *Position) Reset()

func (*Position) Size

func (m *Position) Size() (n int)

func (*Position) String

func (m *Position) String() string

func (*Position) Unmarshal

func (m *Position) Unmarshal(dAtA []byte) error

func (*Position) Validate added in v0.15.0

func (m *Position) Validate() error

func (*Position) XXX_DiscardUnknown

func (m *Position) XXX_DiscardUnknown()

func (*Position) XXX_Marshal

func (m *Position) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Position) XXX_Merge

func (m *Position) XXX_Merge(src proto.Message)

func (*Position) XXX_Size

func (m *Position) XXX_Size() int

func (*Position) XXX_Unmarshal

func (m *Position) XXX_Unmarshal(b []byte) error

type PositionChangedEvent

type PositionChangedEvent struct {
	// identifier of the corresponding virtual pool for the position
	Pair string `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"`
	// owner of the position.
	TraderAddress string `protobuf:"bytes,2,opt,name=trader_address,json=traderAddress,proto3" json:"trader_address,omitempty"`
	// amount of margin backing the position.
	Margin types.Coin `protobuf:"bytes,3,opt,name=margin,proto3" json:"margin" yaml:"margin"`
	// margin * leverage * vPrice. 'notional' is the virtual size times the virtual price on 'vpool'.
	PositionNotional github_com_cosmos_cosmos_sdk_types.Dec `` /* 149-byte string literal not displayed */
	// magnitude of the change to vsize. The vsize is the amount of base assets for the position, margin * leverage * priceBasePerQuote.
	ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */
	// transaction fee paid
	TransactionFee types.Coin `protobuf:"bytes,6,opt,name=transaction_fee,json=transactionFee,proto3" json:"transaction_fee" yaml:"transaction_fee"`
	// position virtual size after the change
	PositionSize github_com_cosmos_cosmos_sdk_types.Dec `` /* 137-byte string literal not displayed */
	// realize profits and losses after the change
	RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `` /* 134-byte string literal not displayed */
	// unrealized profits and losses after the change
	UnrealizedPnlAfter github_com_cosmos_cosmos_sdk_types.Dec `` /* 157-byte string literal not displayed */
	// Amount of bad debt cleared by the PerpEF during the change.
	// Bad debt is negative net margin past the liquidation point of a position.
	BadDebt types.Coin `protobuf:"bytes,10,opt,name=bad_debt,json=badDebt,proto3" json:"bad_debt"`
	// amt of margin (y) lost due to liquidation
	LiquidationPenalty github_com_cosmos_cosmos_sdk_types.Dec `` /* 156-byte string literal not displayed */
	// Mark price, synonymous with mark price in this context, is the quotient of
	// the quote reserves and base reserves
	MarkPrice github_com_cosmos_cosmos_sdk_types.Dec `` /* 129-byte string literal not displayed */
	// A funding payment made or received by the trader on the current position.
	// 'fundingPayment' is positive if 'owner' is the sender and negative if 'owner'
	// is the receiver of the payment. Its magnitude is abs(vSize * fundingRate).
	// Funding payments act to converge the mark price (vPrice) and index price
	// (average price on major exchanges).
	FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `` /* 144-byte string literal not displayed */
	// The block number at which this position was changed.
	BlockHeight int64 `protobuf:"varint,14,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	// The block time in unix milliseconds at which this position was changed.
	BlockTimeMs int64 `protobuf:"varint,15,opt,name=block_time_ms,json=blockTimeMs,proto3" json:"block_time_ms,omitempty"`
}

Emitted when a position changes. TODO: Is there a way to split this into different events without creating too much complexity?

func (*PositionChangedEvent) Descriptor

func (*PositionChangedEvent) Descriptor() ([]byte, []int)

func (*PositionChangedEvent) GetBadDebt added in v0.9.1

func (m *PositionChangedEvent) GetBadDebt() types.Coin

func (*PositionChangedEvent) GetBlockHeight added in v0.5.1

func (m *PositionChangedEvent) GetBlockHeight() int64

func (*PositionChangedEvent) GetBlockTimeMs added in v0.5.1

func (m *PositionChangedEvent) GetBlockTimeMs() int64

func (*PositionChangedEvent) GetMargin added in v0.5.0

func (m *PositionChangedEvent) GetMargin() types.Coin

func (*PositionChangedEvent) GetPair

func (m *PositionChangedEvent) GetPair() string

func (*PositionChangedEvent) GetTraderAddress added in v0.3.1

func (m *PositionChangedEvent) GetTraderAddress() string

func (*PositionChangedEvent) GetTransactionFee added in v0.5.0

func (m *PositionChangedEvent) GetTransactionFee() types.Coin

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 PositionLiquidatedEvent added in v0.5.0

type PositionLiquidatedEvent struct {
	// identifier of the corresponding virtual pool for the position
	Pair string `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"`
	// owner of the position.
	TraderAddress string `protobuf:"bytes,2,opt,name=trader_address,json=traderAddress,proto3" json:"trader_address,omitempty"`
	// margin * leverage * vPrice. 'notional' is the virtual size times  the virtual price on 'vpool'.
	ExchangedQuoteAmount github_com_cosmos_cosmos_sdk_types.Dec `` /* 163-byte string literal not displayed */
	// virtual amount of base assets for the position, which would be margin * leverage * priceBasePerQuote.
	ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */
	// Address of the account that executed the tx.
	LiquidatorAddress string `protobuf:"bytes,5,opt,name=liquidator_address,json=liquidatorAddress,proto3" json:"liquidator_address,omitempty"`
	// Commission (in margin units) received by 'liquidator'.
	FeeToLiquidator types.Coin `protobuf:"bytes,6,opt,name=fee_to_liquidator,json=feeToLiquidator,proto3" json:"fee_to_liquidator" yaml:"fee_to_liquidator"`
	// Commission (in margin units) given to the ecosystem fund.
	FeeToEcosystemFund types.Coin `` /* 138-byte string literal not displayed */
	//  Bad debt (margin units) cleared by the PerpEF during the tx. Bad debt is negative net margin past the liquidation point of a position.
	BadDebt types.Coin `protobuf:"bytes,8,opt,name=bad_debt,json=badDebt,proto3" json:"bad_debt"`
	// Remaining margin in the position after liquidation
	Margin types.Coin `protobuf:"bytes,9,opt,name=margin,proto3" json:"margin" yaml:"margin"`
	// Remaining position notional in the position after liquidation
	PositionNotional github_com_cosmos_cosmos_sdk_types.Dec `` /* 150-byte string literal not displayed */
	// Remaining position size in the position after liquidation
	PositionSize github_com_cosmos_cosmos_sdk_types.Dec `` /* 138-byte string literal not displayed */
	// Unrealized PnL in the position after liquidation
	UnrealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,12,opt,name=unrealizedPnl,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"unrealizedPnl"`
	// Spot price of the vAMM after liquidation
	MarkPrice github_com_cosmos_cosmos_sdk_types.Dec `` /* 129-byte string literal not displayed */
	// The block number at which this liquidation occured.
	BlockHeight int64 `protobuf:"varint,14,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	// The unix timestamp in milliseconds at which this liquidation occured.
	BlockTimeMs int64 `protobuf:"varint,15,opt,name=block_time_ms,json=blockTimeMs,proto3" json:"block_time_ms,omitempty"`
}

Emitted when a position is liquidated.

func (*PositionLiquidatedEvent) Descriptor added in v0.5.0

func (*PositionLiquidatedEvent) Descriptor() ([]byte, []int)

func (*PositionLiquidatedEvent) GetBadDebt added in v0.9.1

func (m *PositionLiquidatedEvent) GetBadDebt() types.Coin

func (*PositionLiquidatedEvent) GetBlockHeight added in v0.5.1

func (m *PositionLiquidatedEvent) GetBlockHeight() int64

func (*PositionLiquidatedEvent) GetBlockTimeMs added in v0.5.1

func (m *PositionLiquidatedEvent) GetBlockTimeMs() int64

func (*PositionLiquidatedEvent) GetFeeToEcosystemFund added in v0.5.0

func (m *PositionLiquidatedEvent) GetFeeToEcosystemFund() types.Coin

func (*PositionLiquidatedEvent) GetFeeToLiquidator added in v0.5.0

func (m *PositionLiquidatedEvent) GetFeeToLiquidator() types.Coin

func (*PositionLiquidatedEvent) GetLiquidatorAddress added in v0.5.0

func (m *PositionLiquidatedEvent) GetLiquidatorAddress() string

func (*PositionLiquidatedEvent) GetMargin added in v0.5.1

func (m *PositionLiquidatedEvent) GetMargin() types.Coin

func (*PositionLiquidatedEvent) GetPair added in v0.5.0

func (m *PositionLiquidatedEvent) GetPair() string

func (*PositionLiquidatedEvent) GetTraderAddress added in v0.5.0

func (m *PositionLiquidatedEvent) GetTraderAddress() string

func (*PositionLiquidatedEvent) Marshal added in v0.5.0

func (m *PositionLiquidatedEvent) Marshal() (dAtA []byte, err error)

func (*PositionLiquidatedEvent) MarshalTo added in v0.5.0

func (m *PositionLiquidatedEvent) MarshalTo(dAtA []byte) (int, error)

func (*PositionLiquidatedEvent) MarshalToSizedBuffer added in v0.5.0

func (m *PositionLiquidatedEvent) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PositionLiquidatedEvent) ProtoMessage added in v0.5.0

func (*PositionLiquidatedEvent) ProtoMessage()

func (*PositionLiquidatedEvent) Reset added in v0.5.0

func (m *PositionLiquidatedEvent) Reset()

func (*PositionLiquidatedEvent) Size added in v0.5.0

func (m *PositionLiquidatedEvent) Size() (n int)

func (*PositionLiquidatedEvent) String added in v0.5.0

func (m *PositionLiquidatedEvent) String() string

func (*PositionLiquidatedEvent) Unmarshal added in v0.5.0

func (m *PositionLiquidatedEvent) Unmarshal(dAtA []byte) error

func (*PositionLiquidatedEvent) XXX_DiscardUnknown added in v0.5.0

func (m *PositionLiquidatedEvent) XXX_DiscardUnknown()

func (*PositionLiquidatedEvent) XXX_Marshal added in v0.5.0

func (m *PositionLiquidatedEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PositionLiquidatedEvent) XXX_Merge added in v0.5.0

func (m *PositionLiquidatedEvent) XXX_Merge(src proto.Message)

func (*PositionLiquidatedEvent) XXX_Size added in v0.5.0

func (m *PositionLiquidatedEvent) XXX_Size() int

func (*PositionLiquidatedEvent) XXX_Unmarshal added in v0.5.0

func (m *PositionLiquidatedEvent) XXX_Unmarshal(b []byte) error

type PositionResp

type PositionResp struct {
	Position *Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"`
	// The amount of quote assets exchanged.
	ExchangedNotionalValue github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */
	// The amount of base assets exchanged.
	ExchangedPositionSize github_com_cosmos_cosmos_sdk_types.Dec `` /* 166-byte string literal not displayed */
	// The amount of bad debt accrued during this position change.
	// Measured in absolute value of quote units.
	// If greater than zero, then the position change event will likely fail.
	BadDebt github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=bad_debt,json=badDebt,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"bad_debt"`
	// The funding payment applied on this position change.
	FundingPayment github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */
	// The amount of PnL realized on this position changed, measured in quote
	// units.
	RealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `` /* 134-byte string literal not displayed */
	// The unrealized PnL in the position after the position change.
	UnrealizedPnlAfter github_com_cosmos_cosmos_sdk_types.Dec `` /* 157-byte string literal not displayed */
	// The amount of margin the trader has to give to the vault.
	// A negative value means the vault pays the trader.
	MarginToVault github_com_cosmos_cosmos_sdk_types.Dec `` /* 142-byte string literal not displayed */
	// The position's notional value after the position change, measured in quote
	// units.
	PositionNotional github_com_cosmos_cosmos_sdk_types.Dec `` /* 149-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) MarshalTo

func (m *PositionResp) MarshalTo(dAtA []byte) (int, 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 PositionSettledEvent added in v0.5.0

type PositionSettledEvent struct {
	// Identifier for the virtual pool of the position.
	Pair string `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"`
	// Owner of the position.
	TraderAddress string `protobuf:"bytes,2,opt,name=trader_address,json=traderAddress,proto3" json:"trader_address,omitempty"`
	// Settled coin as dictated by the settlement price of the vpool.
	SettledCoins github_com_cosmos_cosmos_sdk_types.Coins `` /* 162-byte string literal not displayed */
}

Emitted when a position is settled.

func (*PositionSettledEvent) Descriptor added in v0.5.0

func (*PositionSettledEvent) Descriptor() ([]byte, []int)

func (*PositionSettledEvent) GetPair added in v0.5.0

func (m *PositionSettledEvent) GetPair() string

func (*PositionSettledEvent) GetSettledCoins added in v0.5.0

func (*PositionSettledEvent) GetTraderAddress added in v0.5.0

func (m *PositionSettledEvent) GetTraderAddress() string

func (*PositionSettledEvent) Marshal added in v0.5.0

func (m *PositionSettledEvent) Marshal() (dAtA []byte, err error)

func (*PositionSettledEvent) MarshalTo added in v0.5.0

func (m *PositionSettledEvent) MarshalTo(dAtA []byte) (int, error)

func (*PositionSettledEvent) MarshalToSizedBuffer added in v0.5.0

func (m *PositionSettledEvent) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PositionSettledEvent) ProtoMessage added in v0.5.0

func (*PositionSettledEvent) ProtoMessage()

func (*PositionSettledEvent) Reset added in v0.5.0

func (m *PositionSettledEvent) Reset()

func (*PositionSettledEvent) Size added in v0.5.0

func (m *PositionSettledEvent) Size() (n int)

func (*PositionSettledEvent) String added in v0.5.0

func (m *PositionSettledEvent) String() string

func (*PositionSettledEvent) Unmarshal added in v0.5.0

func (m *PositionSettledEvent) Unmarshal(dAtA []byte) error

func (*PositionSettledEvent) XXX_DiscardUnknown added in v0.5.0

func (m *PositionSettledEvent) XXX_DiscardUnknown()

func (*PositionSettledEvent) XXX_Marshal added in v0.5.0

func (m *PositionSettledEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PositionSettledEvent) XXX_Merge added in v0.5.0

func (m *PositionSettledEvent) XXX_Merge(src proto.Message)

func (*PositionSettledEvent) XXX_Size added in v0.5.0

func (m *PositionSettledEvent) XXX_Size() int

func (*PositionSettledEvent) XXX_Unmarshal added in v0.5.0

func (m *PositionSettledEvent) XXX_Unmarshal(b []byte) error

type PrepaidBadDebt added in v0.5.0

type PrepaidBadDebt struct {
	Denom  string                                 `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
	Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"`
}

func (*PrepaidBadDebt) Descriptor added in v0.5.0

func (*PrepaidBadDebt) Descriptor() ([]byte, []int)

func (*PrepaidBadDebt) GetDenom added in v0.5.0

func (m *PrepaidBadDebt) GetDenom() string

func (*PrepaidBadDebt) Marshal added in v0.5.0

func (m *PrepaidBadDebt) Marshal() (dAtA []byte, err error)

func (*PrepaidBadDebt) MarshalTo added in v0.5.0

func (m *PrepaidBadDebt) MarshalTo(dAtA []byte) (int, error)

func (*PrepaidBadDebt) MarshalToSizedBuffer added in v0.5.0

func (m *PrepaidBadDebt) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PrepaidBadDebt) ProtoMessage added in v0.5.0

func (*PrepaidBadDebt) ProtoMessage()

func (*PrepaidBadDebt) Reset added in v0.5.0

func (m *PrepaidBadDebt) Reset()

func (*PrepaidBadDebt) Size added in v0.5.0

func (m *PrepaidBadDebt) Size() (n int)

func (*PrepaidBadDebt) String added in v0.5.0

func (m *PrepaidBadDebt) String() string

func (*PrepaidBadDebt) Unmarshal added in v0.5.0

func (m *PrepaidBadDebt) Unmarshal(dAtA []byte) error

func (*PrepaidBadDebt) Validate added in v0.15.0

func (m *PrepaidBadDebt) Validate() error

func (*PrepaidBadDebt) XXX_DiscardUnknown added in v0.5.0

func (m *PrepaidBadDebt) XXX_DiscardUnknown()

func (*PrepaidBadDebt) XXX_Marshal added in v0.5.0

func (m *PrepaidBadDebt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrepaidBadDebt) XXX_Merge added in v0.5.0

func (m *PrepaidBadDebt) XXX_Merge(src proto.Message)

func (*PrepaidBadDebt) XXX_Size added in v0.5.0

func (m *PrepaidBadDebt) XXX_Size() int

func (*PrepaidBadDebt) XXX_Unmarshal added in v0.5.0

func (m *PrepaidBadDebt) XXX_Unmarshal(b []byte) error

type PricefeedKeeper added in v0.2.9

type PricefeedKeeper interface {
	GetCurrentPrice(ctx sdk.Context, token0 string, token1 string) (pftypes.CurrentPrice, error)
	GatherRawPrices(ctx sdk.Context, token0 string, token1 string) error
	IsActivePair(ctx sdk.Context, pairID string) bool
	GetCurrentTWAP(ctx sdk.Context, token0 string, token1 string) (sdk.Dec, 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)
	QueryPosition(ctx context.Context, in *QueryPositionRequest, opts ...grpc.CallOption) (*QueryPositionResponse, error)
	QueryPositions(ctx context.Context, in *QueryPositionsRequest, opts ...grpc.CallOption) (*QueryPositionsResponse, error)
	FundingRates(ctx context.Context, in *QueryFundingRatesRequest, opts ...grpc.CallOption) (*QueryFundingRatesResponse, 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 QueryFundingRatesRequest added in v0.15.0

type QueryFundingRatesRequest struct {
	// the pair to query for
	Pair string `protobuf:"bytes,1,opt,name=pair,proto3" json:"pair,omitempty"`
}

func (*QueryFundingRatesRequest) Descriptor added in v0.15.0

func (*QueryFundingRatesRequest) Descriptor() ([]byte, []int)

func (*QueryFundingRatesRequest) GetPair added in v0.15.0

func (m *QueryFundingRatesRequest) GetPair() string

func (*QueryFundingRatesRequest) Marshal added in v0.15.0

func (m *QueryFundingRatesRequest) Marshal() (dAtA []byte, err error)

func (*QueryFundingRatesRequest) MarshalTo added in v0.15.0

func (m *QueryFundingRatesRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryFundingRatesRequest) MarshalToSizedBuffer added in v0.15.0

func (m *QueryFundingRatesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryFundingRatesRequest) ProtoMessage added in v0.15.0

func (*QueryFundingRatesRequest) ProtoMessage()

func (*QueryFundingRatesRequest) Reset added in v0.15.0

func (m *QueryFundingRatesRequest) Reset()

func (*QueryFundingRatesRequest) Size added in v0.15.0

func (m *QueryFundingRatesRequest) Size() (n int)

func (*QueryFundingRatesRequest) String added in v0.15.0

func (m *QueryFundingRatesRequest) String() string

func (*QueryFundingRatesRequest) Unmarshal added in v0.15.0

func (m *QueryFundingRatesRequest) Unmarshal(dAtA []byte) error

func (*QueryFundingRatesRequest) XXX_DiscardUnknown added in v0.15.0

func (m *QueryFundingRatesRequest) XXX_DiscardUnknown()

func (*QueryFundingRatesRequest) XXX_Marshal added in v0.15.0

func (m *QueryFundingRatesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryFundingRatesRequest) XXX_Merge added in v0.15.0

func (m *QueryFundingRatesRequest) XXX_Merge(src proto.Message)

func (*QueryFundingRatesRequest) XXX_Size added in v0.15.0

func (m *QueryFundingRatesRequest) XXX_Size() int

func (*QueryFundingRatesRequest) XXX_Unmarshal added in v0.15.0

func (m *QueryFundingRatesRequest) XXX_Unmarshal(b []byte) error

type QueryFundingRatesResponse added in v0.15.0

type QueryFundingRatesResponse struct {
	// a historical list of cumulative funding rates, with the most recent one
	// last
	CumulativeFundingRates []github_com_cosmos_cosmos_sdk_types.Dec `` /* 169-byte string literal not displayed */
}

func (*QueryFundingRatesResponse) Descriptor added in v0.15.0

func (*QueryFundingRatesResponse) Descriptor() ([]byte, []int)

func (*QueryFundingRatesResponse) Marshal added in v0.15.0

func (m *QueryFundingRatesResponse) Marshal() (dAtA []byte, err error)

func (*QueryFundingRatesResponse) MarshalTo added in v0.15.0

func (m *QueryFundingRatesResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryFundingRatesResponse) MarshalToSizedBuffer added in v0.15.0

func (m *QueryFundingRatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryFundingRatesResponse) ProtoMessage added in v0.15.0

func (*QueryFundingRatesResponse) ProtoMessage()

func (*QueryFundingRatesResponse) Reset added in v0.15.0

func (m *QueryFundingRatesResponse) Reset()

func (*QueryFundingRatesResponse) Size added in v0.15.0

func (m *QueryFundingRatesResponse) Size() (n int)

func (*QueryFundingRatesResponse) String added in v0.15.0

func (m *QueryFundingRatesResponse) String() string

func (*QueryFundingRatesResponse) Unmarshal added in v0.15.0

func (m *QueryFundingRatesResponse) Unmarshal(dAtA []byte) error

func (*QueryFundingRatesResponse) XXX_DiscardUnknown added in v0.15.0

func (m *QueryFundingRatesResponse) XXX_DiscardUnknown()

func (*QueryFundingRatesResponse) XXX_Marshal added in v0.15.0

func (m *QueryFundingRatesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryFundingRatesResponse) XXX_Merge added in v0.15.0

func (m *QueryFundingRatesResponse) XXX_Merge(src proto.Message)

func (*QueryFundingRatesResponse) XXX_Size added in v0.15.0

func (m *QueryFundingRatesResponse) XXX_Size() int

func (*QueryFundingRatesResponse) XXX_Unmarshal added in v0.15.0

func (m *QueryFundingRatesResponse) XXX_Unmarshal(b []byte) error

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 QueryPositionRequest added in v0.15.0

type QueryPositionRequest struct {
	TokenPair string `protobuf:"bytes,1,opt,name=token_pair,json=tokenPair,proto3" json:"token_pair,omitempty"`
	Trader    string `protobuf:"bytes,2,opt,name=trader,proto3" json:"trader,omitempty"`
}

QueryPositionRequest is the request type for the position of the x/perp module account.

func (*QueryPositionRequest) Descriptor added in v0.15.0

func (*QueryPositionRequest) Descriptor() ([]byte, []int)

func (*QueryPositionRequest) GetTokenPair added in v0.15.0

func (m *QueryPositionRequest) GetTokenPair() string

func (*QueryPositionRequest) GetTrader added in v0.15.0

func (m *QueryPositionRequest) GetTrader() string

func (*QueryPositionRequest) Marshal added in v0.15.0

func (m *QueryPositionRequest) Marshal() (dAtA []byte, err error)

func (*QueryPositionRequest) MarshalTo added in v0.15.0

func (m *QueryPositionRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryPositionRequest) MarshalToSizedBuffer added in v0.15.0

func (m *QueryPositionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPositionRequest) ProtoMessage added in v0.15.0

func (*QueryPositionRequest) ProtoMessage()

func (*QueryPositionRequest) Reset added in v0.15.0

func (m *QueryPositionRequest) Reset()

func (*QueryPositionRequest) Size added in v0.15.0

func (m *QueryPositionRequest) Size() (n int)

func (*QueryPositionRequest) String added in v0.15.0

func (m *QueryPositionRequest) String() string

func (*QueryPositionRequest) Unmarshal added in v0.15.0

func (m *QueryPositionRequest) Unmarshal(dAtA []byte) error

func (*QueryPositionRequest) XXX_DiscardUnknown added in v0.15.0

func (m *QueryPositionRequest) XXX_DiscardUnknown()

func (*QueryPositionRequest) XXX_Marshal added in v0.15.0

func (m *QueryPositionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPositionRequest) XXX_Merge added in v0.15.0

func (m *QueryPositionRequest) XXX_Merge(src proto.Message)

func (*QueryPositionRequest) XXX_Size added in v0.15.0

func (m *QueryPositionRequest) XXX_Size() int

func (*QueryPositionRequest) XXX_Unmarshal added in v0.15.0

func (m *QueryPositionRequest) XXX_Unmarshal(b []byte) error

type QueryPositionResponse added in v0.15.0

type QueryPositionResponse struct {
	// The position as it exists in the blockchain state
	Position *Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"`
	// The position's current notional value, if it were to be entirely closed (in
	// margin units).
	PositionNotional github_com_cosmos_cosmos_sdk_types.Dec `` /* 149-byte string literal not displayed */
	// The position's unrealized PnL.
	UnrealizedPnl github_com_cosmos_cosmos_sdk_types.Dec `` /* 140-byte string literal not displayed */
	// margin ratio of the position based on the mark price, mark TWAP. The higher
	// value of the possible margin ratios (TWAP and instantaneous) is taken to be
	// 'marginRatioMark'. Calculated from margin, unrealized PnL, and position
	// notional.
	MarginRatioMark github_com_cosmos_cosmos_sdk_types.Dec `` /* 148-byte string literal not displayed */
	// margin ratio of the position based on the index price. Calculated from
	// margin, unrealized PnL, and position notional.
	MarginRatioIndex github_com_cosmos_cosmos_sdk_types.Dec `` /* 151-byte string literal not displayed */
	// BlockNumber is current block number at the time of query.
	BlockNumber int64 `protobuf:"varint,7,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"`
}

func (*QueryPositionResponse) Descriptor added in v0.15.0

func (*QueryPositionResponse) Descriptor() ([]byte, []int)

func (*QueryPositionResponse) GetBlockNumber added in v0.15.0

func (m *QueryPositionResponse) GetBlockNumber() int64

func (*QueryPositionResponse) GetPosition added in v0.15.0

func (m *QueryPositionResponse) GetPosition() *Position

func (*QueryPositionResponse) Marshal added in v0.15.0

func (m *QueryPositionResponse) Marshal() (dAtA []byte, err error)

func (*QueryPositionResponse) MarshalTo added in v0.15.0

func (m *QueryPositionResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryPositionResponse) MarshalToSizedBuffer added in v0.15.0

func (m *QueryPositionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPositionResponse) ProtoMessage added in v0.15.0

func (*QueryPositionResponse) ProtoMessage()

func (*QueryPositionResponse) Reset added in v0.15.0

func (m *QueryPositionResponse) Reset()

func (*QueryPositionResponse) Size added in v0.15.0

func (m *QueryPositionResponse) Size() (n int)

func (*QueryPositionResponse) String added in v0.15.0

func (m *QueryPositionResponse) String() string

func (*QueryPositionResponse) Unmarshal added in v0.15.0

func (m *QueryPositionResponse) Unmarshal(dAtA []byte) error

func (*QueryPositionResponse) XXX_DiscardUnknown added in v0.15.0

func (m *QueryPositionResponse) XXX_DiscardUnknown()

func (*QueryPositionResponse) XXX_Marshal added in v0.15.0

func (m *QueryPositionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPositionResponse) XXX_Merge added in v0.15.0

func (m *QueryPositionResponse) XXX_Merge(src proto.Message)

func (*QueryPositionResponse) XXX_Size added in v0.15.0

func (m *QueryPositionResponse) XXX_Size() int

func (*QueryPositionResponse) XXX_Unmarshal added in v0.15.0

func (m *QueryPositionResponse) XXX_Unmarshal(b []byte) error

type QueryPositionsRequest added in v0.15.0

type QueryPositionsRequest struct {
	Trader string `protobuf:"bytes,1,opt,name=trader,proto3" json:"trader,omitempty"`
}

---------------------------------------- Positions

func (*QueryPositionsRequest) Descriptor added in v0.15.0

func (*QueryPositionsRequest) Descriptor() ([]byte, []int)

func (*QueryPositionsRequest) GetTrader added in v0.15.0

func (m *QueryPositionsRequest) GetTrader() string

func (*QueryPositionsRequest) Marshal added in v0.15.0

func (m *QueryPositionsRequest) Marshal() (dAtA []byte, err error)

func (*QueryPositionsRequest) MarshalTo added in v0.15.0

func (m *QueryPositionsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryPositionsRequest) MarshalToSizedBuffer added in v0.15.0

func (m *QueryPositionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPositionsRequest) ProtoMessage added in v0.15.0

func (*QueryPositionsRequest) ProtoMessage()

func (*QueryPositionsRequest) Reset added in v0.15.0

func (m *QueryPositionsRequest) Reset()

func (*QueryPositionsRequest) Size added in v0.15.0

func (m *QueryPositionsRequest) Size() (n int)

func (*QueryPositionsRequest) String added in v0.15.0

func (m *QueryPositionsRequest) String() string

func (*QueryPositionsRequest) Unmarshal added in v0.15.0

func (m *QueryPositionsRequest) Unmarshal(dAtA []byte) error

func (*QueryPositionsRequest) XXX_DiscardUnknown added in v0.15.0

func (m *QueryPositionsRequest) XXX_DiscardUnknown()

func (*QueryPositionsRequest) XXX_Marshal added in v0.15.0

func (m *QueryPositionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPositionsRequest) XXX_Merge added in v0.15.0

func (m *QueryPositionsRequest) XXX_Merge(src proto.Message)

func (*QueryPositionsRequest) XXX_Size added in v0.15.0

func (m *QueryPositionsRequest) XXX_Size() int

func (*QueryPositionsRequest) XXX_Unmarshal added in v0.15.0

func (m *QueryPositionsRequest) XXX_Unmarshal(b []byte) error

type QueryPositionsResponse added in v0.15.0

type QueryPositionsResponse struct {
	Positions []*QueryPositionResponse `protobuf:"bytes,1,rep,name=positions,proto3" json:"positions,omitempty"`
}

func (*QueryPositionsResponse) Descriptor added in v0.15.0

func (*QueryPositionsResponse) Descriptor() ([]byte, []int)

func (*QueryPositionsResponse) GetPositions added in v0.15.0

func (m *QueryPositionsResponse) GetPositions() []*QueryPositionResponse

func (*QueryPositionsResponse) Marshal added in v0.15.0

func (m *QueryPositionsResponse) Marshal() (dAtA []byte, err error)

func (*QueryPositionsResponse) MarshalTo added in v0.15.0

func (m *QueryPositionsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryPositionsResponse) MarshalToSizedBuffer added in v0.15.0

func (m *QueryPositionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryPositionsResponse) ProtoMessage added in v0.15.0

func (*QueryPositionsResponse) ProtoMessage()

func (*QueryPositionsResponse) Reset added in v0.15.0

func (m *QueryPositionsResponse) Reset()

func (*QueryPositionsResponse) Size added in v0.15.0

func (m *QueryPositionsResponse) Size() (n int)

func (*QueryPositionsResponse) String added in v0.15.0

func (m *QueryPositionsResponse) String() string

func (*QueryPositionsResponse) Unmarshal added in v0.15.0

func (m *QueryPositionsResponse) Unmarshal(dAtA []byte) error

func (*QueryPositionsResponse) XXX_DiscardUnknown added in v0.15.0

func (m *QueryPositionsResponse) XXX_DiscardUnknown()

func (*QueryPositionsResponse) XXX_Marshal added in v0.15.0

func (m *QueryPositionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryPositionsResponse) XXX_Merge added in v0.15.0

func (m *QueryPositionsResponse) XXX_Merge(src proto.Message)

func (*QueryPositionsResponse) XXX_Size added in v0.15.0

func (m *QueryPositionsResponse) XXX_Size() int

func (*QueryPositionsResponse) XXX_Unmarshal added in v0.15.0

func (m *QueryPositionsResponse) 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)
	QueryPosition(context.Context, *QueryPositionRequest) (*QueryPositionResponse, error)
	QueryPositions(context.Context, *QueryPositionsRequest) (*QueryPositionsResponse, error)
	FundingRates(context.Context, *QueryFundingRatesRequest) (*QueryFundingRatesResponse, error)
}

QueryServer is the server API for Query service.

type Side

type Side int32
const (
	Side_SIDE_UNSPECIFIED Side = 0
	Side_BUY              Side = 1
	Side_SELL             Side = 2
)

func (Side) EnumDescriptor

func (Side) EnumDescriptor() ([]byte, []int)

func (Side) String

func (x Side) String() string

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) AddMargin

func (*UnimplementedMsgServer) ClosePosition added in v0.4.20

func (*UnimplementedMsgServer) DonateToEcosystemFund added in v0.15.0

func (*UnimplementedMsgServer) Liquidate added in v0.4.15

func (*UnimplementedMsgServer) MultiLiquidate added in v0.15.0

func (*UnimplementedMsgServer) OpenPosition added in v0.1.2

func (*UnimplementedMsgServer) RemoveMargin

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) FundingRates added in v0.15.0

func (*UnimplementedQueryServer) Params

func (*UnimplementedQueryServer) QueryPosition added in v0.15.0

func (*UnimplementedQueryServer) QueryPositions added in v0.15.0

type VpoolKeeper

type VpoolKeeper interface {
	SwapBaseForQuote(
		ctx sdk.Context,
		pair common.AssetPair,
		dir vpooltypes.Direction,
		baseAssetAmount sdk.Dec,
		quoteAmountLimit sdk.Dec,
		skipFluctuationLimitCheck bool,
	) (sdk.Dec, error)

	SwapQuoteForBase(
		ctx sdk.Context,
		pair common.AssetPair,
		dir vpooltypes.Direction,
		quoteAssetAmount sdk.Dec,
		baseAmountLimit sdk.Dec,
		skipFluctuationLimitCheck bool,
	) (sdk.Dec, error)

	GetBaseAssetTWAP(
		ctx sdk.Context,
		pair common.AssetPair,
		direction vpooltypes.Direction,
		baseAssetAmount sdk.Dec,
		lookbackInterval time.Duration,
	) (quoteAssetAmount sdk.Dec, err error)

	GetBaseAssetPrice(
		ctx sdk.Context,
		pair common.AssetPair,
		direction vpooltypes.Direction,
		baseAssetAmount sdk.Dec,
	) (quoteAssetAmount sdk.Dec, err error)

	GetQuoteAssetPrice(
		ctx sdk.Context,
		pair common.AssetPair,
		dir vpooltypes.Direction,
		quoteAmount sdk.Dec,
	) (baseAssetAmount sdk.Dec, err error)

	GetMarkPrice(
		ctx sdk.Context,
		pair common.AssetPair,
	) (price sdk.Dec, err error)

	GetMarkPriceTWAP(
		ctx sdk.Context,
		pair common.AssetPair,
		lookbackInterval time.Duration,
	) (quoteAssetAmount sdk.Dec, err error)

	GetAllPools(ctx sdk.Context) []vpooltypes.VPool

	IsOverSpreadLimit(ctx sdk.Context, pair common.AssetPair) bool
	GetMaintenanceMarginRatio(ctx sdk.Context, pair common.AssetPair) sdk.Dec
	GetMaxLeverage(ctx sdk.Context, pair common.AssetPair) sdk.Dec
	ExistsPool(ctx sdk.Context, pair common.AssetPair) bool
	GetSettlementPrice(ctx sdk.Context, pair common.AssetPair) (sdk.Dec, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL