types

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	MinPriceChangePpm_LongTail uint32 = 800

	DefaultFundingPpm = 100 // 1bps per 8 hour or 0.125bps per hour

	LiquidityTier_IML_5x uint32 = 7

	DefaultStepBaseQuantums uint64 = 1_000_000

	SubticksPerTick_LongTail uint32 = 1_000_000

	DefaultQuantumConversionExponent = -9

	ResolutionOffset = -6

	DefaultMarketsHardCap = 500
)
View Source
const (
	// ModuleName defines the module name.
	ModuleName = "listing"

	// StoreKey defines the primary module store key.
	StoreKey = ModuleName
)

Module name and store keys.

View Source
const (
	// HardCapForMarketsKey is the key to retrieve the hard cap for listed markets.
	HardCapForMarketsKey = "HardCapForMarkets"

	// ListingVaultDepositParamsKey is the key to retrieve the listing vault deposit params.
	ListingVaultDepositParamsKey = "ListingVaultDepositParams"
)

State.

Variables

View Source
var (
	// Add x/listing specific errors here
	ErrMarketNotFound = errorsmod.Register(
		ModuleName,
		1,
		"market not found",
	)

	ErrReferencePriceZero = errorsmod.Register(
		ModuleName,
		2,
		"reference price is zero",
	)

	ErrMarketsHardCapReached = errorsmod.Register(
		ModuleName,
		3,
		"listed markets hard cap reached",
	)

	ErrInvalidDepositAmount = errorsmod.Register(
		ModuleName,
		4,
		"invalid vault deposit amount",
	)

	ErrInvalidNumBlocksToLockShares = errorsmod.Register(
		ModuleName,
		5,
		"invalid number of blocks to lock shares",
	)

	ErrInvalidMarketMapTickerMetadata = errorsmod.Register(
		ModuleName,
		6,
		"invalid market map ticker metadata",
	)
)
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 (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group")
)
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 (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

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 to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type ClobKeeper

type ClobKeeper interface {
	CreatePerpetualClobPair(
		ctx sdk.Context,
		clobPairId uint32,
		perpetualId uint32,
		stepSizeBaseQuantums satypes.BaseQuantums,
		quantumConversionExponent int32,
		subticksPerTick uint32,
		status clobtypes.ClobPair_Status,
	) (clobtypes.ClobPair, error)
	AcquireNextClobPairID(ctx sdk.Context) uint32
	ValidateClobPairCreation(ctx sdk.Context, clobPair *clobtypes.ClobPair) error
	StageNewClobPairSideEffects(ctx sdk.Context, clobPair clobtypes.ClobPair) error
	SetClobPair(ctx sdk.Context, clobPair clobtypes.ClobPair)
	GetStagedClobFinalizeBlockEvents(ctx sdk.Context) []*clobtypes.ClobStagedFinalizeBlockEvent
}

type GenesisState

type GenesisState struct {
	// hard_cap_for_markets is the hard cap for the number of markets that can be
	// listed
	HardCapForMarkets uint32 `protobuf:"varint,1,opt,name=hard_cap_for_markets,json=hardCapForMarkets,proto3" json:"hard_cap_for_markets,omitempty"`
	// listing_vault_deposit_params is the params for PML megavault deposits
	ListingVaultDepositParams ListingVaultDepositParams `` /* 130-byte string literal not displayed */
}

GenesisState defines `x/listing`'s genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default stats genesis state.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetHardCapForMarkets

func (m *GenesisState) GetHardCapForMarkets() uint32

func (*GenesisState) GetListingVaultDepositParams

func (m *GenesisState) GetListingVaultDepositParams() ListingVaultDepositParams

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 ListingVaultDepositParams

type ListingVaultDepositParams struct {
	// Amount that will be deposited into the new market vault exclusively
	NewVaultDepositAmount github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `` /* 185-byte string literal not displayed */
	// Amount deposited into the main vault exclusively. This amount does not
	// include the amount deposited into the new vault.
	MainVaultDepositAmount github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `` /* 188-byte string literal not displayed */
	// Lockup period for this deposit
	NumBlocksToLockShares uint32 `` /* 131-byte string literal not displayed */
}

ListingVaultDepositParams represents the params for PML megavault deposits

func DefaultParams

func DefaultParams() ListingVaultDepositParams

DefaultParams defines the default parameters for listing vault deposits.

func (*ListingVaultDepositParams) Descriptor

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

func (*ListingVaultDepositParams) GetNumBlocksToLockShares

func (m *ListingVaultDepositParams) GetNumBlocksToLockShares() uint32

func (*ListingVaultDepositParams) Marshal

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

func (*ListingVaultDepositParams) MarshalTo

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

func (*ListingVaultDepositParams) MarshalToSizedBuffer

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

func (*ListingVaultDepositParams) ProtoMessage

func (*ListingVaultDepositParams) ProtoMessage()

func (*ListingVaultDepositParams) Reset

func (m *ListingVaultDepositParams) Reset()

func (*ListingVaultDepositParams) Size

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

func (*ListingVaultDepositParams) String

func (m *ListingVaultDepositParams) String() string

func (*ListingVaultDepositParams) Unmarshal

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

func (ListingVaultDepositParams) Validate

func (p ListingVaultDepositParams) Validate() error

Validate checks that the parameters have valid values.

func (*ListingVaultDepositParams) XXX_DiscardUnknown

func (m *ListingVaultDepositParams) XXX_DiscardUnknown()

func (*ListingVaultDepositParams) XXX_Marshal

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

func (*ListingVaultDepositParams) XXX_Merge

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

func (*ListingVaultDepositParams) XXX_Size

func (m *ListingVaultDepositParams) XXX_Size() int

func (*ListingVaultDepositParams) XXX_Unmarshal

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

type MarketMapKeeper

type MarketMapKeeper interface {
	GetMarket(
		ctx sdk.Context,
		ticker string,
	) (marketmaptypes.Market, error)
	// Only used for testing purposes
	CreateMarket(
		ctx sdk.Context,
		market marketmaptypes.Market,
	) error
}

type MsgClient

type MsgClient interface {
	// SetMarketsHardCap sets a hard cap on the number of markets listed
	SetMarketsHardCap(ctx context.Context, in *MsgSetMarketsHardCap, opts ...grpc.CallOption) (*MsgSetMarketsHardCapResponse, error)
	// CreateMarketPermissionless creates a new market without going through x/gov
	CreateMarketPermissionless(ctx context.Context, in *MsgCreateMarketPermissionless, opts ...grpc.CallOption) (*MsgCreateMarketPermissionlessResponse, error)
	// SetListingVaultDepositParams sets PML megavault deposit params
	SetListingVaultDepositParams(ctx context.Context, in *MsgSetListingVaultDepositParams, opts ...grpc.CallOption) (*MsgSetListingVaultDepositParamsResponse, error)
	// UpgradeIsolatedPerpetualToCross upgrades a perpetual from isolated to cross
	// margin
	UpgradeIsolatedPerpetualToCross(ctx context.Context, in *MsgUpgradeIsolatedPerpetualToCross, opts ...grpc.CallOption) (*MsgUpgradeIsolatedPerpetualToCrossResponse, 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 MsgCreateMarketPermissionless

type MsgCreateMarketPermissionless struct {
	// The name of the `Perpetual` (e.g. `BTC-USD`).
	Ticker string `protobuf:"bytes,1,opt,name=ticker,proto3" json:"ticker,omitempty"`
	// The subaccount to deposit from.
	SubaccountId *types.SubaccountId `protobuf:"bytes,2,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id,omitempty"`
}

MsgCreateMarketPermissionless is a message used to create new markets without going through x/gov

func (*MsgCreateMarketPermissionless) Descriptor

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

func (*MsgCreateMarketPermissionless) GetSubaccountId

func (m *MsgCreateMarketPermissionless) GetSubaccountId() *types.SubaccountId

func (*MsgCreateMarketPermissionless) GetTicker

func (m *MsgCreateMarketPermissionless) GetTicker() string

func (*MsgCreateMarketPermissionless) Marshal

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

func (*MsgCreateMarketPermissionless) MarshalTo

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

func (*MsgCreateMarketPermissionless) MarshalToSizedBuffer

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

func (*MsgCreateMarketPermissionless) ProtoMessage

func (*MsgCreateMarketPermissionless) ProtoMessage()

func (*MsgCreateMarketPermissionless) Reset

func (m *MsgCreateMarketPermissionless) Reset()

func (*MsgCreateMarketPermissionless) Size

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

func (*MsgCreateMarketPermissionless) String

func (*MsgCreateMarketPermissionless) Unmarshal

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

func (*MsgCreateMarketPermissionless) XXX_DiscardUnknown

func (m *MsgCreateMarketPermissionless) XXX_DiscardUnknown()

func (*MsgCreateMarketPermissionless) XXX_Marshal

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

func (*MsgCreateMarketPermissionless) XXX_Merge

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

func (*MsgCreateMarketPermissionless) XXX_Size

func (m *MsgCreateMarketPermissionless) XXX_Size() int

func (*MsgCreateMarketPermissionless) XXX_Unmarshal

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

type MsgCreateMarketPermissionlessResponse

type MsgCreateMarketPermissionlessResponse struct {
}

MsgCreateMarketPermissionlessResponse defines the MsgCreateMarketPermissionless response

func (*MsgCreateMarketPermissionlessResponse) Descriptor

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

func (*MsgCreateMarketPermissionlessResponse) Marshal

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

func (*MsgCreateMarketPermissionlessResponse) MarshalTo

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

func (*MsgCreateMarketPermissionlessResponse) MarshalToSizedBuffer

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

func (*MsgCreateMarketPermissionlessResponse) ProtoMessage

func (*MsgCreateMarketPermissionlessResponse) ProtoMessage()

func (*MsgCreateMarketPermissionlessResponse) Reset

func (*MsgCreateMarketPermissionlessResponse) Size

func (*MsgCreateMarketPermissionlessResponse) String

func (*MsgCreateMarketPermissionlessResponse) Unmarshal

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

func (*MsgCreateMarketPermissionlessResponse) XXX_DiscardUnknown

func (m *MsgCreateMarketPermissionlessResponse) XXX_DiscardUnknown()

func (*MsgCreateMarketPermissionlessResponse) XXX_Marshal

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

func (*MsgCreateMarketPermissionlessResponse) XXX_Merge

func (*MsgCreateMarketPermissionlessResponse) XXX_Size

func (*MsgCreateMarketPermissionlessResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// SetMarketsHardCap sets a hard cap on the number of markets listed
	SetMarketsHardCap(context.Context, *MsgSetMarketsHardCap) (*MsgSetMarketsHardCapResponse, error)
	// CreateMarketPermissionless creates a new market without going through x/gov
	CreateMarketPermissionless(context.Context, *MsgCreateMarketPermissionless) (*MsgCreateMarketPermissionlessResponse, error)
	// SetListingVaultDepositParams sets PML megavault deposit params
	SetListingVaultDepositParams(context.Context, *MsgSetListingVaultDepositParams) (*MsgSetListingVaultDepositParamsResponse, error)
	// UpgradeIsolatedPerpetualToCross upgrades a perpetual from isolated to cross
	// margin
	UpgradeIsolatedPerpetualToCross(context.Context, *MsgUpgradeIsolatedPerpetualToCross) (*MsgUpgradeIsolatedPerpetualToCrossResponse, error)
}

MsgServer is the server API for Msg service.

type MsgSetListingVaultDepositParams

type MsgSetListingVaultDepositParams struct {
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// Params which define the vault deposit for market listing
	Params ListingVaultDepositParams `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgSetListingVaultDepositParams is a message used to set PML megavault deposit params

func (*MsgSetListingVaultDepositParams) Descriptor

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

func (*MsgSetListingVaultDepositParams) GetAuthority

func (m *MsgSetListingVaultDepositParams) GetAuthority() string

func (*MsgSetListingVaultDepositParams) GetParams

func (*MsgSetListingVaultDepositParams) Marshal

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

func (*MsgSetListingVaultDepositParams) MarshalTo

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

func (*MsgSetListingVaultDepositParams) MarshalToSizedBuffer

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

func (*MsgSetListingVaultDepositParams) ProtoMessage

func (*MsgSetListingVaultDepositParams) ProtoMessage()

func (*MsgSetListingVaultDepositParams) Reset

func (*MsgSetListingVaultDepositParams) Size

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

func (*MsgSetListingVaultDepositParams) String

func (*MsgSetListingVaultDepositParams) Unmarshal

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

func (*MsgSetListingVaultDepositParams) XXX_DiscardUnknown

func (m *MsgSetListingVaultDepositParams) XXX_DiscardUnknown()

func (*MsgSetListingVaultDepositParams) XXX_Marshal

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

func (*MsgSetListingVaultDepositParams) XXX_Merge

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

func (*MsgSetListingVaultDepositParams) XXX_Size

func (m *MsgSetListingVaultDepositParams) XXX_Size() int

func (*MsgSetListingVaultDepositParams) XXX_Unmarshal

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

type MsgSetListingVaultDepositParamsResponse

type MsgSetListingVaultDepositParamsResponse struct {
}

MsgSetListingVaultDepositParamsResponse defines the MsgSetListingVaultDepositParams response

func (*MsgSetListingVaultDepositParamsResponse) Descriptor

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

func (*MsgSetListingVaultDepositParamsResponse) Marshal

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

func (*MsgSetListingVaultDepositParamsResponse) MarshalTo

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

func (*MsgSetListingVaultDepositParamsResponse) MarshalToSizedBuffer

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

func (*MsgSetListingVaultDepositParamsResponse) ProtoMessage

func (*MsgSetListingVaultDepositParamsResponse) Reset

func (*MsgSetListingVaultDepositParamsResponse) Size

func (*MsgSetListingVaultDepositParamsResponse) String

func (*MsgSetListingVaultDepositParamsResponse) Unmarshal

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

func (*MsgSetListingVaultDepositParamsResponse) XXX_DiscardUnknown

func (m *MsgSetListingVaultDepositParamsResponse) XXX_DiscardUnknown()

func (*MsgSetListingVaultDepositParamsResponse) XXX_Marshal

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

func (*MsgSetListingVaultDepositParamsResponse) XXX_Merge

func (*MsgSetListingVaultDepositParamsResponse) XXX_Size

func (*MsgSetListingVaultDepositParamsResponse) XXX_Unmarshal

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

type MsgSetMarketsHardCap

type MsgSetMarketsHardCap struct {
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// Hard cap for the total number of markets listed
	HardCapForMarkets uint32 `protobuf:"varint,2,opt,name=hard_cap_for_markets,json=hardCapForMarkets,proto3" json:"hard_cap_for_markets,omitempty"`
}

MsgSetMarketsHardCap is used to set a hard cap on the number of markets listed

func (*MsgSetMarketsHardCap) Descriptor

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

func (*MsgSetMarketsHardCap) GetAuthority

func (m *MsgSetMarketsHardCap) GetAuthority() string

func (*MsgSetMarketsHardCap) GetHardCapForMarkets

func (m *MsgSetMarketsHardCap) GetHardCapForMarkets() uint32

func (*MsgSetMarketsHardCap) Marshal

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

func (*MsgSetMarketsHardCap) MarshalTo

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

func (*MsgSetMarketsHardCap) MarshalToSizedBuffer

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

func (*MsgSetMarketsHardCap) ProtoMessage

func (*MsgSetMarketsHardCap) ProtoMessage()

func (*MsgSetMarketsHardCap) Reset

func (m *MsgSetMarketsHardCap) Reset()

func (*MsgSetMarketsHardCap) Size

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

func (*MsgSetMarketsHardCap) String

func (m *MsgSetMarketsHardCap) String() string

func (*MsgSetMarketsHardCap) Unmarshal

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

func (*MsgSetMarketsHardCap) XXX_DiscardUnknown

func (m *MsgSetMarketsHardCap) XXX_DiscardUnknown()

func (*MsgSetMarketsHardCap) XXX_Marshal

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

func (*MsgSetMarketsHardCap) XXX_Merge

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

func (*MsgSetMarketsHardCap) XXX_Size

func (m *MsgSetMarketsHardCap) XXX_Size() int

func (*MsgSetMarketsHardCap) XXX_Unmarshal

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

type MsgSetMarketsHardCapResponse

type MsgSetMarketsHardCapResponse struct {
}

MsgSetMarketsHardCapResponse defines the MsgSetMarketsHardCap response

func (*MsgSetMarketsHardCapResponse) Descriptor

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

func (*MsgSetMarketsHardCapResponse) Marshal

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

func (*MsgSetMarketsHardCapResponse) MarshalTo

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

func (*MsgSetMarketsHardCapResponse) MarshalToSizedBuffer

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

func (*MsgSetMarketsHardCapResponse) ProtoMessage

func (*MsgSetMarketsHardCapResponse) ProtoMessage()

func (*MsgSetMarketsHardCapResponse) Reset

func (m *MsgSetMarketsHardCapResponse) Reset()

func (*MsgSetMarketsHardCapResponse) Size

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

func (*MsgSetMarketsHardCapResponse) String

func (*MsgSetMarketsHardCapResponse) Unmarshal

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

func (*MsgSetMarketsHardCapResponse) XXX_DiscardUnknown

func (m *MsgSetMarketsHardCapResponse) XXX_DiscardUnknown()

func (*MsgSetMarketsHardCapResponse) XXX_Marshal

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

func (*MsgSetMarketsHardCapResponse) XXX_Merge

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

func (*MsgSetMarketsHardCapResponse) XXX_Size

func (m *MsgSetMarketsHardCapResponse) XXX_Size() int

func (*MsgSetMarketsHardCapResponse) XXX_Unmarshal

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

type MsgUpgradeIsolatedPerpetualToCross

type MsgUpgradeIsolatedPerpetualToCross struct {
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// ID of the perpetual to be upgraded to CROSS
	PerpetualId uint32 `protobuf:"varint,2,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"`
}

MsgUpgradeIsolatedPerpetualToCross is used to upgrade a market from isolated margin to cross margin.

func (*MsgUpgradeIsolatedPerpetualToCross) Descriptor

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

func (*MsgUpgradeIsolatedPerpetualToCross) GetAuthority

func (m *MsgUpgradeIsolatedPerpetualToCross) GetAuthority() string

func (*MsgUpgradeIsolatedPerpetualToCross) GetPerpetualId

func (m *MsgUpgradeIsolatedPerpetualToCross) GetPerpetualId() uint32

func (*MsgUpgradeIsolatedPerpetualToCross) Marshal

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

func (*MsgUpgradeIsolatedPerpetualToCross) MarshalTo

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

func (*MsgUpgradeIsolatedPerpetualToCross) MarshalToSizedBuffer

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

func (*MsgUpgradeIsolatedPerpetualToCross) ProtoMessage

func (*MsgUpgradeIsolatedPerpetualToCross) ProtoMessage()

func (*MsgUpgradeIsolatedPerpetualToCross) Reset

func (*MsgUpgradeIsolatedPerpetualToCross) Size

func (*MsgUpgradeIsolatedPerpetualToCross) String

func (*MsgUpgradeIsolatedPerpetualToCross) Unmarshal

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

func (*MsgUpgradeIsolatedPerpetualToCross) XXX_DiscardUnknown

func (m *MsgUpgradeIsolatedPerpetualToCross) XXX_DiscardUnknown()

func (*MsgUpgradeIsolatedPerpetualToCross) XXX_Marshal

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

func (*MsgUpgradeIsolatedPerpetualToCross) XXX_Merge

func (*MsgUpgradeIsolatedPerpetualToCross) XXX_Size

func (*MsgUpgradeIsolatedPerpetualToCross) XXX_Unmarshal

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

type MsgUpgradeIsolatedPerpetualToCrossResponse

type MsgUpgradeIsolatedPerpetualToCrossResponse struct {
}

MsgUpgradeIsolatedPerpetualToCrossResponse defines the UpgradeIsolatedPerpetualToCross response type.

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) Descriptor

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) Marshal

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

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) MarshalTo

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

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) MarshalToSizedBuffer

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

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) ProtoMessage

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) Reset

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) Size

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) String

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) Unmarshal

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) XXX_DiscardUnknown

func (m *MsgUpgradeIsolatedPerpetualToCrossResponse) XXX_DiscardUnknown()

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) XXX_Marshal

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

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) XXX_Merge

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) XXX_Size

func (*MsgUpgradeIsolatedPerpetualToCrossResponse) XXX_Unmarshal

type PerpetualsKeeper

type PerpetualsKeeper interface {
	CreatePerpetual(
		ctx sdk.Context,
		id uint32,
		ticker string,
		marketId uint32,
		atomicResolution int32,
		defaultFundingPpm int32,
		liquidityTier uint32,
		marketType perpetualtypes.PerpetualMarketType,
	) (perpetualtypes.Perpetual, error)
	AcquireNextPerpetualID(ctx sdk.Context) uint32
	GetPerpetual(
		ctx sdk.Context,
		id uint32,
	) (val perpetualtypes.Perpetual, err error)
	GetAllPerpetuals(ctx sdk.Context) (list []perpetualtypes.Perpetual)
	SetPerpetualMarketType(
		ctx sdk.Context,
		id uint32,
		marketType perpetualtypes.PerpetualMarketType,
	) (perpetualtypes.Perpetual, error)
}

type PricesKeeper

type PricesKeeper interface {
	CreateMarket(
		ctx sdk.Context,
		marketParam pricestypes.MarketParam,
		marketPrice pricestypes.MarketPrice,
	) (pricestypes.MarketParam, error)
	AcquireNextMarketID(ctx sdk.Context) uint32
}

type QueryClient

type QueryClient interface {
	// Queries for the hard cap number of listed markets
	MarketsHardCap(ctx context.Context, in *QueryMarketsHardCap, opts ...grpc.CallOption) (*QueryMarketsHardCapResponse, error)
	// Queries the listing vault deposit params
	ListingVaultDepositParams(ctx context.Context, in *QueryListingVaultDepositParams, opts ...grpc.CallOption) (*QueryListingVaultDepositParamsResponse, 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 QueryListingVaultDepositParams

type QueryListingVaultDepositParams struct {
}

Queries the listing vault deposit params

func (*QueryListingVaultDepositParams) Descriptor

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

func (*QueryListingVaultDepositParams) Marshal

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

func (*QueryListingVaultDepositParams) MarshalTo

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

func (*QueryListingVaultDepositParams) MarshalToSizedBuffer

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

func (*QueryListingVaultDepositParams) ProtoMessage

func (*QueryListingVaultDepositParams) ProtoMessage()

func (*QueryListingVaultDepositParams) Reset

func (m *QueryListingVaultDepositParams) Reset()

func (*QueryListingVaultDepositParams) Size

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

func (*QueryListingVaultDepositParams) String

func (*QueryListingVaultDepositParams) Unmarshal

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

func (*QueryListingVaultDepositParams) XXX_DiscardUnknown

func (m *QueryListingVaultDepositParams) XXX_DiscardUnknown()

func (*QueryListingVaultDepositParams) XXX_Marshal

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

func (*QueryListingVaultDepositParams) XXX_Merge

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

func (*QueryListingVaultDepositParams) XXX_Size

func (m *QueryListingVaultDepositParams) XXX_Size() int

func (*QueryListingVaultDepositParams) XXX_Unmarshal

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

type QueryListingVaultDepositParamsResponse

type QueryListingVaultDepositParamsResponse struct {
	Params ListingVaultDepositParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

Response type for QueryListingVaultDepositParams

func (*QueryListingVaultDepositParamsResponse) Descriptor

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

func (*QueryListingVaultDepositParamsResponse) GetParams

func (*QueryListingVaultDepositParamsResponse) Marshal

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

func (*QueryListingVaultDepositParamsResponse) MarshalTo

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

func (*QueryListingVaultDepositParamsResponse) MarshalToSizedBuffer

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

func (*QueryListingVaultDepositParamsResponse) ProtoMessage

func (*QueryListingVaultDepositParamsResponse) Reset

func (*QueryListingVaultDepositParamsResponse) Size

func (*QueryListingVaultDepositParamsResponse) String

func (*QueryListingVaultDepositParamsResponse) Unmarshal

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

func (*QueryListingVaultDepositParamsResponse) XXX_DiscardUnknown

func (m *QueryListingVaultDepositParamsResponse) XXX_DiscardUnknown()

func (*QueryListingVaultDepositParamsResponse) XXX_Marshal

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

func (*QueryListingVaultDepositParamsResponse) XXX_Merge

func (*QueryListingVaultDepositParamsResponse) XXX_Size

func (*QueryListingVaultDepositParamsResponse) XXX_Unmarshal

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

type QueryMarketsHardCap

type QueryMarketsHardCap struct {
}

Queries for the hard cap on listed markets

func (*QueryMarketsHardCap) Descriptor

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

func (*QueryMarketsHardCap) Marshal

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

func (*QueryMarketsHardCap) MarshalTo

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

func (*QueryMarketsHardCap) MarshalToSizedBuffer

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

func (*QueryMarketsHardCap) ProtoMessage

func (*QueryMarketsHardCap) ProtoMessage()

func (*QueryMarketsHardCap) Reset

func (m *QueryMarketsHardCap) Reset()

func (*QueryMarketsHardCap) Size

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

func (*QueryMarketsHardCap) String

func (m *QueryMarketsHardCap) String() string

func (*QueryMarketsHardCap) Unmarshal

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

func (*QueryMarketsHardCap) XXX_DiscardUnknown

func (m *QueryMarketsHardCap) XXX_DiscardUnknown()

func (*QueryMarketsHardCap) XXX_Marshal

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

func (*QueryMarketsHardCap) XXX_Merge

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

func (*QueryMarketsHardCap) XXX_Size

func (m *QueryMarketsHardCap) XXX_Size() int

func (*QueryMarketsHardCap) XXX_Unmarshal

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

type QueryMarketsHardCapResponse

type QueryMarketsHardCapResponse struct {
	HardCap uint32 `protobuf:"varint,1,opt,name=hard_cap,json=hardCap,proto3" json:"hard_cap,omitempty"`
}

Response type indicating the hard cap on listed markets

func (*QueryMarketsHardCapResponse) Descriptor

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

func (*QueryMarketsHardCapResponse) GetHardCap

func (m *QueryMarketsHardCapResponse) GetHardCap() uint32

func (*QueryMarketsHardCapResponse) Marshal

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

func (*QueryMarketsHardCapResponse) MarshalTo

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

func (*QueryMarketsHardCapResponse) MarshalToSizedBuffer

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

func (*QueryMarketsHardCapResponse) ProtoMessage

func (*QueryMarketsHardCapResponse) ProtoMessage()

func (*QueryMarketsHardCapResponse) Reset

func (m *QueryMarketsHardCapResponse) Reset()

func (*QueryMarketsHardCapResponse) Size

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

func (*QueryMarketsHardCapResponse) String

func (m *QueryMarketsHardCapResponse) String() string

func (*QueryMarketsHardCapResponse) Unmarshal

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

func (*QueryMarketsHardCapResponse) XXX_DiscardUnknown

func (m *QueryMarketsHardCapResponse) XXX_DiscardUnknown()

func (*QueryMarketsHardCapResponse) XXX_Marshal

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

func (*QueryMarketsHardCapResponse) XXX_Merge

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

func (*QueryMarketsHardCapResponse) XXX_Size

func (m *QueryMarketsHardCapResponse) XXX_Size() int

func (*QueryMarketsHardCapResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Queries for the hard cap number of listed markets
	MarketsHardCap(context.Context, *QueryMarketsHardCap) (*QueryMarketsHardCapResponse, error)
	// Queries the listing vault deposit params
	ListingVaultDepositParams(context.Context, *QueryListingVaultDepositParams) (*QueryListingVaultDepositParamsResponse, error)
}

QueryServer is the server API for Query service.

type SubaccountsKeeper

type SubaccountsKeeper interface {
	TransferIsolatedInsuranceFundToCross(
		ctx sdk.Context,
		perpetualId uint32,
	) error
	TransferIsolatedCollateralToCross(
		ctx sdk.Context,
		perpetualId uint32,
	) error
}

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) CreateMarketPermissionless

func (*UnimplementedMsgServer) SetMarketsHardCap

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) MarketsHardCap

type VaultKeeper

type VaultKeeper interface {
	DepositToMegavault(
		ctx sdk.Context,
		fromSubaccount satypes.SubaccountId,
		quoteQuantums *big.Int,
	) (mintedShares *big.Int, err error)
	AllocateToVault(
		ctx sdk.Context,
		vaultId vaulttypes.VaultId,
		quantums *big.Int,
	) error
	LockShares(
		ctx sdk.Context,
		ownerAddress string,
		sharesToLock vaulttypes.NumShares,
		tilBlock uint32,
	) error
	SetVaultStatus(
		ctx sdk.Context,
		vaultId vaulttypes.VaultId,
		status vaulttypes.VaultStatus,
	) error
}

Jump to

Keyboard shortcuts

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