types

package
v1.0.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: AGPL-3.0 Imports: 50 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	MaxShortTermOrdersPerNBlocksNumBlocks             = 1_000
	MaxShortTermOrdersPerNBlocksLimit                 = 10_000_000
	MaxShortTermOrderCancellationsPerNBlocksNumBlocks = 1_000
	MaxShortTermOrderCancellationsPerNBlocksLimit     = 10_000_000
	MaxStatefulOrdersPerNBlocksNumBlocks              = 10_000
	MaxStatefulOrdersPerNBlocksLimit                  = 1_000_000
)
View Source
const (
	MaxShortTermOrdersForEquityTier = 10_000_000
	MaxStatefulOrdersForEquityTier  = 10_000_000
)
View Source
const (
	EventTypeMatch = "match"

	AttributeKeyTakerSubaccount                         = "taker_subaccount"
	AttributeKeyTakerSubaccountNumber                   = "taker_subaccount_number"
	AttributeKeyMakerSubaccount                         = "maker_subaccount"
	AttributeKeyMakerSubaccountNumber                   = "maker_subaccount_number"
	AttributeKeyTakerOrderFeeQuoteQuantums              = "taker_order_fee_quote_quantums"
	AttributeKeyMakerOrderFeeQuoteQuantums              = "maker_order_fee_quote_quantums"
	AttributeKeyMakerQuoteBalanceDeltaQuoteQuantums     = "maker_quote_balance_delta_quote_quantums"
	AttributeKeyTakerQuoteBalanceDeltaQuoteQuantums     = "taker_quote_balance_delta_quote_quantums"
	AttributeKeyMakerPerpetualQuantumsDeltaBaseQuantums = "maker_perpetual_quantums_delta_base_quantums"
	AttributeKeyTakerPerpetualQuantumsDeltaBaseQuantums = "taker_perpetual_quantums_delta_base_quantums"
	AttributeKeyInsuranceFundDeltaQuoteQuantums         = "insurance_fund_delta_quote_quantums"
	AttributeKeyIsLiquidation                           = "is_liquidation"
	AttributeKeyIsDeleverage                            = "is_deleverage"
	AttributeKeyPerpetualId                             = "perpetual_id"
)

CLOB module event types.

View Source
const (
	// ModuleName defines the module name
	ModuleName = "clob"

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

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_" + ModuleName

	// TransientStoreKey defines the primary module transient store key
	TransientStoreKey = "tmp_" + ModuleName
)

Module name and store keys

View Source
const (
	// StatefulOrderKeyPrefix is the prefix key for all long term orders and all conditional orders,
	// both triggered and untriggered.
	StatefulOrderKeyPrefix = "SO/"

	// PlacedStatefulOrderKeyPrefix is the prefix key for placed long term orders and triggered
	// conditional orders. It represents all stateful orders that should be placed upon the memclob
	// during app start up.
	PlacedStatefulOrderKeyPrefix = StatefulOrderKeyPrefix + "P/"
)

Below key prefixes are not explicitly used to read/write to state, but rather used to iterate over certain groups of items stored in state.

View Source
const (
	// LiquidationsConfigKey is the key to retrieve the liquidations config.
	LiquidationsConfigKey = "LiqCfg"

	// EquityTierLimitConfigKey is the key to retrieve the equity tier limit configuration.
	EquityTierLimitConfigKey = "EqTierCfg"

	// BlockRateLimitConfigKey is the key to retrieve the block rate limit configuration.
	BlockRateLimitConfigKey = "RateLimCfg"

	// ClobPairKeyPrefix is the prefix to retrieve all ClobPair
	ClobPairKeyPrefix = "Clob:"

	// OrderAmountFilledKeyPrefix is the prefix to retrieve the fill amount for an order.
	OrderAmountFilledKeyPrefix = "Fill:"

	// BlockHeightToPotentiallyPrunableOrdersPrefix is the prefix to retrieve a list of potentially prunable
	// short term orders by block height.
	BlockHeightToPotentiallyPrunableOrdersPrefix = "ExpHt:"

	// StatefulOrdersTimeSlicePrefix is the key to retrieve a unique list of the stateful orders that
	// expire at a given timestamp, sorted by order ID.
	StatefulOrdersTimeSlicePrefix = "ExpTm:"
)

State

View Source
const (
	// TriggeredConditionalOrderKeyPrefix is the key to retrieve an triggered conditional order and
	// information about when it was triggered.
	TriggeredConditionalOrderKeyPrefix = PlacedStatefulOrderKeyPrefix + "T:"

	// LongTermOrderPlacementKeyPrefix is the key to retrieve a long term order and information about
	// when it was placed.
	LongTermOrderPlacementKeyPrefix = PlacedStatefulOrderKeyPrefix + "L:"

	// UntriggeredConditionalOrderKeyPrefix is the key to retrieve an untriggered conditional order and
	// information about when it was placed.
	UntriggeredConditionalOrderKeyPrefix = StatefulOrderKeyPrefix + "U:"
)

Store / Memstore

View Source
const (
	// ProcessProposerMatchesEventsKey is the key to retrieve information about how to update
	// memclob state based on the latest block.
	ProcessProposerMatchesEventsKey = "ProposerEvents"

	// StatefulOrderCountPrefix is the key to retrieve the stateful order count. The stateful order count
	// represents the number of stateful orders stored in state.
	StatefulOrderCountPrefix = "NumSO:"
)

Memstore

View Source
const (
	// SubaccountLiquidationInfoKeyPrefix is the prefix to retrieve the liquidation information
	// for a subaccount within the last block.
	SubaccountLiquidationInfoKeyPrefix = "SaLiqInfo:"

	// NextStatefulOrderBlockTransactionIndexKey is the transient store key that stores the next
	// transaction index to use for the next newly-placed stateful order.
	NextStatefulOrderBlockTransactionIndexKey = "NextTxIdx"

	// UncommittedStatefulOrderPlacementKeyPrefix is the key to retrieve an uncommitted stateful order and information
	// about when it was placed. Uncommitted orders are orders that this validator is aware of that have yet to be
	// committed to a block and are stored in a transient store.
	UncommittedStatefulOrderPlacementKeyPrefix = "UncmtSO:"

	// UncommittedStatefulOrderCancellationKeyPrefix is the key to retrieve an uncommitted stateful order cancellation.
	// Uncommitted cancelleations are cancellations that this validator is aware of that have yet to be
	// committed to a block and are stored in a transient store.
	UncommittedStatefulOrderCancellationKeyPrefix = "UncmtSOCxl:"

	// UncommittedStatefulOrderCountPrefix is the key to retrieve an uncommitted stateful order count.
	// Uncommitted orders are orders that this validator is aware of that have yet to be committed to a block and
	// are stored in a transient store. This count represents the number of uncommitted stateful
	// `placements - cancellations`.
	UncommittedStatefulOrderCountPrefix = "NumUncmtSO:"
)

Transient Store

View Source
const (
	OrderIdFlags_ShortTerm   = uint32(0)
	OrderIdFlags_Conditional = uint32(32)
	OrderIdFlags_LongTerm    = uint32(64)
)
View Source
const (
	// InsuranceFundName defines the root string for the insurance fund account address
	InsuranceFundName = "insurance_fund"
)

Module Accounts

View Source
const ShortBlockWindow uint32 = 20

ShortBlockWindow represents the maximum number of blocks past the current block height that a `MsgPlaceOrder` or `MsgCancelOrder` message will be considered valid by the validator.

View Source
const StatefulOrderTimeWindow time.Duration = 95 * 24 * time.Hour // 95 days.

StatefulOrderTimeWindow represents the maximum amount of time in seconds past the current block time that a long-term/conditional `MsgPlaceOrder` message will be considered valid by the validator.

View Source
const TypeMsgCancelOrder = "cancel_order"
View Source
const TypeMsgPlaceOrder = "place_order"
View Source
const TypeMsgProposedOperations = "proposed_operations"

Variables

View Source
var (
	ErrInvalidLengthBlockRateLimitConfig        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBlockRateLimitConfig          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBlockRateLimitConfig = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthClobPair        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowClobPair          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupClobPair = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthEquityTierLimitConfig        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEquityTierLimitConfig          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEquityTierLimitConfig = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrMemClobOrderDoesNotExist = errorsmod.Register(
		ModuleName,
		2,
		"Order does not exist in memclob",
	)
	ErrInvalidOrderSide = errorsmod.Register(
		ModuleName,
		3,
		"Invalid order side",
	)
	ErrInvalidOrderQuantums     = errorsmod.Register(ModuleName, 4, "Invalid order quantums")
	ErrInvalidOrderGoodTilBlock = errorsmod.Register(ModuleName, 5, "Invalid order goodTilBlock")
	ErrInvalidOrderSubticks     = errorsmod.Register(ModuleName, 6, "Invalid order subticks")
	ErrOrderIsCanceled          = errorsmod.Register(
		ModuleName,
		7,
		"Attempt to place an order that is already canceled",
	)
	ErrInvalidClob = errorsmod.Register(
		ModuleName,
		8,
		"ClobPair ID does not reference a valid CLOB",
	)
	ErrMemClobCancelAlreadyExists = errorsmod.Register(
		ModuleName,
		9,
		"A cancel already exists in the memclob for this order with a greater than or equal GoodTilBlock",
	)
	ErrHeightExceedsGoodTilBlock = errorsmod.Register(
		ModuleName,
		10,
		"The next block height is greater than the GoodTilBlock of the message",
	)
	ErrGoodTilBlockExceedsShortBlockWindow = errorsmod.Register(
		ModuleName,
		11,
		"The GoodTilBlock of the message is further than ShortBlockWindow blocks into the future",
	)
	ErrInvalidPlaceOrder = errorsmod.Register(
		ModuleName,
		12,
		"MsgPlaceOrder is invalid",
	)
	ErrInvalidMsgProposedMatchOrders = errorsmod.Register(
		ModuleName,
		13,
		"MsgProposedMatchOrders is invalid",
	)
	ErrStateFilledAmountNoChange = errorsmod.Register(
		ModuleName,
		14,
		"State filled amount cannot be unchanged",
	)
	ErrStateFilledAmountDecreasing = errorsmod.Register(
		ModuleName,
		15,
		"State filled amount cannot decrease",
	)
	ErrInvalidPruneStateFilledAmount = errorsmod.Register(
		ModuleName,
		16,
		"Cannot prune state fill amount that does not exist",
	)
	ErrOrderWouldExceedMaxOpenOrdersPerClobAndSide = errorsmod.Register(
		ModuleName,
		17,
		"Subaccount cannot open more than 20 orders on a given CLOB and side",
	)
	ErrFillAmountNotDivisibleByStepSize = errorsmod.Register(
		ModuleName,
		18,
		"`FillAmount` is not divisible by `StepBaseQuantums` of the specified `ClobPairId`",
	)
	ErrNoClobPairForPerpetual = errorsmod.Register(
		ModuleName,
		19,
		"The provided perpetual ID does not have any associated CLOB pairs",
	)
	ErrInvalidReplacement = errorsmod.Register(
		ModuleName,
		20,
		"An order with the same `OrderId` already exists for this CLOB with a greater-than-or-equal `GoodTilBlock` "+
			"or Order Hash",
	)
	ErrClobPairAndPerpetualDoNotMatch = errorsmod.Register(
		ModuleName,
		21,
		"Clob pair and perpetual ids do not match",
	)
	ErrMatchedOrderNegativeFee = errorsmod.Register(
		ModuleName,
		22,
		"Matched order has negative fee",
	)
	ErrSubaccountFeeTransferFailed = errorsmod.Register(
		ModuleName,
		23,
		"Subaccounts updated for a matched order, but fee transfer to fee-collector failed",
	)
	ErrOrderFullyFilled = errorsmod.Register(
		ModuleName,
		24,
		"Order is fully filled",
	)
	ErrPremiumWithNonPerpetualClobPair = errorsmod.Register(
		ModuleName,
		25,
		"Attempting to get price premium with a non-perpetual CLOB pair",
	)
	ErrZeroIndexPriceForPremiumCalculation = errorsmod.Register(
		ModuleName,
		26,
		"Index price is zero when calculating price premium",
	)
	ErrInvalidClobPairParameter = errorsmod.Register(
		ModuleName,
		27,
		"Invalid ClobPair parameter",
	)
	ErrZeroPriceForOracle = errorsmod.Register(
		ModuleName,
		28,
		"Oracle price must be > 0.",
	)
	ErrInvalidStatefulOrderCancellation = errorsmod.Register(
		ModuleName,
		29,
		"Invalid stateful order cancellation",
	)
	ErrOrderReprocessed = errorsmod.Register(
		ModuleName,
		30,
		"An order with the same `OrderId` and `OrderHash` has already been processed for this CLOB",
	)
	ErrMissingMidPrice = errorsmod.Register(
		ModuleName,
		31,
		"Missing mid price for ClobPair",
	)
	ErrStatefulOrderCancellationAlreadyExists = errorsmod.Register(
		ModuleName,
		32,
		"Existing stateful order cancellation has higher-or-equal priority than the new one",
	)
	ErrClobPairAlreadyExists = errorsmod.Register(
		ModuleName,
		33,
		"ClobPair with id already exists",
	)
	ErrOrderConflictsWithClobPairStatus = errorsmod.Register(
		ModuleName,
		34,
		"Order conflicts with ClobPair status",
	)
	ErrInvalidClobPairStatusTransition = errorsmod.Register(
		ModuleName,
		35,
		"Invalid ClobPair status transition",
	)
	ErrOperationConflictsWithClobPairStatus = errorsmod.Register(
		ModuleName,
		36,
		"Operation conflicts with ClobPair status",
	)
	ErrPerpetualDoesNotExist = errorsmod.Register(
		ModuleName,
		37,
		"Perpetual does not exist in state",
	)
	ErrInvalidClobPairUpdate = errorsmod.Register(
		ModuleName,
		39,
		"ClobPair update is invalid",
	)
	ErrInvalidAuthority = errorsmod.Register(
		ModuleName,
		40,
		"Authority is invalid",
	)
	ErrPerpetualAssociatedWithExistingClobPair = errorsmod.Register(
		ModuleName,
		41,
		"perpetual ID is already associated with an existing CLOB pair",
	)
	ErrUnexpectedTimeInForce = errorsmod.Register(
		ModuleName,
		42,
		"Unexpected time in force",
	)
	ErrOrderHasRemainingSize = errorsmod.Register(
		ModuleName,
		43,
		"Order has remaining size",
	)

	// Liquidations errors.
	ErrInvalidLiquidationsConfig = errorsmod.Register(
		ModuleName,
		1000,
		"Proposed LiquidationsConfig is invalid",
	)
	ErrNoPerpetualPositionsToLiquidate = errorsmod.Register(
		ModuleName,
		1001,
		"Subaccount has no perpetual positions to liquidate",
	)
	ErrSubaccountNotLiquidatable = errorsmod.Register(
		ModuleName,
		1002,
		"Subaccount is not liquidatable",
	)
	ErrNoOpenPositionForPerpetual = errorsmod.Register(
		ModuleName,
		1003,
		"Subaccount does not have an open position for perpetual",
	)
	ErrInvalidLiquidationOrderTotalSize = errorsmod.Register(
		ModuleName,
		1004,
		"Liquidation order has invalid size",
	)
	ErrInvalidLiquidationOrderSide = errorsmod.Register(
		ModuleName,
		1005,
		"Liquidation order is on the wrong side",
	)
	ErrTotalFillAmountExceedsOrderSize = errorsmod.Register(
		ModuleName,
		1006,
		"Total fills amount exceeds size of liquidation order",
	)
	ErrLiquidationContainsNoFills = errorsmod.Register(
		ModuleName,
		1007,
		"Liquidation order does not contain any fills",
	)
	ErrSubaccountHasLiquidatedPerpetual = errorsmod.Register(
		ModuleName,
		1008,
		"Subaccount has previously liquidated this perpetual in the current block",
	)
	ErrLiquidationOrderSizeSmallerThanMin = errorsmod.Register(
		ModuleName,
		1009,
		"Liquidation order has size smaller than min position notional specified in the liquidation config",
	)
	ErrLiquidationOrderSizeGreaterThanMax = errorsmod.Register(
		ModuleName,
		1010,
		"Liquidation order has size greater than max position notional specified in the liquidation config",
	)
	ErrLiquidationExceedsSubaccountMaxNotionalLiquidated = errorsmod.Register(
		ModuleName,
		1011,
		"Liquidation exceeds the maximum notional amount that a single subaccount can have liquidated per block",
	)
	ErrLiquidationExceedsSubaccountMaxInsuranceLost = errorsmod.Register(
		ModuleName,
		1012,
		"Liquidation exceeds the maximum insurance fund payout amount for a given subaccount per block",
	)
	ErrInsuranceFundHasInsufficientFunds = errorsmod.Register(
		ModuleName,
		1013,
		"Insurance fund does not have sufficient funds to cover liquidation losses",
	)
	ErrInvalidPerpetualPositionSizeDelta = errorsmod.Register(
		ModuleName,
		1014,
		"Invalid perpetual position size delta",
	)
	ErrInvalidQuantumsForInsuranceFundDeltaCalculation = errorsmod.Register(
		ModuleName,
		1015,
		"Invalid delta base and/or quote quantums for insurance fund delta calculation",
	)
	ErrEmptyDeleveragingFills = errorsmod.Register(
		ModuleName,
		1016,
		"Deleveraging fills length must be greater than 0",
	)
	ErrDeleveragingAgainstSelf = errorsmod.Register(
		ModuleName,
		1017,
		"Cannot deleverage subaccount against itself",
	)
	ErrDuplicateDeleveragingFillSubaccounts = errorsmod.Register(
		ModuleName,
		1018,
		"Deleveraging match cannot have fills with same id",
	)
	ErrZeroDeleveragingFillAmount = errorsmod.Register(
		ModuleName,
		1019,
		"Deleveraging match cannot have fills with zero amount",
	)
	ErrPositionCannotBeFullyOffset = errorsmod.Register(
		ModuleName,
		1020,
		"Position cannot be fully offset",
	)

	// Advanced order type errors.
	ErrFokOrderCouldNotBeFullyFilled = errorsmod.Register(
		ModuleName,
		2000,
		"FillOrKill order could not be fully filled",
	)
	ErrReduceOnlyWouldIncreasePositionSize = errorsmod.Register(
		ModuleName,
		2001,
		"Reduce-only orders cannot increase the position size",
	)
	ErrReduceOnlyWouldChangePositionSide = errorsmod.Register(
		ModuleName,
		2002,
		"Reduce-only orders cannot change the position side",
	)
	ErrPostOnlyWouldCrossMakerOrder = errorsmod.Register(
		ModuleName,
		2003,
		"Post-only order would cross one or more maker orders",
	)
	ErrImmediateExecutionOrderAlreadyFilled = errorsmod.Register(
		ModuleName,
		2004,
		"IOC/FOK order is already filled, remaining size is cancelled.",
	)

	// Stateful order errors.
	ErrInvalidOrderFlag = errorsmod.Register(
		ModuleName,
		3000,
		"Invalid order flags",
	)
	ErrInvalidStatefulOrderGoodTilBlockTime = errorsmod.Register(
		ModuleName,
		3001,
		"Invalid order goodTilBlockTime",
	)
	ErrLongTermOrdersCannotRequireImmediateExecution = errorsmod.Register(
		ModuleName,
		3002,
		"Stateful orders cannot require immediate execution",
	)
	ErrTimeExceedsGoodTilBlockTime = errorsmod.Register(
		ModuleName,
		3003,
		"The block time is greater than the GoodTilBlockTime of the message",
	)
	ErrGoodTilBlockTimeExceedsStatefulOrderTimeWindow = errorsmod.Register(
		ModuleName,
		3004,
		"The GoodTilBlockTime of the message is further than StatefulOrderTimeWindow into the future",
	)
	ErrStatefulOrderAlreadyExists = errorsmod.Register(
		ModuleName,
		3005,
		"Existing stateful order has higher-or-equal priority than the new one",
	)
	ErrStatefulOrderDoesNotExist = errorsmod.Register(
		ModuleName,
		3006,
		"Stateful order does not exist",
	)
	ErrStatefulOrderCollateralizationCheckFailed = errorsmod.Register(
		ModuleName,
		3007,
		"Stateful order collateralization check failed",
	)
	ErrStatefulOrderPreviouslyCancelled = errorsmod.Register(
		ModuleName,
		3008,
		"Stateful order was previously cancelled and therefore cannot be placed",
	)
	ErrStatefulOrderPreviouslyRemoved = errorsmod.Register(
		ModuleName,
		3009,
		"Stateful order was previously removed and therefore cannot be placed",
	)
	ErrStatefulOrderCancellationFailedForAlreadyRemovedOrder = errorsmod.Register(
		ModuleName,
		3010,
		"Stateful order cancellation failed because the order was already removed from state",
	)

	// Operations Queue validation errors
	ErrInvalidMsgProposedOperations = errorsmod.Register(
		ModuleName,
		4000,
		"MsgProposedOperations is invalid",
	)
	ErrInvalidMatchOrder = errorsmod.Register(
		ModuleName,
		4001,
		"Match Order is invalid",
	)
	ErrOrderPlacementNotInOperationsQueue = errorsmod.Register(
		ModuleName,
		4002,
		"Order was not previously placed in operations queue",
	)
	ErrFillAmountIsZero = errorsmod.Register(
		ModuleName,
		4003,
		"Fill amount cannot be zero",
	)
	ErrInvalidDeleveragingFill = errorsmod.Register(
		ModuleName,
		4004,
		"Deleveraging fill is invalid",
	)
	ErrInvalidDeleveragedSubaccount = errorsmod.Register(
		ModuleName,
		4005,
		"Deleveraged subaccount in proposed deleveraged operation failed deleveraging validation",
	)
	ErrInvalidOrderRemoval = errorsmod.Register(
		ModuleName,
		4006,
		"Order Removal is invalid",
	)
	ErrInvalidOrderRemovalReason = errorsmod.Register(
		ModuleName,
		4007,
		"Order Removal reason is invalid",
	)

	// Block rate limit errors.
	ErrInvalidBlockRateLimitConfig = errorsmod.Register(
		ModuleName,
		5000,
		"Proposed BlockRateLimitConfig is invalid",
	)
	ErrBlockRateLimitExceeded = errorsmod.Register(
		ModuleName,
		5001,
		"Block rate limit exceeded",
	)

	// Conditional order errors.
	ErrInvalidConditionType = errorsmod.Register(
		ModuleName,
		6000,
		"Conditional type is invalid",
	)
	ErrInvalidConditionalOrderTriggerSubticks = errorsmod.Register(
		ModuleName,
		6001,
		"Conditional order trigger subticks is invalid",
	)
	ErrConditionalOrderUntriggered = errorsmod.Register(
		ModuleName,
		6002,
		"Conditional order is untriggered",
	)

	// Errors for unimplemented and disabled functionality.
	ErrAssetOrdersNotImplemented = errorsmod.Register(
		ModuleName,
		9000,
		"Asset orders are not implemented",
	)
	ErrAssetUpdateNotImplemented = errorsmod.Register(
		ModuleName,
		9001,
		"Updates for assets other than USDC are not implemented",
	)
	ErrNotImplemented = errorsmod.Register(
		ModuleName,
		9002,
		"This function is not implemented",
	)
	ErrReduceOnlyDisabled = errorsmod.Register(
		ModuleName,
		9003,
		"Reduce-only is currently disabled",
	)

	// Equity tier limit errors.
	ErrInvalidEquityTierLimitConfig = errorsmod.Register(
		ModuleName,
		10000,
		"Proposed EquityTierLimitConfig is invalid",
	)
	ErrOrderWouldExceedMaxOpenOrdersEquityTierLimit = errorsmod.Register(
		ModuleName,
		10001,
		"Subaccount cannot open more orders due to equity tier limit.",
	)
)

x/clob module sentinel errors TODO(CLOB-553) Clean up sentinel errors not in use.

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 (
	ErrInvalidLengthLiquidations        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLiquidations          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLiquidations = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthLiquidationsConfig        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLiquidationsConfig          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLiquidationsConfig = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMatches        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMatches          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMatches = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthMev        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMev          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMev = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthOperation        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowOperation          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupOperation = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthOrder        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowOrder          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupOrder = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthOrderRemovals        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowOrderRemovals          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupOrderRemovals = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthProcessProposerMatchesEvents        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowProcessProposerMatchesEvents          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupProcessProposerMatchesEvents = 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")
)
View Source
var ClobPair_Status_name = map[int32]string{
	0: "STATUS_UNSPECIFIED",
	1: "STATUS_ACTIVE",
	2: "STATUS_PAUSED",
	3: "STATUS_CANCEL_ONLY",
	4: "STATUS_POST_ONLY",
	5: "STATUS_INITIALIZING",
}
View Source
var ClobPair_Status_value = map[string]int32{
	"STATUS_UNSPECIFIED":  0,
	"STATUS_ACTIVE":       1,
	"STATUS_PAUSED":       2,
	"STATUS_CANCEL_ONLY":  3,
	"STATUS_POST_ONLY":    4,
	"STATUS_INITIALIZING": 5,
}
View Source
var (
	LiquidationsConfig_Default = LiquidationsConfig{
		MaxLiquidationFeePpm: 5_000,
		FillablePriceConfig: FillablePriceConfig{
			BankruptcyAdjustmentPpm:           lib.OneMillion,
			SpreadToMaintenanceMarginRatioPpm: 100_000,
		},
		PositionBlockLimits: PositionBlockLimits{
			MinPositionNotionalLiquidated:   1_000,
			MaxPositionPortionLiquidatedPpm: 1_000_000,
		},
		SubaccountBlockLimits: SubaccountBlockLimits{
			MaxNotionalLiquidated:    100_000_000_000_000,
			MaxQuantumsInsuranceLost: 100_000_000_000_000,
		},
	}
)
View Source
var OrderRemoval_RemovalReason_name = map[int32]string{
	0: "REMOVAL_REASON_UNSPECIFIED",
	1: "REMOVAL_REASON_UNDERCOLLATERALIZED",
	2: "REMOVAL_REASON_INVALID_REDUCE_ONLY",
	3: "REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER",
	4: "REMOVAL_REASON_INVALID_SELF_TRADE",
	5: "REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED",
	6: "REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK",
	7: "REMOVAL_REASON_FULLY_FILLED",
}
View Source
var OrderRemoval_RemovalReason_value = map[string]int32{
	"REMOVAL_REASON_UNSPECIFIED":                               0,
	"REMOVAL_REASON_UNDERCOLLATERALIZED":                       1,
	"REMOVAL_REASON_INVALID_REDUCE_ONLY":                       2,
	"REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER":         3,
	"REMOVAL_REASON_INVALID_SELF_TRADE":                        4,
	"REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED": 5,
	"REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK":        6,
	"REMOVAL_REASON_FULLY_FILLED":                              7,
}
View Source
var Order_ConditionType_name = map[int32]string{
	0: "CONDITION_TYPE_UNSPECIFIED",
	1: "CONDITION_TYPE_STOP_LOSS",
	2: "CONDITION_TYPE_TAKE_PROFIT",
}
View Source
var Order_ConditionType_value = map[string]int32{
	"CONDITION_TYPE_UNSPECIFIED": 0,
	"CONDITION_TYPE_STOP_LOSS":   1,
	"CONDITION_TYPE_TAKE_PROFIT": 2,
}
View Source
var Order_Side_name = map[int32]string{
	0: "SIDE_UNSPECIFIED",
	1: "SIDE_BUY",
	2: "SIDE_SELL",
}
View Source
var Order_Side_value = map[string]int32{
	"SIDE_UNSPECIFIED": 0,
	"SIDE_BUY":         1,
	"SIDE_SELL":        2,
}
View Source
var Order_TimeInForce_name = map[int32]string{
	0: "TIME_IN_FORCE_UNSPECIFIED",
	1: "TIME_IN_FORCE_IOC",
	2: "TIME_IN_FORCE_POST_ONLY",
	3: "TIME_IN_FORCE_FILL_OR_KILL",
}
View Source
var Order_TimeInForce_value = map[string]int32{
	"TIME_IN_FORCE_UNSPECIFIED":  0,
	"TIME_IN_FORCE_IOC":          1,
	"TIME_IN_FORCE_POST_ONLY":    2,
	"TIME_IN_FORCE_FILL_OR_KILL": 3,
}
View Source
var SupportedClobPairStatusTransitions = map[ClobPair_Status]map[ClobPair_Status]struct{}{
	ClobPair_STATUS_ACTIVE: {},
	ClobPair_STATUS_INITIALIZING: {
		ClobPair_STATUS_ACTIVE: struct{}{},
	},
}

SupportedClobPairStatusTransitions has keys corresponding to currently-supported ClobPair_Status types with values equal to the set of ClobPair_Status types that may be transitioned to from this state. Note the keys of this map may be a subset of the types defined in the proto for ClobPair_Status.

Functions

func FillAmountToQuoteQuantums

func FillAmountToQuoteQuantums(
	subticks Subticks,
	baseQuantums satypes.BaseQuantums,
	quantumConversionExponent int32,
) (bigNotional *big.Int)

FillAmountToQuoteQuantums converts a fill amount denoted in base quantums, to a price denoted in quote quantums given an order's subticks.

`subticks * 10^quantumConversionExponent` represents the price-per-base quantum of an order.

To convert from base to quote quantums, we use the following equation: `sizeQuoteQuantums = subticks * baseQuantums * 10^quantumConversionExponent`. Note that the result is rounded down.

Note: If `subticks`, `baseQuantums`, are small enough, `quantumConversionExponent` is negative, it's possible that this method returns `0` `quoteQuantums` for a non-zero amount of `baseQuantums`. This could mean that it's possible that a maker sell order on the book at a very unfavorable price (subticks) could receive `0` `quoteQuantums` amount. This case is unlikely to happen in a production environment as:

  • The maker orders would need to be placed at a very unfavorable price for the maker. There is no incentive for makers to place such orders.
  • The taker would need to place hundreds of thousands of transactions, filling the maker orders, in order to profit a single dollar of `quoteQuantums`.

func GetAveragePriceSubticks

func GetAveragePriceSubticks(
	bigQuoteQuantums *big.Int,
	bigBaseQuantums *big.Int,
	quantumConversionExponent int32,
) (bigSubticks *big.Rat)

GetAveragePriceSubticks computes the average price (in subticks) of filled amount in `quoteQuantums` and `baseQuantums`. To calculate quote quantums from base quantums and subticks, we use the following equation: `sizeQuoteQuantums = subticks * baseQuantums * 10^quantumConversionExponent`.

Thus, to get `subticks`: `subticks = sizeQuoteQuantums * 10^(-quantumConversionExponent) / baseQuantums`

This function panics if `bigBaseQuantums == 0`. The result of division is rounded down.

func GetInternalOperationsQueueTextString

func GetInternalOperationsQueueTextString(operations []InternalOperation) string

GetOperationsQueueString returns a string representation of the provided operations.

func IsSupportedClobPairStatus

func IsSupportedClobPairStatus(clobPairStatus ClobPair_Status) bool

IsSupportedClobPairStatus returns true if the provided ClobPair_Status is in the list of currently supported ClobPair_Status types. Else, returns false.

func IsSupportedClobPairStatusTransition

func IsSupportedClobPairStatusTransition(from ClobPair_Status, to ClobPair_Status) bool

IsSupportedClobPairStatusTransition returns true if it is considered valid to transition from the first provided ClobPair_Status to the second provided ClobPair_Status. Else, returns false.

func MustSortAndHaveNoDuplicates

func MustSortAndHaveNoDuplicates(orderIds []OrderId)

MustSortAndHaveNoDuplicates is a wrapper around SortedOrders, which is for deterministic sorting. Mutates input slice. This function checks for duplicate OrderIds first, and panics if a duplicate exists. Orders are first ordered by string comparison of their `Subaccount` owner, followed by integer comparison of their `Subaccount` number, followed by `ClientId` of the order, followed by `OrderFlags`, and finally by `ClobPairId` of the order.

func NewCreateMatchEvent

func NewCreateMatchEvent(
	taker satypes.SubaccountId,
	maker satypes.SubaccountId,
	takerOrderFee *big.Int,
	makerOrderFee *big.Int,
	takerQuoteBalanceDelta *big.Int,
	makerQuoteBalanceDelta *big.Int,
	takerPerpetualQuantumsDelta *big.Int,
	makerPerpetualQuantumsDelta *big.Int,
	insuranceFundDelta *big.Int,
	isLiquidation bool,
	isDeleverage bool,
	perpetualId uint32,
) sdk.Event

NewCreateMatchEvent constructs a new match sdk.Event.

func NotionalToCoinAmount

func NotionalToCoinAmount(
	notionalQuoteQuantums *big.Int,
	quoteAtomicResolution int32,
	denomExp int32,
	marketPrice pricestypes.MarketPrice,
) *big.Rat

NotionalToCoinAmount returns the coin amount (e.g. `uatom`) that has equal worth to the notional (in quote quantums). For example, given price of 9.5 USDC/ATOM, notional of 9_500_000 quote quantums, return 1_000_000 `uatom` (since `tokenDenomExp“=-6). Note the return value is in coin amount, which is different from base quantums.

Given the below by definitions:

quote_quantums * 10^quote_atomic_resolution = full_quote_coin_amount (e.g. 2_000_000 quote quantums * 10^-6 = 2 USDC)
coin_amount * 10^denom_exponent = full_coin_amount (e.g. 1_000_000 uatom * 10^-6 = 1 ATOM)
full_coin_amount * coin_price = full_quote_coin_amount (e.g. 1 ATOM * 9.5 USDC/ATOM = 9.5 USDC)

Therefore:

coin_amount * 10^denom_exponent * coin_price = quote_quantums * 10^quote_atomic_resolution
coin_amount = quote_quantums * 10^(quote_atomic_resolution - denom_exponent) / coin_price

func PriceToSubticks

func PriceToSubticks(
	marketPrice pricestypes.MarketPrice,
	clobPair ClobPair,
	baseAtomicResolution int32,
	quoteAtomicResolution int32,
) (
	ratSubticks *big.Rat,
)

PriceToSubticks converts price value from Prices module into subticks. By construction of the Clob module: `sizeQuoteQuantums = subticks * baseQuantums * 10^quantumConversionExponent` Substituting `baseQuantums` with a full coin of the base currency:

`usdcPrice * 10^(-quoteAtomicResolution) = subticks * 10^(-baseAtomicResolution) * 10^quantumConversionExponent` (A)

By construction of Prices module:

`usdcPrice = marketPrice.Price * 10^marketPrice.Exponent` (B)

Combining equations (A) & (B), we get:

`subticks = marketPrice.Price * 10^(marketPrice.Exponent - quantumConversionExponent + baseAtomicResolution - quoteAtomicResolution)`

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)

func SubticksToPrice

func SubticksToPrice(
	subticks Subticks,
	marketPriceExponent int32,
	clobPair ClobPair,
	baseAtomicResolution int32,
	quoteAtomicResolution int32,
) (
	price uint64,
)

SubticksToPrice converts subticks into price value from Prices module. By construction of the Clob module: `sizeQuoteQuantums = subticks * baseQuantums * 10^quantumConversionExponent` Substituting `baseQuantums` with a full coin of the base currency:

`usdcPrice * 10^(-quoteAtomicResolution) = subticks * 10^(-baseAtomicResolution) * 10^quantumConversionExponent` (A)

By construction of Prices module:

`usdcPrice = marketPrice.Price * 10^marketPrice.Exponent` (B)

Combining equations (A) & (B), we get:

`marketPrice.Price = subticks * 10^(-marketPrice.Exponent + quantumConversionExponent - baseAtomicResolution + quoteAtomicResolution)` Note this function rounds down in order to typecast into an int. It should really only be used in testing with well-defined integer subticks.

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
}

AccountKeeper defines the expected account keeper used for simulations.

type AddOrderToOrderbookCollateralizationCheckFn

type AddOrderToOrderbookCollateralizationCheckFn func(
	subaccountMatchedOrders map[satypes.SubaccountId][]PendingOpenOrder,
) (
	success bool,
	successPerSubaccountUpdate map[satypes.SubaccountId]satypes.UpdateResult,
)

AddOrderToOrderbookCollateralizationCheckFn defines a function interface that can be used for verifying one or more subaccounts are properly collateralized if their respective order(s) are matched. Returns the result of the collateralization check.

type AreSubaccountsLiquidatableRequest

type AreSubaccountsLiquidatableRequest struct {
	SubaccountIds []types.SubaccountId `protobuf:"bytes,1,rep,name=subaccount_ids,json=subaccountIds,proto3" json:"subaccount_ids"`
}

AreSubaccountsLiquidatableRequest is a request message used to check whether the given subaccounts are liquidatable. The subaccount ids should not contain duplicates.

func (*AreSubaccountsLiquidatableRequest) Descriptor

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

func (*AreSubaccountsLiquidatableRequest) GetSubaccountIds

func (m *AreSubaccountsLiquidatableRequest) GetSubaccountIds() []types.SubaccountId

func (*AreSubaccountsLiquidatableRequest) Marshal

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

func (*AreSubaccountsLiquidatableRequest) MarshalTo

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

func (*AreSubaccountsLiquidatableRequest) MarshalToSizedBuffer

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

func (*AreSubaccountsLiquidatableRequest) ProtoMessage

func (*AreSubaccountsLiquidatableRequest) ProtoMessage()

func (*AreSubaccountsLiquidatableRequest) Reset

func (*AreSubaccountsLiquidatableRequest) Size

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

func (*AreSubaccountsLiquidatableRequest) String

func (*AreSubaccountsLiquidatableRequest) Unmarshal

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

func (*AreSubaccountsLiquidatableRequest) XXX_DiscardUnknown

func (m *AreSubaccountsLiquidatableRequest) XXX_DiscardUnknown()

func (*AreSubaccountsLiquidatableRequest) XXX_Marshal

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

func (*AreSubaccountsLiquidatableRequest) XXX_Merge

func (*AreSubaccountsLiquidatableRequest) XXX_Size

func (m *AreSubaccountsLiquidatableRequest) XXX_Size() int

func (*AreSubaccountsLiquidatableRequest) XXX_Unmarshal

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

type AreSubaccountsLiquidatableResponse

type AreSubaccountsLiquidatableResponse struct {
	Results []AreSubaccountsLiquidatableResponse_Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results"`
}

AreSubaccountsLiquidatableResponse is a response message that contains the liquidation status for each subaccount.

func (*AreSubaccountsLiquidatableResponse) Descriptor

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

func (*AreSubaccountsLiquidatableResponse) GetResults

func (*AreSubaccountsLiquidatableResponse) Marshal

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

func (*AreSubaccountsLiquidatableResponse) MarshalTo

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

func (*AreSubaccountsLiquidatableResponse) MarshalToSizedBuffer

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

func (*AreSubaccountsLiquidatableResponse) ProtoMessage

func (*AreSubaccountsLiquidatableResponse) ProtoMessage()

func (*AreSubaccountsLiquidatableResponse) Reset

func (*AreSubaccountsLiquidatableResponse) Size

func (*AreSubaccountsLiquidatableResponse) String

func (*AreSubaccountsLiquidatableResponse) Unmarshal

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

func (*AreSubaccountsLiquidatableResponse) XXX_DiscardUnknown

func (m *AreSubaccountsLiquidatableResponse) XXX_DiscardUnknown()

func (*AreSubaccountsLiquidatableResponse) XXX_Marshal

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

func (*AreSubaccountsLiquidatableResponse) XXX_Merge

func (*AreSubaccountsLiquidatableResponse) XXX_Size

func (*AreSubaccountsLiquidatableResponse) XXX_Unmarshal

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

type AreSubaccountsLiquidatableResponse_Result

type AreSubaccountsLiquidatableResponse_Result struct {
	SubaccountId   types.SubaccountId `protobuf:"bytes,1,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id"`
	IsLiquidatable bool               `protobuf:"varint,2,opt,name=is_liquidatable,json=isLiquidatable,proto3" json:"is_liquidatable,omitempty"`
}

Result returns whether a subaccount should be liquidated.

func (*AreSubaccountsLiquidatableResponse_Result) Descriptor

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

func (*AreSubaccountsLiquidatableResponse_Result) GetIsLiquidatable

func (m *AreSubaccountsLiquidatableResponse_Result) GetIsLiquidatable() bool

func (*AreSubaccountsLiquidatableResponse_Result) GetSubaccountId

func (*AreSubaccountsLiquidatableResponse_Result) Marshal

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

func (*AreSubaccountsLiquidatableResponse_Result) MarshalTo

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

func (*AreSubaccountsLiquidatableResponse_Result) MarshalToSizedBuffer

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

func (*AreSubaccountsLiquidatableResponse_Result) ProtoMessage

func (*AreSubaccountsLiquidatableResponse_Result) Reset

func (*AreSubaccountsLiquidatableResponse_Result) Size

func (*AreSubaccountsLiquidatableResponse_Result) String

func (*AreSubaccountsLiquidatableResponse_Result) Unmarshal

func (*AreSubaccountsLiquidatableResponse_Result) XXX_DiscardUnknown

func (m *AreSubaccountsLiquidatableResponse_Result) XXX_DiscardUnknown()

func (*AreSubaccountsLiquidatableResponse_Result) XXX_Marshal

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

func (*AreSubaccountsLiquidatableResponse_Result) XXX_Merge

func (*AreSubaccountsLiquidatableResponse_Result) XXX_Size

func (*AreSubaccountsLiquidatableResponse_Result) XXX_Unmarshal

type AssetsKeeper

type AssetsKeeper interface {
	GetAsset(ctx sdk.Context, id uint32) (val assettypes.Asset, exists bool)
}

type BankKeeper

type BankKeeper interface {
	GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected bank keeper used for simulations.

type BlockRateLimitConfiguration

type BlockRateLimitConfiguration struct {
	// How many short term order attempts (successful and failed) are allowed for
	// an account per N blocks. Note that the rate limits are applied
	// in an AND fashion such that an order placement must pass all rate limit
	// configurations.
	//
	// Specifying 0 values disables this rate limit.
	MaxShortTermOrdersPerNBlocks []MaxPerNBlocksRateLimit `` /* 145-byte string literal not displayed */
	// How many stateful order attempts (successful and failed) are allowed for
	// an account per N blocks. Note that the rate limits are applied
	// in an AND fashion such that an order placement must pass all rate limit
	// configurations.
	//
	// Specifying 0 values disables this rate limit.
	MaxStatefulOrdersPerNBlocks []MaxPerNBlocksRateLimit `` /* 140-byte string literal not displayed */
	// How many short term order cancellation attempts (successful and failed) are
	// allowed for an account per N blocks. Note that the rate limits are
	// applied in an AND fashion such that an order cancellation must pass all
	// rate limit configurations.
	//
	// Specifying 0 values disables this rate limit.
	MaxShortTermOrderCancellationsPerNBlocks []MaxPerNBlocksRateLimit `` /* 183-byte string literal not displayed */
}

Defines the block rate limits for CLOB specific operations.

func (*BlockRateLimitConfiguration) Descriptor

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

func (*BlockRateLimitConfiguration) GetMaxShortTermOrderCancellationsPerNBlocks added in v0.3.0

func (m *BlockRateLimitConfiguration) GetMaxShortTermOrderCancellationsPerNBlocks() []MaxPerNBlocksRateLimit

func (*BlockRateLimitConfiguration) GetMaxShortTermOrdersPerNBlocks added in v0.3.0

func (m *BlockRateLimitConfiguration) GetMaxShortTermOrdersPerNBlocks() []MaxPerNBlocksRateLimit

func (*BlockRateLimitConfiguration) GetMaxStatefulOrdersPerNBlocks

func (m *BlockRateLimitConfiguration) GetMaxStatefulOrdersPerNBlocks() []MaxPerNBlocksRateLimit

func (*BlockRateLimitConfiguration) Marshal

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

func (*BlockRateLimitConfiguration) MarshalTo

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

func (*BlockRateLimitConfiguration) MarshalToSizedBuffer

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

func (*BlockRateLimitConfiguration) ProtoMessage

func (*BlockRateLimitConfiguration) ProtoMessage()

func (*BlockRateLimitConfiguration) Reset

func (m *BlockRateLimitConfiguration) Reset()

func (*BlockRateLimitConfiguration) Size

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

func (*BlockRateLimitConfiguration) String

func (m *BlockRateLimitConfiguration) String() string

func (*BlockRateLimitConfiguration) Unmarshal

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

func (BlockRateLimitConfiguration) Validate

func (lc BlockRateLimitConfiguration) Validate() error

Validate validates each individual MaxPerNBlocksRateLimit. It returns an error if any of the rate limits fail the following validations:

  • `Limit == 0` || `Limit > MaxShortTermOrdersPerNBlocksLimit` for short term order rate limits.
  • `NumBlocks == 0` || `NumBlocks > MaxShortTermOrdersPerNBlocksNumBlocks` for short term order rate limits.
  • `Limit == 0` || `Limit > MaxStatefulOrdersPerNBlocksLimit` for stateful order rate limits.
  • `NumBlocks == 0` || `NumBlocks > MaxStatefulOrdersPerNBlocksNumBlocks` for stateful order rate limits.
  • `Limit == 0` || `Limit > MaxShortTermOrderCancellationsPerNBlocksNumBlocks` for short term order cancellation rate limits.
  • `NumBlocks == 0` || `NumBlocks > MaxShortTermOrderCancellationsPerNBlocksLimit` for short term order cancellation rate limits.
  • There are multiple rate limits for the same `NumBlocks` in `MaxShortTermOrdersPerNBlocks`, `MaxStatefulOrdersPerNBlocks`, or `MaxShortTermOrderCancellationsPerNBlocks`.

func (*BlockRateLimitConfiguration) XXX_DiscardUnknown

func (m *BlockRateLimitConfiguration) XXX_DiscardUnknown()

func (*BlockRateLimitConfiguration) XXX_Marshal

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

func (*BlockRateLimitConfiguration) XXX_Merge

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

func (*BlockRateLimitConfiguration) XXX_Size

func (m *BlockRateLimitConfiguration) XXX_Size() int

func (*BlockRateLimitConfiguration) XXX_Unmarshal

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

type BlockTimeKeeper

type BlockTimeKeeper interface {
	GetPreviousBlockInfo(ctx sdk.Context) blocktimetypes.BlockInfo
}

type ClobKeeper

type ClobKeeper interface {
	LiquidationsKeeper
	LiquidationsConfigKeeper

	AddOrderToOrderbookCollatCheck(
		ctx sdk.Context,
		clobPairId ClobPairId,
		subaccountOpenOrders map[satypes.SubaccountId][]PendingOpenOrder,
	) (
		success bool,
		successPerUpdate map[satypes.SubaccountId]satypes.UpdateResult,
	)
	CancelShortTermOrder(ctx sdk.Context, msg *MsgCancelOrder) error
	CancelStatefulOrder(ctx sdk.Context, msg *MsgCancelOrder) error
	CreatePerpetualClobPair(
		ctx sdk.Context,
		clobPairId uint32,
		perpetualId uint32,
		stepSizeInBaseQuantums satypes.BaseQuantums,
		quantumConversionExponent int32,
		subticksPerTick uint32,
		status ClobPair_Status,
	) (
		ClobPair,
		error,
	)
	GetAllClobPairs(ctx sdk.Context) (list []ClobPair)
	GetClobPair(ctx sdk.Context, id ClobPairId) (val ClobPair, found bool)
	HasAuthority(authority string) bool
	PlaceShortTermOrder(ctx sdk.Context, msg *MsgPlaceOrder) (
		orderSizeOptimisticallyFilledFromMatchingQuantums satypes.BaseQuantums,
		orderStatus OrderStatus,
		err error,
	)
	PlaceStatefulOrder(ctx sdk.Context, msg *MsgPlaceOrder) error
	PruneStateFillAmountsForShortTermOrders(
		ctx sdk.Context,
	)

	RemoveClobPair(ctx sdk.Context, id ClobPairId)
	ProcessProposerOperations(
		ctx sdk.Context,
		operations []OperationRaw,
	) error
	GetStatePosition(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		clobPairId ClobPairId,
	) (
		positionSizeQuantums *big.Int,
	)
	ProcessSingleMatch(
		ctx sdk.Context,
		matchWithOrders *MatchWithOrders,
	) (
		success bool,
		takerUpdateResult satypes.UpdateResult,
		makerUpdateResult satypes.UpdateResult,
		offchainUpdates *OffchainUpdates,
		err error,
	)
	SetLongTermOrderPlacement(
		ctx sdk.Context,
		order Order,
		blockHeight uint32,
	)
	GetLongTermOrderPlacement(
		ctx sdk.Context,
		orderId OrderId,
	) (val LongTermOrderPlacement, found bool)
	DeleteLongTermOrderPlacement(
		ctx sdk.Context,
		orderId OrderId,
	)
	RemoveOrderFillAmount(ctx sdk.Context, orderId OrderId)
	MustAddOrderToStatefulOrdersTimeSlice(
		ctx sdk.Context,
		goodTilBlockTime time.Time,
		orderId OrderId,
	)
	GetStatefulOrdersTimeSlice(ctx sdk.Context, goodTilBlockTime time.Time) (
		orderIds []OrderId,
	)
	MustRemoveStatefulOrder(
		ctx sdk.Context,
		orderId OrderId,
	)
	RemoveExpiredStatefulOrdersTimeSlices(ctx sdk.Context, blockTime time.Time) (
		expiredOrderIds []OrderId,
	)
	GetProcessProposerMatchesEvents(ctx sdk.Context) ProcessProposerMatchesEvents
	MustSetProcessProposerMatchesEvents(
		ctx sdk.Context,
		processProposerMatchesEvents ProcessProposerMatchesEvents,
	)
	PerformOrderCancellationStatefulValidation(
		ctx sdk.Context,
		msgCancelOrder *MsgCancelOrder,
		blockHeight uint32,
	) error
	PerformStatefulOrderValidation(
		ctx sdk.Context,
		order *Order,
		blockHeight uint32,
		isPreexistingStatefulOrder bool,
	) error
	GetIndexerEventManager() indexer_manager.IndexerEventManager
	RateLimitCancelOrder(ctx sdk.Context, order *MsgCancelOrder) error
	RateLimitPlaceOrder(ctx sdk.Context, order *MsgPlaceOrder) error
	InitializeBlockRateLimit(ctx sdk.Context, config BlockRateLimitConfiguration) error
	InitializeEquityTierLimit(ctx sdk.Context, config EquityTierLimitConfiguration) error
	Logger(ctx sdk.Context) log.Logger
	UpdateClobPair(
		ctx sdk.Context,
		clobPair ClobPair,
	) error
	UpdateLiquidationsConfig(ctx sdk.Context, config LiquidationsConfig) error
}

type ClobMatch

type ClobMatch struct {
	// The match type that this message includes.
	//
	// Types that are valid to be assigned to Match:
	//	*ClobMatch_MatchOrders
	//	*ClobMatch_MatchPerpetualLiquidation
	//	*ClobMatch_MatchPerpetualDeleveraging
	Match isClobMatch_Match `protobuf_oneof:"match"`
}

ClobMatch represents an operations queue entry around all different types of matches, specifically regular matches, liquidation matches, and deleveraging matches.

func NewClobMatchFromMatchOrders

func NewClobMatchFromMatchOrders(
	msgMatchOrders *MatchOrders,
) *ClobMatch

NewClobMatchFromMatchOrders creates a `ClobMatch` from the provided `MatchOrders`.

func NewClobMatchFromMatchPerpetualLiquidation

func NewClobMatchFromMatchPerpetualLiquidation(
	msgMatchPerpetualLiquidation *MatchPerpetualLiquidation,
) *ClobMatch

NewClobMatchFromMatchPerpetualLiquidation creates a `ClobMatch` from the provided `MatchPerpetualLiquidation`.

func (*ClobMatch) Descriptor

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

func (*ClobMatch) GetMatch

func (m *ClobMatch) GetMatch() isClobMatch_Match

func (*ClobMatch) GetMatchOrders

func (m *ClobMatch) GetMatchOrders() *MatchOrders

func (*ClobMatch) GetMatchPerpetualDeleveraging

func (m *ClobMatch) GetMatchPerpetualDeleveraging() *MatchPerpetualDeleveraging

func (*ClobMatch) GetMatchPerpetualLiquidation

func (m *ClobMatch) GetMatchPerpetualLiquidation() *MatchPerpetualLiquidation

func (*ClobMatch) Marshal

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

func (*ClobMatch) MarshalTo

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

func (*ClobMatch) MarshalToSizedBuffer

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

func (*ClobMatch) ProtoMessage

func (*ClobMatch) ProtoMessage()

func (*ClobMatch) Reset

func (m *ClobMatch) Reset()

func (*ClobMatch) Size

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

func (*ClobMatch) String

func (m *ClobMatch) String() string

func (*ClobMatch) Unmarshal

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

func (*ClobMatch) XXX_DiscardUnknown

func (m *ClobMatch) XXX_DiscardUnknown()

func (*ClobMatch) XXX_Marshal

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

func (*ClobMatch) XXX_Merge

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

func (*ClobMatch) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*ClobMatch) XXX_Size

func (m *ClobMatch) XXX_Size() int

func (*ClobMatch) XXX_Unmarshal

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

type ClobMatch_MatchOrders

type ClobMatch_MatchOrders struct {
	MatchOrders *MatchOrders `protobuf:"bytes,1,opt,name=match_orders,json=matchOrders,proto3,oneof" json:"match_orders,omitempty"`
}

func (*ClobMatch_MatchOrders) MarshalTo

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

func (*ClobMatch_MatchOrders) MarshalToSizedBuffer

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

func (*ClobMatch_MatchOrders) Size

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

type ClobMatch_MatchPerpetualDeleveraging

type ClobMatch_MatchPerpetualDeleveraging struct {
	MatchPerpetualDeleveraging *MatchPerpetualDeleveraging `` /* 147-byte string literal not displayed */
}

func (*ClobMatch_MatchPerpetualDeleveraging) MarshalTo

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

func (*ClobMatch_MatchPerpetualDeleveraging) MarshalToSizedBuffer

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

func (*ClobMatch_MatchPerpetualDeleveraging) Size

type ClobMatch_MatchPerpetualLiquidation

type ClobMatch_MatchPerpetualLiquidation struct {
	MatchPerpetualLiquidation *MatchPerpetualLiquidation `` /* 144-byte string literal not displayed */
}

func (*ClobMatch_MatchPerpetualLiquidation) MarshalTo

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

func (*ClobMatch_MatchPerpetualLiquidation) MarshalToSizedBuffer

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

func (*ClobMatch_MatchPerpetualLiquidation) Size

type ClobMidPrice

type ClobMidPrice struct {
	ClobPair ClobPair `protobuf:"bytes,1,opt,name=clob_pair,json=clobPair,proto3" json:"clob_pair"`
	Subticks uint64   `protobuf:"varint,2,opt,name=subticks,proto3" json:"subticks,omitempty"`
}

ClobMidPrice contains the mid price of a CLOB pair, represented by it's ID.

func (*ClobMidPrice) Descriptor

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

func (*ClobMidPrice) GetClobPair

func (m *ClobMidPrice) GetClobPair() ClobPair

func (*ClobMidPrice) GetSubticks

func (m *ClobMidPrice) GetSubticks() uint64

func (*ClobMidPrice) Marshal

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

func (*ClobMidPrice) MarshalTo

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

func (*ClobMidPrice) MarshalToSizedBuffer

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

func (*ClobMidPrice) ProtoMessage

func (*ClobMidPrice) ProtoMessage()

func (*ClobMidPrice) Reset

func (m *ClobMidPrice) Reset()

func (*ClobMidPrice) Size

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

func (*ClobMidPrice) String

func (m *ClobMidPrice) String() string

func (*ClobMidPrice) Unmarshal

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

func (*ClobMidPrice) XXX_DiscardUnknown

func (m *ClobMidPrice) XXX_DiscardUnknown()

func (*ClobMidPrice) XXX_Marshal

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

func (*ClobMidPrice) XXX_Merge

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

func (*ClobMidPrice) XXX_Size

func (m *ClobMidPrice) XXX_Size() int

func (*ClobMidPrice) XXX_Unmarshal

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

type ClobOrder

type ClobOrder struct {
	// The order that is resting on the CLOB.
	Order Order
	// The signature on the transaction containing the `MsgPlaceOrder` message,
	// from the user who placed this order [PENDING ABCI++].
	Signature []byte
}

ClobOrder represents an order that is resting on the CLOB.

type ClobPair

type ClobPair struct {
	// ID of the orderbook that stores all resting liquidity for this CLOB.
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// Product-specific metadata. Perpetual CLOBs will have
	// PerpetualClobMetadata, and Spot CLOBs will have SpotClobMetadata.
	//
	// Types that are valid to be assigned to Metadata:
	//
	//	*ClobPair_PerpetualClobMetadata
	//	*ClobPair_SpotClobMetadata
	Metadata isClobPair_Metadata `protobuf_oneof:"metadata"`
	// Minimum increment in the size of orders on the CLOB, in base quantums.
	StepBaseQuantums uint64 `protobuf:"varint,4,opt,name=step_base_quantums,json=stepBaseQuantums,proto3" json:"step_base_quantums,omitempty"`
	// Defines the tick size of the orderbook by defining how many subticks
	// are in one tick. That is, the subticks of any valid order must be a
	// multiple of this value. Generally this value should start `>= 100`to
	// allow room for decreasing it.
	SubticksPerTick uint32 `protobuf:"varint,5,opt,name=subticks_per_tick,json=subticksPerTick,proto3" json:"subticks_per_tick,omitempty"`
	// `10^Exponent` gives the number of QuoteQuantums traded per BaseQuantum
	// per Subtick.
	QuantumConversionExponent int32           `` /* 141-byte string literal not displayed */
	Status                    ClobPair_Status `protobuf:"varint,7,opt,name=status,proto3,enum=dydxprotocol.clob.ClobPair_Status" json:"status,omitempty"`
}

ClobPair represents a single CLOB pair for a given product in state.

func (*ClobPair) Descriptor

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

func (*ClobPair) GetClobPairId

func (c *ClobPair) GetClobPairId() ClobPairId

GetId returns the `ClobPairId` for the provided `clobPair`.

func (*ClobPair) GetClobPairMinOrderBaseQuantums

func (c *ClobPair) GetClobPairMinOrderBaseQuantums() satypes.BaseQuantums

func (*ClobPair) GetClobPairSubticksPerTick

func (c *ClobPair) GetClobPairSubticksPerTick() SubticksPerTick

func (*ClobPair) GetId

func (m *ClobPair) GetId() uint32

func (*ClobPair) GetMetadata

func (m *ClobPair) GetMetadata() isClobPair_Metadata

func (*ClobPair) GetPerpetualClobMetadata

func (m *ClobPair) GetPerpetualClobMetadata() *PerpetualClobMetadata

func (*ClobPair) GetPerpetualId

func (c *ClobPair) GetPerpetualId() (uint32, error)

GetPerpetualId returns the `PerpetualId` for the provided `clobPair`.

func (*ClobPair) GetQuantumConversionExponent

func (m *ClobPair) GetQuantumConversionExponent() int32

func (*ClobPair) GetSpotClobMetadata

func (m *ClobPair) GetSpotClobMetadata() *SpotClobMetadata

func (*ClobPair) GetStatus

func (m *ClobPair) GetStatus() ClobPair_Status

func (*ClobPair) GetStepBaseQuantums

func (m *ClobPair) GetStepBaseQuantums() uint64

func (*ClobPair) GetSubticksPerTick

func (m *ClobPair) GetSubticksPerTick() uint32

func (*ClobPair) Marshal

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

func (*ClobPair) MarshalTo

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

func (*ClobPair) MarshalToSizedBuffer

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

func (*ClobPair) MustGetPerpetualId

func (c *ClobPair) MustGetPerpetualId() uint32

MustGetPerpetualId returns the `PerpetualId` for the provided `clobPair`. Will panic if `GetPerpetualId` returns an error.

func (*ClobPair) ProtoMessage

func (*ClobPair) ProtoMessage()

func (*ClobPair) Reset

func (m *ClobPair) Reset()

func (*ClobPair) Size

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

func (*ClobPair) String

func (m *ClobPair) String() string

func (*ClobPair) Unmarshal

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

func (*ClobPair) Validate

func (c *ClobPair) Validate() error

Stateless validation on ClobPair.

func (*ClobPair) XXX_DiscardUnknown

func (m *ClobPair) XXX_DiscardUnknown()

func (*ClobPair) XXX_Marshal

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

func (*ClobPair) XXX_Merge

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

func (*ClobPair) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*ClobPair) XXX_Size

func (m *ClobPair) XXX_Size() int

func (*ClobPair) XXX_Unmarshal

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

type ClobPairId

type ClobPairId uint32

func (ClobPairId) ToUint32

func (cp ClobPairId) ToUint32() uint32

type ClobPair_PerpetualClobMetadata

type ClobPair_PerpetualClobMetadata struct {
	PerpetualClobMetadata *PerpetualClobMetadata `` /* 132-byte string literal not displayed */
}

func (*ClobPair_PerpetualClobMetadata) MarshalTo

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

func (*ClobPair_PerpetualClobMetadata) MarshalToSizedBuffer

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

func (*ClobPair_PerpetualClobMetadata) Size

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

type ClobPair_SpotClobMetadata

type ClobPair_SpotClobMetadata struct {
	SpotClobMetadata *SpotClobMetadata `protobuf:"bytes,3,opt,name=spot_clob_metadata,json=spotClobMetadata,proto3,oneof" json:"spot_clob_metadata,omitempty"`
}

func (*ClobPair_SpotClobMetadata) MarshalTo

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

func (*ClobPair_SpotClobMetadata) MarshalToSizedBuffer

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

func (*ClobPair_SpotClobMetadata) Size

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

type ClobPair_Status

type ClobPair_Status int32

Status of the CLOB.

const (
	// Default value. This value is invalid and unused.
	ClobPair_STATUS_UNSPECIFIED ClobPair_Status = 0
	// STATUS_ACTIVE represents an active clob pair.
	ClobPair_STATUS_ACTIVE ClobPair_Status = 1
	// STATUS_PAUSED behavior is unfinalized.
	// TODO(DEC-600): update this documentation.
	ClobPair_STATUS_PAUSED ClobPair_Status = 2
	// STATUS_CANCEL_ONLY behavior is unfinalized.
	// TODO(DEC-600): update this documentation.
	ClobPair_STATUS_CANCEL_ONLY ClobPair_Status = 3
	// STATUS_POST_ONLY behavior is unfinalized.
	// TODO(DEC-600): update this documentation.
	ClobPair_STATUS_POST_ONLY ClobPair_Status = 4
	// STATUS_INITIALIZING represents a newly-added clob pair.
	// Clob pairs in this state only accept orders which are
	// both short-term and post-only.
	ClobPair_STATUS_INITIALIZING ClobPair_Status = 5
)

func (ClobPair_Status) EnumDescriptor

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

func (ClobPair_Status) String

func (x ClobPair_Status) String() string

type ConditionalOrderPlacement

type ConditionalOrderPlacement struct {
	Order Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order"`
	// The block height and transaction index at which the order was placed.
	PlacementIndex TransactionOrdering `protobuf:"bytes,2,opt,name=placement_index,json=placementIndex,proto3" json:"placement_index"`
	// The block height and transaction index at which the order was triggered.
	// Set to be nil if the transaction has not been triggered.
	// Used for ordering by time priority when the chain is restarted.
	TriggerIndex *TransactionOrdering `protobuf:"bytes,3,opt,name=trigger_index,json=triggerIndex,proto3" json:"trigger_index,omitempty"`
}

ConditionalOrderPlacement represents the placement of a conditional order in state. It stores the stateful order itself, the `BlockHeight` and `TransactionIndex` at which the order was placed and triggered.

func (*ConditionalOrderPlacement) Descriptor

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

func (*ConditionalOrderPlacement) GetOrder

func (m *ConditionalOrderPlacement) GetOrder() Order

func (*ConditionalOrderPlacement) GetPlacementIndex

func (m *ConditionalOrderPlacement) GetPlacementIndex() TransactionOrdering

func (*ConditionalOrderPlacement) GetTransactionIndex

func (orderPlacement *ConditionalOrderPlacement) GetTransactionIndex() TransactionOrdering

GetTransactionIndex returns a ConditionalOrderPlacement's TransactionOrdering. If the conditional order is triggered, the trigger index is used. If the conditional order is placed but not triggered, the placement index is used.

func (*ConditionalOrderPlacement) GetTriggerIndex

func (m *ConditionalOrderPlacement) GetTriggerIndex() *TransactionOrdering

func (*ConditionalOrderPlacement) Marshal

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

func (*ConditionalOrderPlacement) MarshalTo

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

func (*ConditionalOrderPlacement) MarshalToSizedBuffer

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

func (*ConditionalOrderPlacement) ProtoMessage

func (*ConditionalOrderPlacement) ProtoMessage()

func (*ConditionalOrderPlacement) Reset

func (m *ConditionalOrderPlacement) Reset()

func (*ConditionalOrderPlacement) Size

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

func (*ConditionalOrderPlacement) String

func (m *ConditionalOrderPlacement) String() string

func (*ConditionalOrderPlacement) Unmarshal

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

func (*ConditionalOrderPlacement) XXX_DiscardUnknown

func (m *ConditionalOrderPlacement) XXX_DiscardUnknown()

func (*ConditionalOrderPlacement) XXX_Marshal

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

func (*ConditionalOrderPlacement) XXX_Merge

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

func (*ConditionalOrderPlacement) XXX_Size

func (m *ConditionalOrderPlacement) XXX_Size() int

func (*ConditionalOrderPlacement) XXX_Unmarshal

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

type EquityTierLimit

type EquityTierLimit struct {
	// The total net collateral in USDC quote quantums of equity required.
	UsdTncRequired github_com_dydxprotocol_v4_chain_protocol_dtypes.SerializableInt `` /* 171-byte string literal not displayed */
	// What the limit is for `usd_tnc_required`.
	Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
}

Defines an equity tier limit.

func (*EquityTierLimit) Descriptor

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

func (*EquityTierLimit) GetLimit

func (m *EquityTierLimit) GetLimit() uint32

func (*EquityTierLimit) Marshal

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

func (*EquityTierLimit) MarshalTo

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

func (*EquityTierLimit) MarshalToSizedBuffer

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

func (*EquityTierLimit) ProtoMessage

func (*EquityTierLimit) ProtoMessage()

func (*EquityTierLimit) Reset

func (m *EquityTierLimit) Reset()

func (*EquityTierLimit) Size

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

func (*EquityTierLimit) String

func (m *EquityTierLimit) String() string

func (*EquityTierLimit) Unmarshal

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

func (*EquityTierLimit) XXX_DiscardUnknown

func (m *EquityTierLimit) XXX_DiscardUnknown()

func (*EquityTierLimit) XXX_Marshal

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

func (*EquityTierLimit) XXX_Merge

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

func (*EquityTierLimit) XXX_Size

func (m *EquityTierLimit) XXX_Size() int

func (*EquityTierLimit) XXX_Unmarshal

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

type EquityTierLimitConfiguration

type EquityTierLimitConfiguration struct {
	// How many short term stateful orders are allowed per equity tier.
	// Specifying 0 values disables this limit.
	ShortTermOrderEquityTiers []EquityTierLimit `` /* 132-byte string literal not displayed */
	// How many open stateful orders are allowed per equity tier.
	// Specifying 0 values disables this limit.
	StatefulOrderEquityTiers []EquityTierLimit `` /* 127-byte string literal not displayed */
}

Defines the set of equity tiers to limit how many open orders a subaccount is allowed to have.

func (*EquityTierLimitConfiguration) Descriptor

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

func (*EquityTierLimitConfiguration) GetShortTermOrderEquityTiers

func (m *EquityTierLimitConfiguration) GetShortTermOrderEquityTiers() []EquityTierLimit

func (*EquityTierLimitConfiguration) GetStatefulOrderEquityTiers

func (m *EquityTierLimitConfiguration) GetStatefulOrderEquityTiers() []EquityTierLimit

func (EquityTierLimitConfiguration) Initialize

func (lc EquityTierLimitConfiguration) Initialize()

Initialize ensures the fields are ordered by the application requirements:

  • ShortTermOrderEquityTiers by UsdTncRequired in ascending order.
  • StatefulOrderEquityTiers by UsdTncRequired in ascending order.

func (*EquityTierLimitConfiguration) Marshal

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

func (*EquityTierLimitConfiguration) MarshalTo

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

func (*EquityTierLimitConfiguration) MarshalToSizedBuffer

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

func (*EquityTierLimitConfiguration) ProtoMessage

func (*EquityTierLimitConfiguration) ProtoMessage()

func (*EquityTierLimitConfiguration) Reset

func (m *EquityTierLimitConfiguration) Reset()

func (*EquityTierLimitConfiguration) Size

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

func (*EquityTierLimitConfiguration) String

func (*EquityTierLimitConfiguration) Unmarshal

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

func (EquityTierLimitConfiguration) Validate

func (lc EquityTierLimitConfiguration) Validate() error

Validate validates each individual EquityTierLimit. It returns an error if any of the equity tier limits fail the following validations:

  • `Limit > MaxShortTermOrdersForEquityTier` for short term order equity tier limits.
  • `Limit > MaxStatefulOrdersPerEquityTier` for stateful order equity tier limits.
  • There are multiple equity tier limits for the same `UsdTncRequired` in `ShortTermOrderEquityTiers`, or `StatefulOrderEquityTiers`.

func (*EquityTierLimitConfiguration) XXX_DiscardUnknown

func (m *EquityTierLimitConfiguration) XXX_DiscardUnknown()

func (*EquityTierLimitConfiguration) XXX_Marshal

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

func (*EquityTierLimitConfiguration) XXX_Merge

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

func (*EquityTierLimitConfiguration) XXX_Size

func (m *EquityTierLimitConfiguration) XXX_Size() int

func (*EquityTierLimitConfiguration) XXX_Unmarshal

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

type FeeTiersKeeper

type FeeTiersKeeper interface {
	GetPerpetualFeePpm(ctx sdk.Context, address string, isTaker bool) int32
}

type FillType

type FillType uint

FillType represents the type of the fill.

const (
	Trade FillType = iota
	PerpetualLiquidate
	PerpetualDeleverage
)

type FillablePriceConfig

type FillablePriceConfig struct {
	// The rate at which the Adjusted Bankruptcy Rating increases.
	BankruptcyAdjustmentPpm uint32 `` /* 133-byte string literal not displayed */
	// The maximum value that the liquidation spread can take, as
	// a ratio against the position's maintenance margin.
	SpreadToMaintenanceMarginRatioPpm uint32 `` /* 169-byte string literal not displayed */
}

FillablePriceConfig stores all configurable fields related to calculating the fillable price for liquidating a position.

func (*FillablePriceConfig) Descriptor

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

func (*FillablePriceConfig) GetBankruptcyAdjustmentPpm

func (m *FillablePriceConfig) GetBankruptcyAdjustmentPpm() uint32

func (*FillablePriceConfig) GetSpreadToMaintenanceMarginRatioPpm

func (m *FillablePriceConfig) GetSpreadToMaintenanceMarginRatioPpm() uint32

func (*FillablePriceConfig) Marshal

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

func (*FillablePriceConfig) MarshalTo

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

func (*FillablePriceConfig) MarshalToSizedBuffer

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

func (*FillablePriceConfig) ProtoMessage

func (*FillablePriceConfig) ProtoMessage()

func (*FillablePriceConfig) Reset

func (m *FillablePriceConfig) Reset()

func (*FillablePriceConfig) Size

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

func (*FillablePriceConfig) String

func (m *FillablePriceConfig) String() string

func (*FillablePriceConfig) Unmarshal

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

func (*FillablePriceConfig) XXX_DiscardUnknown

func (m *FillablePriceConfig) XXX_DiscardUnknown()

func (*FillablePriceConfig) XXX_Marshal

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

func (*FillablePriceConfig) XXX_Merge

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

func (*FillablePriceConfig) XXX_Size

func (m *FillablePriceConfig) XXX_Size() int

func (*FillablePriceConfig) XXX_Unmarshal

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

type GenesisState

type GenesisState struct {
	ClobPairs             []ClobPair                   `protobuf:"bytes,1,rep,name=clob_pairs,json=clobPairs,proto3" json:"clob_pairs"`
	LiquidationsConfig    LiquidationsConfig           `protobuf:"bytes,2,opt,name=liquidations_config,json=liquidationsConfig,proto3" json:"liquidations_config"`
	BlockRateLimitConfig  BlockRateLimitConfiguration  `protobuf:"bytes,3,opt,name=block_rate_limit_config,json=blockRateLimitConfig,proto3" json:"block_rate_limit_config"`
	EquityTierLimitConfig EquityTierLimitConfiguration `protobuf:"bytes,4,opt,name=equity_tier_limit_config,json=equityTierLimitConfig,proto3" json:"equity_tier_limit_config"`
}

GenesisState defines the clob 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) GetBlockRateLimitConfig

func (m *GenesisState) GetBlockRateLimitConfig() BlockRateLimitConfiguration

func (*GenesisState) GetClobPairs

func (m *GenesisState) GetClobPairs() []ClobPair

func (*GenesisState) GetEquityTierLimitConfig

func (m *GenesisState) GetEquityTierLimitConfig() EquityTierLimitConfiguration

func (*GenesisState) GetLiquidationsConfig

func (m *GenesisState) GetLiquidationsConfig() LiquidationsConfig

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 GetStatePositionFn

type GetStatePositionFn func(
	subaccountId satypes.SubaccountId,
	clobPairId ClobPairId,
) (
	positionSizeQuantums *big.Int,
)

GetStatePositionFn defines a function interface that can be used for getting the position size of an order in state. It is used for determining whether reduce-only orders need to be resized or canceled.

type InternalOperation

type InternalOperation struct {
	// operation represents the operation that occurred, which can be a match,
	// Short-Term order placement, or the placement of a pre-existing stateful
	// order.
	//
	// Types that are valid to be assigned to Operation:
	//
	//	*InternalOperation_Match
	//	*InternalOperation_ShortTermOrderPlacement
	//	*InternalOperation_PreexistingStatefulOrder
	//	*InternalOperation_OrderRemoval
	Operation isInternalOperation_Operation `protobuf_oneof:"operation"`
}

InternalOperation represents an internal operation in the operations to propose. InternalOperation is used internally within the memclob only.

func NewMatchOrdersInternalOperation

func NewMatchOrdersInternalOperation(
	takerOrder Order,
	makerFills []MakerFill,
) InternalOperation

NewMatchOrdersInternalOperation returns a new operation for matching maker orders against a taker order. This function panics if there are zero maker fills.

func NewMatchPerpetualDeleveragingInternalOperation

func NewMatchPerpetualDeleveragingInternalOperation(
	liquidatedSubaccountId satypes.SubaccountId,
	perpetualId uint32,
	fills []MatchPerpetualDeleveraging_Fill,
) InternalOperation

NewMatchPerpetualDeleveragingInternalOperation returns a new operation for deleveraging liquidated subaccount's position against one or more offsetting subaccounts. This function panics if there are zero maker fills.

func NewMatchPerpetualLiquidationInternalOperation

func NewMatchPerpetualLiquidationInternalOperation(
	takerLiquidationOrder MatchableOrder,
	makerFills []MakerFill,
) InternalOperation

NewMatchPerpetualLiquidationInternalOperation returns a new operation for matching maker orders against a perpetual liquidation order. This function panics if this is called with a non-liquidation order or there are zero maker fills.

func NewOrderRemovalInternalOperation

func NewOrderRemovalInternalOperation(
	orderId OrderId,
	removalReason OrderRemoval_RemovalReason,
) InternalOperation

NewOrderRemovalInternalOperation returns a new operation for removing an order. This function panics if it's called with an order removal containing an OrderId for a non stateful order or the removal reason is unspecified.

func NewPreexistingStatefulOrderPlacementInternalOperation

func NewPreexistingStatefulOrderPlacementInternalOperation(order Order) InternalOperation

NewPreexistingStatefulOrderPlacementInternalOperation returns a new internal operation for placing a stateful order. This function will panic if it's called with a non stateful order.

func NewShortTermOrderPlacementInternalOperation

func NewShortTermOrderPlacementInternalOperation(order Order) InternalOperation

NewShortTermOrderPlacementInternalOperation returns a new internal operation for placing a Short-Term order. This function will panic if it's called with a non Short-Term order.

func ValidateAndTransformRawOperations

func ValidateAndTransformRawOperations(
	ctx sdk.Context,
	rawOperations []OperationRaw,
	decoder sdk.TxDecoder,
	anteHandler sdk.AnteHandler,
) ([]InternalOperation, error)

ValidateAndTransformRawOperations performs stateless validation on the proposed operation queue and transforms the input []OperationRaw into []InternalOperation. Validations differ based on operation types. We are able to supply a TxDecoder and AnteHandler to this function. These are needed to decode OperationRaw tx bytes and to validate that the operations' transactions were signed correctly.

func (*InternalOperation) Descriptor

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

func (*InternalOperation) GetInternalOperationTextString

func (o *InternalOperation) GetInternalOperationTextString() string

GetInternalOperationTextString returns the text string representation of this operation. TODO(DEC-1772): Add method for encoding operation protos as JSON to make debugging easier.

func (*InternalOperation) GetMatch

func (m *InternalOperation) GetMatch() *ClobMatch

func (*InternalOperation) GetOperation

func (m *InternalOperation) GetOperation() isInternalOperation_Operation

func (*InternalOperation) GetOrderRemoval

func (m *InternalOperation) GetOrderRemoval() *OrderRemoval

func (*InternalOperation) GetPreexistingStatefulOrder

func (m *InternalOperation) GetPreexistingStatefulOrder() *OrderId

func (*InternalOperation) GetShortTermOrderPlacement

func (m *InternalOperation) GetShortTermOrderPlacement() *MsgPlaceOrder

func (*InternalOperation) Marshal

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

func (*InternalOperation) MarshalTo

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

func (*InternalOperation) MarshalToSizedBuffer

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

func (*InternalOperation) ProtoMessage

func (*InternalOperation) ProtoMessage()

func (*InternalOperation) Reset

func (m *InternalOperation) Reset()

func (*InternalOperation) Size

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

func (*InternalOperation) String

func (m *InternalOperation) String() string

func (*InternalOperation) Unmarshal

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

func (*InternalOperation) XXX_DiscardUnknown

func (m *InternalOperation) XXX_DiscardUnknown()

func (*InternalOperation) XXX_Marshal

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

func (*InternalOperation) XXX_Merge

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

func (*InternalOperation) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*InternalOperation) XXX_Size

func (m *InternalOperation) XXX_Size() int

func (*InternalOperation) XXX_Unmarshal

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

type InternalOperation_Match

type InternalOperation_Match struct {
	Match *ClobMatch `protobuf:"bytes,1,opt,name=match,proto3,oneof" json:"match,omitempty"`
}

func (*InternalOperation_Match) MarshalTo

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

func (*InternalOperation_Match) MarshalToSizedBuffer

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

func (*InternalOperation_Match) Size

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

type InternalOperation_OrderRemoval

type InternalOperation_OrderRemoval struct {
	OrderRemoval *OrderRemoval `protobuf:"bytes,4,opt,name=order_removal,json=orderRemoval,proto3,oneof" json:"order_removal,omitempty"`
}

func (*InternalOperation_OrderRemoval) MarshalTo

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

func (*InternalOperation_OrderRemoval) MarshalToSizedBuffer

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

func (*InternalOperation_OrderRemoval) Size

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

type InternalOperation_PreexistingStatefulOrder

type InternalOperation_PreexistingStatefulOrder struct {
	PreexistingStatefulOrder *OrderId `` /* 141-byte string literal not displayed */
}

func (*InternalOperation_PreexistingStatefulOrder) MarshalTo

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

func (*InternalOperation_PreexistingStatefulOrder) MarshalToSizedBuffer

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

func (*InternalOperation_PreexistingStatefulOrder) Size

type InternalOperation_ShortTermOrderPlacement

type InternalOperation_ShortTermOrderPlacement struct {
	ShortTermOrderPlacement *MsgPlaceOrder `` /* 140-byte string literal not displayed */
}

func (*InternalOperation_ShortTermOrderPlacement) MarshalTo

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

func (*InternalOperation_ShortTermOrderPlacement) MarshalToSizedBuffer

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

func (*InternalOperation_ShortTermOrderPlacement) Size

type Level

type Level struct {
	// LevelOrders represents a doubly-linked list of `ClobOrder`s sorted in chronical
	// order (ascending). Note that this should always be non-`nil`, since the
	// `Level` should not exist if there are no elements in the linked list.
	LevelOrders list.List[ClobOrder]
}

Level represents a price level on the CLOB.

type LevelOrder

type LevelOrder = list.Node[ClobOrder]

LevelOrder represents the queue position of an order that is within a specific price level of the CLOB.

type LiquidationOrder

type LiquidationOrder struct {
	// contains filtered or unexported fields
}

LiquidationOrder is used to represent an IOC liquidation order.

func NewLiquidationOrder

func NewLiquidationOrder(
	subaccountId satypes.SubaccountId,
	clobPair ClobPair,
	isBuy bool,
	quantums satypes.BaseQuantums,
	subticks Subticks,
) *LiquidationOrder

NewLiquidationOrder creates and returns a new liquidation order. This function will panic if the caller attempts to create a liquidation order with a non-perpetual CLOB pair.

func (*LiquidationOrder) GetBaseQuantums

func (lo *LiquidationOrder) GetBaseQuantums() satypes.BaseQuantums

GetBaseQuantums returns the quantums of this liquidation order. This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface.

func (*LiquidationOrder) GetClobPairId

func (lo *LiquidationOrder) GetClobPairId() ClobPairId

GetClobPairId returns the CLOB pair ID of this liquidation order. This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface.

func (*LiquidationOrder) GetDeltaQuantums added in v0.3.0

func (o *LiquidationOrder) GetDeltaQuantums() *big.Int

GetDeltaQuantums returns the delta quantums of this liquidation order.

func (*LiquidationOrder) GetOrderHash

func (lo *LiquidationOrder) GetOrderHash() OrderHash

GetOrderHash returns the SHA256 hash of the `PerpetualLiquidationInfo` field. This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface.

func (*LiquidationOrder) GetOrderSubticks

func (lo *LiquidationOrder) GetOrderSubticks() Subticks

GetOrderSubticks returns the subticks of this liquidation order. This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface.

func (*LiquidationOrder) GetSubaccountId

func (lo *LiquidationOrder) GetSubaccountId() satypes.SubaccountId

GetSubaccountId returns the subaccount ID that is being liquidated. This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface.

func (*LiquidationOrder) IsBuy

func (lo *LiquidationOrder) IsBuy() bool

IsBuy returns true if this is a buy order, false if not. This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface.

func (*LiquidationOrder) IsLiquidation

func (lo *LiquidationOrder) IsLiquidation() bool

IsLiquidation always returns true since this order is a liquidation order. This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface.

func (*LiquidationOrder) IsReduceOnly

func (o *LiquidationOrder) IsReduceOnly() bool

IsReduceOnly returns whether this is a reduce-only order. This always returns false for liquidation orders.

func (*LiquidationOrder) MustGetLiquidatedPerpetualId

func (lo *LiquidationOrder) MustGetLiquidatedPerpetualId() uint32

MustGetLiquidatedPerpetualId returns the perpetual ID that this perpetual order is liquidating. This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface.

func (*LiquidationOrder) MustGetOrder

func (lo *LiquidationOrder) MustGetOrder() Order

MustGetOrder always panics since there is no underlying `Order` type for a liquidation. This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface.

type LiquidationsConfig

type LiquidationsConfig struct {
	// The maximum liquidation fee (in parts-per-million). This fee goes
	// 100% to the insurance fund.
	MaxLiquidationFeePpm uint32 `` /* 126-byte string literal not displayed */
	// Limits around how much of a single position can be liquidated
	// within a single block.
	PositionBlockLimits PositionBlockLimits `protobuf:"bytes,2,opt,name=position_block_limits,json=positionBlockLimits,proto3" json:"position_block_limits"`
	// Limits around how many quote quantums from a single subaccount can
	// be liquidated within a single block.
	SubaccountBlockLimits SubaccountBlockLimits `protobuf:"bytes,3,opt,name=subaccount_block_limits,json=subaccountBlockLimits,proto3" json:"subaccount_block_limits"`
	// Config about how the fillable-price spread from the oracle price
	// increases based on the adjusted bankruptcy rating of the subaccount.
	FillablePriceConfig FillablePriceConfig `protobuf:"bytes,4,opt,name=fillable_price_config,json=fillablePriceConfig,proto3" json:"fillable_price_config"`
}

LiquidationsConfig stores all configurable fields related to liquidations.

func (*LiquidationsConfig) Descriptor

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

func (*LiquidationsConfig) GetFillablePriceConfig

func (m *LiquidationsConfig) GetFillablePriceConfig() FillablePriceConfig

func (*LiquidationsConfig) GetMaxLiquidationFeePpm

func (m *LiquidationsConfig) GetMaxLiquidationFeePpm() uint32

func (*LiquidationsConfig) GetPositionBlockLimits

func (m *LiquidationsConfig) GetPositionBlockLimits() PositionBlockLimits

func (*LiquidationsConfig) GetSubaccountBlockLimits

func (m *LiquidationsConfig) GetSubaccountBlockLimits() SubaccountBlockLimits

func (*LiquidationsConfig) Marshal

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

func (*LiquidationsConfig) MarshalTo

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

func (*LiquidationsConfig) MarshalToSizedBuffer

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

func (*LiquidationsConfig) ProtoMessage

func (*LiquidationsConfig) ProtoMessage()

func (*LiquidationsConfig) Reset

func (m *LiquidationsConfig) Reset()

func (*LiquidationsConfig) Size

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

func (*LiquidationsConfig) String

func (m *LiquidationsConfig) String() string

func (*LiquidationsConfig) Unmarshal

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

func (*LiquidationsConfig) Validate

func (lc *LiquidationsConfig) Validate() error

func (*LiquidationsConfig) XXX_DiscardUnknown

func (m *LiquidationsConfig) XXX_DiscardUnknown()

func (*LiquidationsConfig) XXX_Marshal

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

func (*LiquidationsConfig) XXX_Merge

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

func (*LiquidationsConfig) XXX_Size

func (m *LiquidationsConfig) XXX_Size() int

func (*LiquidationsConfig) XXX_Unmarshal

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

type LiquidationsConfigKeeper

type LiquidationsConfigKeeper interface {
	GetLiquidationsConfig(
		ctx sdk.Context,
	) LiquidationsConfig
}

LiquidationsConfigKeeper is an interface that encapsulates all reads and writes to the liquidation configuration values written to state.

type LiquidationsKeeper

type LiquidationsKeeper interface {
	PlacePerpetualLiquidation(
		ctx sdk.Context,
		liquidationOrder LiquidationOrder,
	) (
		orderSizeOptimisticallyFilledFromMatchingQuantums satypes.BaseQuantums,
		orderStatus OrderStatus,
		err error,
	)
	MaybeDeleverageSubaccount(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		perpetualId uint32,
	) (
		quantumsDeleveraged *big.Int,
		err error,
	)
	IsLiquidatable(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
	) (
		bool,
		error,
	)
	GetBankruptcyPriceInQuoteQuantums(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		perpetualId uint32,
		deltaQuantums *big.Int,
	) (
		quoteQuantums *big.Int,
		err error,
	)
	GetFillablePrice(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		perpetualId uint32,
		deltaQuantums *big.Int,
	) (
		fillablePrice *big.Rat,
		err error,
	)
	GetInsuranceFundBalance(
		ctx sdk.Context,
	) (
		balance *big.Int,
	)
	GetLiquidationInsuranceFundDelta(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		perpetualId uint32,
		isBuy bool,
		fillAmount uint64,
		subticks Subticks,
	) (
		insuranceFundDeltaQuoteQuantums *big.Int,
		err error,
	)
	ConvertFillablePriceToSubticks(
		ctx sdk.Context,
		fillablePrice *big.Rat,
		isLiquidatingLong bool,
		clobPair ClobPair,
	) (
		subticks Subticks,
	)
	GetPerpetualPositionToLiquidate(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
	) (
		perpetualId uint32,
		err error,
	)
	GetSubaccountMaxNotionalLiquidatable(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		perpetualId uint32,
	) (
		bigMaxNotionalLiquidatable *big.Int,
		err error,
	)
	GetSubaccountMaxInsuranceLost(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		perpetualId uint32,
	) (
		bigMaxQuantumsInsuranceLost *big.Int,
		err error,
	)
	GetMaxAndMinPositionNotionalLiquidatable(
		ctx sdk.Context,
		positionToLiquidate *satypes.PerpetualPosition,
	) (
		bigMinNotionalLiquidatable *big.Int,
		bigMaxNotionalLiquidatable *big.Int,
		err error,
	)
	MaybeGetLiquidationOrder(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
	) (
		liquidationOrder *LiquidationOrder,
		err error,
	)
	GetSubaccountLiquidationInfo(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
	) (
		liquidationInfo SubaccountLiquidationInfo,
	)
	MustUpdateSubaccountPerpetualLiquidated(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		perpetualId uint32,
	)
	UpdateSubaccountLiquidationInfo(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		notionalLiquidatedQuoteQuantums *big.Int,
		insuranceFundDeltaQuoteQuantums *big.Int,
	)
}

LiquidationsKeeper is an interface that encapsulates all reads and writes to the in-memory data structures that store liquidation information.

type LongTermOrderPlacement

type LongTermOrderPlacement struct {
	Order Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order"`
	// The block height and transaction index at which the order was placed.
	// Used for ordering by time priority when the chain is restarted.
	PlacementIndex TransactionOrdering `protobuf:"bytes,2,opt,name=placement_index,json=placementIndex,proto3" json:"placement_index"`
}

LongTermOrderPlacement represents the placement of a stateful order in state. It stores the stateful order itself and the `BlockHeight` and `TransactionIndex` at which the order was placed.

func (*LongTermOrderPlacement) Descriptor

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

func (*LongTermOrderPlacement) GetOrder

func (m *LongTermOrderPlacement) GetOrder() Order

func (*LongTermOrderPlacement) GetPlacementIndex

func (m *LongTermOrderPlacement) GetPlacementIndex() TransactionOrdering

func (*LongTermOrderPlacement) GetTransactionIndex

func (orderPlacement *LongTermOrderPlacement) GetTransactionIndex() TransactionOrdering

GetTransactionIndex returns a LongTermOrderPlacement's placement index.

func (*LongTermOrderPlacement) Marshal

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

func (*LongTermOrderPlacement) MarshalTo

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

func (*LongTermOrderPlacement) MarshalToSizedBuffer

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

func (*LongTermOrderPlacement) ProtoMessage

func (*LongTermOrderPlacement) ProtoMessage()

func (*LongTermOrderPlacement) Reset

func (m *LongTermOrderPlacement) Reset()

func (*LongTermOrderPlacement) Size

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

func (*LongTermOrderPlacement) String

func (m *LongTermOrderPlacement) String() string

func (*LongTermOrderPlacement) Unmarshal

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

func (*LongTermOrderPlacement) XXX_DiscardUnknown

func (m *LongTermOrderPlacement) XXX_DiscardUnknown()

func (*LongTermOrderPlacement) XXX_Marshal

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

func (*LongTermOrderPlacement) XXX_Merge

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

func (*LongTermOrderPlacement) XXX_Size

func (m *LongTermOrderPlacement) XXX_Size() int

func (*LongTermOrderPlacement) XXX_Unmarshal

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

type MEVDatapoint

type MEVDatapoint struct {
	Height              uint32                  `json:"block_height"`
	ChainID             string                  `json:"chain_id"`
	VolumeQuoteQuantums map[ClobPairId]*big.Int `json:"volume_quote_quantums"`
	MEV                 map[ClobPairId]float32  `json:"mev"`
	Identifier          string                  `json:"identifier"`
}

MEVDatapoint contains the Volume (ValidatorVolumeQuoteQuantums) and MEV per market to be sent to the MEV telemetry service. Every datapoint contains a self-reported identifier and a block height for which the metric is reported.

type MEVLiquidationMatch

type MEVLiquidationMatch struct {
	LiquidatedSubaccountId          types.SubaccountId `protobuf:"bytes,1,opt,name=liquidated_subaccount_id,json=liquidatedSubaccountId,proto3" json:"liquidated_subaccount_id"`
	InsuranceFundDeltaQuoteQuantums int64              `` /* 161-byte string literal not displayed */
	MakerOrderSubaccountId          types.SubaccountId `protobuf:"bytes,3,opt,name=maker_order_subaccount_id,json=makerOrderSubaccountId,proto3" json:"maker_order_subaccount_id"`
	MakerOrderSubticks              uint64             `protobuf:"varint,4,opt,name=maker_order_subticks,json=makerOrderSubticks,proto3" json:"maker_order_subticks,omitempty"`
	MakerOrderIsBuy                 bool               `protobuf:"varint,5,opt,name=maker_order_is_buy,json=makerOrderIsBuy,proto3" json:"maker_order_is_buy,omitempty"`
	MakerFeePpm                     int32              `protobuf:"varint,6,opt,name=maker_fee_ppm,json=makerFeePpm,proto3" json:"maker_fee_ppm,omitempty"`
	ClobPairId                      uint32             `protobuf:"varint,7,opt,name=clob_pair_id,json=clobPairId,proto3" json:"clob_pair_id,omitempty"`
	FillAmount                      uint64             `protobuf:"varint,8,opt,name=fill_amount,json=fillAmount,proto3" json:"fill_amount,omitempty"`
}

MEVLiquidationMatch represents all necessary data to calculate MEV for a liquidation.

func (*MEVLiquidationMatch) Descriptor

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

func (*MEVLiquidationMatch) GetClobPairId

func (m *MEVLiquidationMatch) GetClobPairId() uint32

func (*MEVLiquidationMatch) GetFillAmount

func (m *MEVLiquidationMatch) GetFillAmount() uint64

func (*MEVLiquidationMatch) GetInsuranceFundDeltaQuoteQuantums

func (m *MEVLiquidationMatch) GetInsuranceFundDeltaQuoteQuantums() int64

func (*MEVLiquidationMatch) GetLiquidatedSubaccountId

func (m *MEVLiquidationMatch) GetLiquidatedSubaccountId() types.SubaccountId

func (*MEVLiquidationMatch) GetMakerFeePpm

func (m *MEVLiquidationMatch) GetMakerFeePpm() int32

func (*MEVLiquidationMatch) GetMakerOrderIsBuy

func (m *MEVLiquidationMatch) GetMakerOrderIsBuy() bool

func (*MEVLiquidationMatch) GetMakerOrderSubaccountId

func (m *MEVLiquidationMatch) GetMakerOrderSubaccountId() types.SubaccountId

func (*MEVLiquidationMatch) GetMakerOrderSubticks

func (m *MEVLiquidationMatch) GetMakerOrderSubticks() uint64

func (*MEVLiquidationMatch) Marshal

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

func (*MEVLiquidationMatch) MarshalTo

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

func (*MEVLiquidationMatch) MarshalToSizedBuffer

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

func (*MEVLiquidationMatch) ProtoMessage

func (*MEVLiquidationMatch) ProtoMessage()

func (*MEVLiquidationMatch) Reset

func (m *MEVLiquidationMatch) Reset()

func (*MEVLiquidationMatch) Size

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

func (*MEVLiquidationMatch) String

func (m *MEVLiquidationMatch) String() string

func (*MEVLiquidationMatch) Unmarshal

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

func (*MEVLiquidationMatch) XXX_DiscardUnknown

func (m *MEVLiquidationMatch) XXX_DiscardUnknown()

func (*MEVLiquidationMatch) XXX_Marshal

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

func (*MEVLiquidationMatch) XXX_Merge

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

func (*MEVLiquidationMatch) XXX_Size

func (m *MEVLiquidationMatch) XXX_Size() int

func (*MEVLiquidationMatch) XXX_Unmarshal

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

type MEVMatch

type MEVMatch struct {
	TakerOrderSubaccountId *types.SubaccountId `` /* 131-byte string literal not displayed */
	TakerFeePpm            int32               `protobuf:"varint,2,opt,name=taker_fee_ppm,json=takerFeePpm,proto3" json:"taker_fee_ppm,omitempty"`
	MakerOrderSubaccountId *types.SubaccountId `` /* 131-byte string literal not displayed */
	MakerOrderSubticks     uint64              `protobuf:"varint,4,opt,name=maker_order_subticks,json=makerOrderSubticks,proto3" json:"maker_order_subticks,omitempty"`
	MakerOrderIsBuy        bool                `protobuf:"varint,5,opt,name=maker_order_is_buy,json=makerOrderIsBuy,proto3" json:"maker_order_is_buy,omitempty"`
	MakerFeePpm            int32               `protobuf:"varint,6,opt,name=maker_fee_ppm,json=makerFeePpm,proto3" json:"maker_fee_ppm,omitempty"`
	ClobPairId             uint32              `protobuf:"varint,7,opt,name=clob_pair_id,json=clobPairId,proto3" json:"clob_pair_id,omitempty"`
	FillAmount             uint64              `protobuf:"varint,8,opt,name=fill_amount,json=fillAmount,proto3" json:"fill_amount,omitempty"`
}

MEVMatch represents all necessary data to calculate MEV for a regular match.

func (*MEVMatch) Descriptor

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

func (*MEVMatch) GetClobPairId

func (m *MEVMatch) GetClobPairId() uint32

func (*MEVMatch) GetFillAmount

func (m *MEVMatch) GetFillAmount() uint64

func (*MEVMatch) GetMakerFeePpm

func (m *MEVMatch) GetMakerFeePpm() int32

func (*MEVMatch) GetMakerOrderIsBuy

func (m *MEVMatch) GetMakerOrderIsBuy() bool

func (*MEVMatch) GetMakerOrderSubaccountId

func (m *MEVMatch) GetMakerOrderSubaccountId() *types.SubaccountId

func (*MEVMatch) GetMakerOrderSubticks

func (m *MEVMatch) GetMakerOrderSubticks() uint64

func (*MEVMatch) GetTakerFeePpm

func (m *MEVMatch) GetTakerFeePpm() int32

func (*MEVMatch) GetTakerOrderSubaccountId

func (m *MEVMatch) GetTakerOrderSubaccountId() *types.SubaccountId

func (*MEVMatch) Marshal

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

func (*MEVMatch) MarshalTo

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

func (*MEVMatch) MarshalToSizedBuffer

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

func (*MEVMatch) ProtoMessage

func (*MEVMatch) ProtoMessage()

func (*MEVMatch) Reset

func (m *MEVMatch) Reset()

func (*MEVMatch) Size

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

func (*MEVMatch) String

func (m *MEVMatch) String() string

func (*MEVMatch) Unmarshal

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

func (*MEVMatch) XXX_DiscardUnknown

func (m *MEVMatch) XXX_DiscardUnknown()

func (*MEVMatch) XXX_Marshal

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

func (*MEVMatch) XXX_Merge

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

func (*MEVMatch) XXX_Size

func (m *MEVMatch) XXX_Size() int

func (*MEVMatch) XXX_Unmarshal

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

type MakerFill

type MakerFill struct {
	// The filled amount of the matched maker order, in base quantums.
	// TODO(CLOB-571): update to use SerializableInt.
	FillAmount uint64 `protobuf:"varint,1,opt,name=fill_amount,json=fillAmount,proto3" json:"fill_amount,omitempty"`
	// The `OrderId` of the matched maker order.
	MakerOrderId OrderId `protobuf:"bytes,2,opt,name=maker_order_id,json=makerOrderId,proto3" json:"maker_order_id"`
}

MakerFill represents the filled amount of a matched maker order.

func MakerFillsWithOrderToMakerFills

func MakerFillsWithOrderToMakerFills(mfos []MakerFillWithOrder) []MakerFill

MakerFillsWithOrderToMakerFills converts a slice of `MakerFillWithOrder` to a slice of `MakerFill`.

func (*MakerFill) Descriptor

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

func (*MakerFill) GetFillAmount

func (m *MakerFill) GetFillAmount() uint64

func (*MakerFill) GetMakerOrderId

func (m *MakerFill) GetMakerOrderId() OrderId

func (*MakerFill) Marshal

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

func (*MakerFill) MarshalTo

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

func (*MakerFill) MarshalToSizedBuffer

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

func (*MakerFill) ProtoMessage

func (*MakerFill) ProtoMessage()

func (*MakerFill) Reset

func (m *MakerFill) Reset()

func (*MakerFill) Size

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

func (*MakerFill) String

func (m *MakerFill) String() string

func (*MakerFill) Unmarshal

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

func (*MakerFill) XXX_DiscardUnknown

func (m *MakerFill) XXX_DiscardUnknown()

func (*MakerFill) XXX_Marshal

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

func (*MakerFill) XXX_Merge

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

func (*MakerFill) XXX_Size

func (m *MakerFill) XXX_Size() int

func (*MakerFill) XXX_Unmarshal

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

type MakerFillWithOrder

type MakerFillWithOrder struct {
	MakerFill

	// The `Order` representing the matched maker order.
	Order Order
}

MakerFillWithOrder represents the filled amount of a matched maker order, along with the `Order` representing the matched maker order.

type MatchOrders

type MatchOrders struct {
	// The `OrderId` of the taker order.
	TakerOrderId OrderId `protobuf:"bytes,1,opt,name=taker_order_id,json=takerOrderId,proto3" json:"taker_order_id"`
	// An ordered list of fills created by this taker order.
	Fills []MakerFill `protobuf:"bytes,2,rep,name=fills,proto3" json:"fills"`
}

MatchOrders is an injected message used for matching orders.

func (*MatchOrders) Descriptor

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

func (*MatchOrders) GetFills

func (m *MatchOrders) GetFills() []MakerFill

func (*MatchOrders) GetMakerSubaccountIds

func (m *MatchOrders) GetMakerSubaccountIds() []satypes.SubaccountId

GetMakerSubaccountIds gets a list of SubaccountIds belonging to subaccounts which placed the maker orders in the Fills property of this MatchOrdersNew object.

func (*MatchOrders) GetTakerOrderId

func (m *MatchOrders) GetTakerOrderId() OrderId

func (*MatchOrders) Marshal

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

func (*MatchOrders) MarshalTo

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

func (*MatchOrders) MarshalToSizedBuffer

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

func (*MatchOrders) ProtoMessage

func (*MatchOrders) ProtoMessage()

func (*MatchOrders) Reset

func (m *MatchOrders) Reset()

func (*MatchOrders) Size

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

func (*MatchOrders) String

func (m *MatchOrders) String() string

func (*MatchOrders) Unmarshal

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

func (*MatchOrders) XXX_DiscardUnknown

func (m *MatchOrders) XXX_DiscardUnknown()

func (*MatchOrders) XXX_Marshal

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

func (*MatchOrders) XXX_Merge

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

func (*MatchOrders) XXX_Size

func (m *MatchOrders) XXX_Size() int

func (*MatchOrders) XXX_Unmarshal

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

type MatchPerpetualDeleveraging

type MatchPerpetualDeleveraging struct {
	// ID of the subaccount that was liquidated.
	Liquidated types.SubaccountId `protobuf:"bytes,1,opt,name=liquidated,proto3" json:"liquidated"`
	// The ID of the perpetual that was liquidated.
	PerpetualId uint32 `protobuf:"varint,2,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"`
	// An ordered list of fills created by this liquidation.
	Fills []MatchPerpetualDeleveraging_Fill `protobuf:"bytes,3,rep,name=fills,proto3" json:"fills"`
}

MatchPerpetualDeleveraging is an injected message used for deleveraging a subaccount.

func (*MatchPerpetualDeleveraging) Descriptor

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

func (*MatchPerpetualDeleveraging) GetFills

func (*MatchPerpetualDeleveraging) GetLiquidated

func (m *MatchPerpetualDeleveraging) GetLiquidated() types.SubaccountId

func (*MatchPerpetualDeleveraging) GetPerpetualId

func (m *MatchPerpetualDeleveraging) GetPerpetualId() uint32

func (*MatchPerpetualDeleveraging) GetTotalFilledQuantums

func (m *MatchPerpetualDeleveraging) GetTotalFilledQuantums() *big.Int

GetTotalFilledQuantums gets the total filled quantums from a MatchPerpetualDeleveraging match.

func (*MatchPerpetualDeleveraging) Marshal

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

func (*MatchPerpetualDeleveraging) MarshalTo

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

func (*MatchPerpetualDeleveraging) MarshalToSizedBuffer

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

func (*MatchPerpetualDeleveraging) ProtoMessage

func (*MatchPerpetualDeleveraging) ProtoMessage()

func (*MatchPerpetualDeleveraging) Reset

func (m *MatchPerpetualDeleveraging) Reset()

func (*MatchPerpetualDeleveraging) Size

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

func (*MatchPerpetualDeleveraging) String

func (m *MatchPerpetualDeleveraging) String() string

func (*MatchPerpetualDeleveraging) Unmarshal

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

func (*MatchPerpetualDeleveraging) Validate

func (match *MatchPerpetualDeleveraging) Validate() error

Validate performs stateless validation on a `MatchPerpetualDeleveraging` object. It checks the following conditions to be true: - Validation for all subaccount Ids - length of fills to be greater than zero - For each fill, fill amount must be greater than zero - Subaccount ids in fills are all unique - Subaccount ids in fills cannot be the same as the liquidated subaccount id

func (*MatchPerpetualDeleveraging) XXX_DiscardUnknown

func (m *MatchPerpetualDeleveraging) XXX_DiscardUnknown()

func (*MatchPerpetualDeleveraging) XXX_Marshal

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

func (*MatchPerpetualDeleveraging) XXX_Merge

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

func (*MatchPerpetualDeleveraging) XXX_Size

func (m *MatchPerpetualDeleveraging) XXX_Size() int

func (*MatchPerpetualDeleveraging) XXX_Unmarshal

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

type MatchPerpetualDeleveraging_Fill

type MatchPerpetualDeleveraging_Fill struct {
	// ID of the subaccount that was used to offset the liquidated subaccount's
	// position.
	OffsettingSubaccountId types.SubaccountId `protobuf:"bytes,1,opt,name=offsetting_subaccount_id,json=offsettingSubaccountId,proto3" json:"offsetting_subaccount_id"`
	// The amount filled between the liquidated and offsetting position, in
	// base quantums.
	// TODO(CLOB-571): update to use SerializableInt.
	FillAmount uint64 `protobuf:"varint,2,opt,name=fill_amount,json=fillAmount,proto3" json:"fill_amount,omitempty"`
}

Fill represents a fill between the liquidated and offsetting subaccount.

func (*MatchPerpetualDeleveraging_Fill) Descriptor

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

func (*MatchPerpetualDeleveraging_Fill) GetFillAmount

func (m *MatchPerpetualDeleveraging_Fill) GetFillAmount() uint64

func (*MatchPerpetualDeleveraging_Fill) GetOffsettingSubaccountId

func (m *MatchPerpetualDeleveraging_Fill) GetOffsettingSubaccountId() types.SubaccountId

func (*MatchPerpetualDeleveraging_Fill) Marshal

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

func (*MatchPerpetualDeleveraging_Fill) MarshalTo

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

func (*MatchPerpetualDeleveraging_Fill) MarshalToSizedBuffer

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

func (*MatchPerpetualDeleveraging_Fill) ProtoMessage

func (*MatchPerpetualDeleveraging_Fill) ProtoMessage()

func (*MatchPerpetualDeleveraging_Fill) Reset

func (*MatchPerpetualDeleveraging_Fill) Size

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

func (*MatchPerpetualDeleveraging_Fill) String

func (*MatchPerpetualDeleveraging_Fill) Unmarshal

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

func (*MatchPerpetualDeleveraging_Fill) XXX_DiscardUnknown

func (m *MatchPerpetualDeleveraging_Fill) XXX_DiscardUnknown()

func (*MatchPerpetualDeleveraging_Fill) XXX_Marshal

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

func (*MatchPerpetualDeleveraging_Fill) XXX_Merge

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

func (*MatchPerpetualDeleveraging_Fill) XXX_Size

func (m *MatchPerpetualDeleveraging_Fill) XXX_Size() int

func (*MatchPerpetualDeleveraging_Fill) XXX_Unmarshal

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

type MatchPerpetualLiquidation

type MatchPerpetualLiquidation struct {
	// ID of the subaccount that was liquidated.
	Liquidated types.SubaccountId `protobuf:"bytes,1,opt,name=liquidated,proto3" json:"liquidated"`
	// The ID of the clob pair involved in the liquidation.
	ClobPairId uint32 `protobuf:"varint,2,opt,name=clob_pair_id,json=clobPairId,proto3" json:"clob_pair_id,omitempty"`
	// The ID of the perpetual involved in the liquidation.
	PerpetualId uint32 `protobuf:"varint,3,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"`
	// The total size of the liquidation order including any unfilled size.
	TotalSize uint64 `protobuf:"varint,4,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"`
	// `true` if liquidating a short position, `false` otherwise.
	IsBuy bool `protobuf:"varint,5,opt,name=is_buy,json=isBuy,proto3" json:"is_buy,omitempty"`
	// An ordered list of fills created by this liquidation.
	Fills []MakerFill `protobuf:"bytes,6,rep,name=fills,proto3" json:"fills"`
}

MatchPerpetualLiquidation is an injected message used for liquidating a subaccount.

func (*MatchPerpetualLiquidation) Descriptor

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

func (*MatchPerpetualLiquidation) GetClobPairId

func (m *MatchPerpetualLiquidation) GetClobPairId() uint32

func (*MatchPerpetualLiquidation) GetFills

func (m *MatchPerpetualLiquidation) GetFills() []MakerFill

func (*MatchPerpetualLiquidation) GetIsBuy

func (m *MatchPerpetualLiquidation) GetIsBuy() bool

func (*MatchPerpetualLiquidation) GetLiquidated

func (m *MatchPerpetualLiquidation) GetLiquidated() types.SubaccountId

func (*MatchPerpetualLiquidation) GetMakerSubaccountIds

func (m *MatchPerpetualLiquidation) GetMakerSubaccountIds() []satypes.SubaccountId

GetMakerSubaccountIds gets a list of SubaccountIds belonging to subaccounts which placed the maker orders in the Fills property of this MatchPerpetualLiquidationNew object.

func (MatchPerpetualLiquidation) GetMetricLabels added in v0.4.0

func (m MatchPerpetualLiquidation) GetMetricLabels() []gometrics.Label

GetMetricLabels returns a slice of gometrics labels for a match perpetual liquidation. Currently, the only label is the perpetual id.

func (*MatchPerpetualLiquidation) GetPerpetualId

func (m *MatchPerpetualLiquidation) GetPerpetualId() uint32

func (*MatchPerpetualLiquidation) GetTotalSize

func (m *MatchPerpetualLiquidation) GetTotalSize() uint64

func (*MatchPerpetualLiquidation) Marshal

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

func (*MatchPerpetualLiquidation) MarshalTo

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

func (*MatchPerpetualLiquidation) MarshalToSizedBuffer

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

func (*MatchPerpetualLiquidation) ProtoMessage

func (*MatchPerpetualLiquidation) ProtoMessage()

func (*MatchPerpetualLiquidation) Reset

func (m *MatchPerpetualLiquidation) Reset()

func (*MatchPerpetualLiquidation) Size

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

func (*MatchPerpetualLiquidation) String

func (m *MatchPerpetualLiquidation) String() string

func (*MatchPerpetualLiquidation) Unmarshal

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

func (*MatchPerpetualLiquidation) XXX_DiscardUnknown

func (m *MatchPerpetualLiquidation) XXX_DiscardUnknown()

func (*MatchPerpetualLiquidation) XXX_Marshal

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

func (*MatchPerpetualLiquidation) XXX_Merge

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

func (*MatchPerpetualLiquidation) XXX_Size

func (m *MatchPerpetualLiquidation) XXX_Size() int

func (*MatchPerpetualLiquidation) XXX_Unmarshal

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

type MatchWithOrders

type MatchWithOrders struct {
	MakerOrder MatchableOrder
	TakerOrder MatchableOrder
	FillAmount satypes.BaseQuantums
	MakerFee   int64
	TakerFee   int64
}

MatchWithOrders represents a match which occurred between two orders and the amount that was matched.

func (MatchWithOrders) Validate

func (match MatchWithOrders) Validate() error

Validate performs stateless validation on an order match. This validation does not perform any state reads, or memclob reads.

This validation ensures:

  • Order match does not constitute a self-trade.
  • Order match contains a `fillAmount` greater than 0.
  • Orders in match are for the same `ClobPairId`.
  • Orders in match are for opposing sides.
  • Orders are crossing.
  • The minimum of the takerOrder and makerOrder initial quantums does not exceed the FillAmount.
  • The maker order referenced in the match is not a liquidation order.
  • The maker order referenced in the match is not an IOC order.

type MatchableOrder

type MatchableOrder interface {
	// GetSubaccountID returns the `SubaccountId` of the subaccount that placed the order.
	// In the case of a `LiquidationOrder`, it refers to the subaccount that is being liquidated.
	GetSubaccountId() satypes.SubaccountId
	// GetClobPairId returns the CLOB pair ID that this order should be matched against.
	GetClobPairId() ClobPairId
	// IsBuy returns true if this is a buy order, false if it's a sell order.
	IsBuy() bool
	// IsLiquidation returns true if this is a liquidation order, false if not.
	IsLiquidation() bool
	// MustGetOrder returns the underlying order if this is not a liquidation order. Panics if called
	// for a liquidation order.
	MustGetOrder() Order
	// MustGetLiquidatedPerpetualId returns the perpetual ID if this is a liquidation order. Panics
	// if called for a non-liquidation order.
	MustGetLiquidatedPerpetualId() uint32
	// GetBaseQuantums returns the base quantums of this order.
	GetBaseQuantums() satypes.BaseQuantums
	// GetOrderSubticks returns the subticks of this order.
	GetOrderSubticks() Subticks
	// GetOrderHash returns the hash of this order.
	// If this is a liquidation it returns the hash of the `PerpetualLiquidationInfo`.
	// Else, it returns the hash of the `Order` proto.
	GetOrderHash() OrderHash
	// IsReduceOnly returns whether this is a reduce-only order.
	// This always returns false for liquidation orders.
	IsReduceOnly() bool
}

MatchableOrder is an interface that a matchable order must conform to. This interface is used to generalize matching between standard orders and liquidations.

type MaxPerNBlocksRateLimit

type MaxPerNBlocksRateLimit struct {
	// How many blocks the rate limit is over.
	// Specifying 0 is invalid.
	NumBlocks uint32 `protobuf:"varint,1,opt,name=num_blocks,json=numBlocks,proto3" json:"num_blocks,omitempty"`
	// What the limit is for `num_blocks`.
	// Specifying 0 is invalid.
	Limit uint32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
}

Defines a rate limit over a specific number of blocks.

func (*MaxPerNBlocksRateLimit) Descriptor

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

func (*MaxPerNBlocksRateLimit) GetLimit

func (m *MaxPerNBlocksRateLimit) GetLimit() uint32

func (*MaxPerNBlocksRateLimit) GetNumBlocks

func (m *MaxPerNBlocksRateLimit) GetNumBlocks() uint32

func (*MaxPerNBlocksRateLimit) Marshal

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

func (*MaxPerNBlocksRateLimit) MarshalTo

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

func (*MaxPerNBlocksRateLimit) MarshalToSizedBuffer

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

func (*MaxPerNBlocksRateLimit) ProtoMessage

func (*MaxPerNBlocksRateLimit) ProtoMessage()

func (*MaxPerNBlocksRateLimit) Reset

func (m *MaxPerNBlocksRateLimit) Reset()

func (*MaxPerNBlocksRateLimit) Size

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

func (*MaxPerNBlocksRateLimit) String

func (m *MaxPerNBlocksRateLimit) String() string

func (*MaxPerNBlocksRateLimit) Unmarshal

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

func (*MaxPerNBlocksRateLimit) XXX_DiscardUnknown

func (m *MaxPerNBlocksRateLimit) XXX_DiscardUnknown()

func (*MaxPerNBlocksRateLimit) XXX_Marshal

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

func (*MaxPerNBlocksRateLimit) XXX_Merge

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

func (*MaxPerNBlocksRateLimit) XXX_Size

func (m *MaxPerNBlocksRateLimit) XXX_Size() int

func (*MaxPerNBlocksRateLimit) XXX_Unmarshal

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

type MemClob

type MemClob interface {
	SetClobKeeper(
		keeper MemClobKeeper,
	)
	CancelOrder(
		ctx sdk.Context,
		msgCancelOrder *MsgCancelOrder,
	) (offchainUpdates *OffchainUpdates, err error)
	CreateOrderbook(
		ctx sdk.Context,
		clobPair ClobPair,
	)
	CountSubaccountShortTermOrders(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
	) uint32
	GetOperationsToReplay(
		ctx sdk.Context,
	) (
		[]InternalOperation,
		map[OrderHash][]byte,
	)

	GetOperationsRaw(
		ctx sdk.Context,
	) (
		operationsQueue []OperationRaw,
	)
	GetOrder(
		ctx sdk.Context,
		orderId OrderId,
	) (Order, bool)
	GetCancelOrder(
		ctx sdk.Context,
		orderId OrderId,
	) (uint32, bool)
	GetOrderFilledAmount(
		ctx sdk.Context,
		orderId OrderId,
	) satypes.BaseQuantums
	GetOrderRemainingAmount(
		ctx sdk.Context,
		order Order,
	) (
		remainingAmount satypes.BaseQuantums,
		hasRemainingAmount bool,
	)
	GetSubaccountOrders(
		ctx sdk.Context,
		clobPairId ClobPairId,
		subaccountId satypes.SubaccountId,
		side Order_Side,
	) ([]Order, error)
	PlaceOrder(
		ctx sdk.Context,
		order Order,
	) (satypes.BaseQuantums, OrderStatus, *OffchainUpdates, error)
	PlacePerpetualLiquidation(
		ctx sdk.Context,
		liquidationOrder LiquidationOrder,
	) (
		orderSizeOptimisticallyFilledFromMatchingQuantums satypes.BaseQuantums,
		orderStatus OrderStatus,
		offchainUpdates *OffchainUpdates,
		err error,
	)
	DeleverageSubaccount(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		perpetualId uint32,
		deltaQuantums *big.Int,
	) (
		quantumsDeleveraged *big.Int,
		err error,
	)
	RemoveOrderIfFilled(
		ctx sdk.Context,
		orderId OrderId,
	)
	GetPricePremium(
		ctx sdk.Context,
		clobPair ClobPair,
		params perptypes.GetPricePremiumParams,
	) (
		premiumPpm int32,
		err error,
	)
	RemoveAndClearOperationsQueue(
		ctx sdk.Context,
		localValidatorOperationsQueue []InternalOperation,
	)
	PurgeInvalidMemclobState(
		ctx sdk.Context,
		fullyFilledOrderIds []OrderId,
		expiredStatefulOrderIds []OrderId,
		canceledStatefulOrderIds []OrderId,
		removedStatefulOrderIds []OrderId,
		existingOffchainUpdates *OffchainUpdates,
	) (offchainUpdates *OffchainUpdates)
	ReplayOperations(
		ctx sdk.Context,
		localOperations []InternalOperation,
		shortTermOrderTxBytes map[OrderHash][]byte,
		existingOffchainUpdates *OffchainUpdates,
	) (offchainUpdates *OffchainUpdates)
	SetMemclobGauges(
		ctx sdk.Context,
	)
	GetMidPrice(
		ctx sdk.Context,
		clobPairId ClobPairId,
	) (
		subticks Subticks,
		exists bool,
	)
}

MemClob is an interface that encapsulates all reads and writes to the CLOB's in-memory data structures.

type MemClobKeeper

type MemClobKeeper interface {
	GetOrderFillAmount(
		ctx sdk.Context,
		orderId OrderId,
	) (
		exists bool,
		fillAmount satypes.BaseQuantums,
		prunableBlockHeight uint32,
	)
	ProcessSingleMatch(
		ctx sdk.Context,
		matchWithOrders *MatchWithOrders,
	) (
		success bool,
		takerUpdateResult satypes.UpdateResult,
		makerUpdateResult satypes.UpdateResult,
		offchainUpdates *OffchainUpdates,
		err error,
	)
	AddOrderToOrderbookCollatCheck(
		ctx sdk.Context,
		clobPairId ClobPairId,
		subaccountOpenOrders map[satypes.SubaccountId][]PendingOpenOrder,
	) (
		success bool,
		successPerUpdate map[satypes.SubaccountId]satypes.UpdateResult,
	)
	CanDeleverageSubaccount(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
	) (bool, error)
	GetStatePosition(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
		clobPairId ClobPairId,
	) (
		positionSizeQuantums *big.Int,
	)
	ReplayPlaceOrder(
		ctx sdk.Context,
		msg *MsgPlaceOrder,
	) (
		orderSizeOptimisticallyFilledFromMatchingQuantums satypes.BaseQuantums,
		orderStatus OrderStatus,
		offchainUpdates *OffchainUpdates,
		err error,
	)
	CancelShortTermOrder(
		ctx sdk.Context,
		msgCancelOrder *MsgCancelOrder,
	) error
	GetLongTermOrderPlacement(
		ctx sdk.Context,
		orderId OrderId,
	) (val LongTermOrderPlacement, found bool)
	SetLongTermOrderPlacement(
		ctx sdk.Context,
		order Order,
		blockHeight uint32,
	)
	MustAddOrderToStatefulOrdersTimeSlice(
		ctx sdk.Context,
		goodTilBlockTime time.Time,
		orderId OrderId,
	)
	OffsetSubaccountPerpetualPosition(
		ctx sdk.Context,
		liquidatedSubaccountId satypes.SubaccountId,
		perpetualId uint32,
		deltaQuantumsTotal *big.Int,
	) (
		fills []MatchPerpetualDeleveraging_Fill,
		deltaQuantumsRemaining *big.Int,
	)
	GetIndexerEventManager() indexer_manager.IndexerEventManager
	IsLiquidatable(
		ctx sdk.Context,
		subaccountId satypes.SubaccountId,
	) (
		bool,
		error,
	)
	ValidateSubaccountEquityTierLimitForNewOrder(
		ctx sdk.Context,
		order Order,
	) error
	Logger(
		ctx sdk.Context,
	) log.Logger
}

type MevMetrics

type MevMetrics struct {
	MevNodeToNode MevNodeToNodeMetrics `json:"mev_node_to_node"`
	MevDatapoint  MEVDatapoint         `json:"mev_datapoint"`
}

MevMetrics represents all MEV metrics to send to the MEV telemetry service.

type MevNodeToNodeCalculationRequest

type MevNodeToNodeCalculationRequest struct {
	// Represents the matches on the "block proposer". Note that this field
	// does not need to be the actual block proposer's matches for a block, since
	// the MEV calculation logic is run with this nodes matches as the "block
	// proposer" matches.
	BlockProposerMatches *ValidatorMevMatches `protobuf:"bytes,1,opt,name=block_proposer_matches,json=blockProposerMatches,proto3" json:"block_proposer_matches,omitempty"`
	// Represents the matches and mid-prices on the validator.
	ValidatorMevMetrics *MevNodeToNodeMetrics `protobuf:"bytes,2,opt,name=validator_mev_metrics,json=validatorMevMetrics,proto3" json:"validator_mev_metrics,omitempty"`
}

MevNodeToNodeCalculationRequest is a request message used to run the MEV node <> node calculation.

func (*MevNodeToNodeCalculationRequest) Descriptor

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

func (*MevNodeToNodeCalculationRequest) GetBlockProposerMatches

func (m *MevNodeToNodeCalculationRequest) GetBlockProposerMatches() *ValidatorMevMatches

func (*MevNodeToNodeCalculationRequest) GetValidatorMevMetrics

func (m *MevNodeToNodeCalculationRequest) GetValidatorMevMetrics() *MevNodeToNodeMetrics

func (*MevNodeToNodeCalculationRequest) Marshal

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

func (*MevNodeToNodeCalculationRequest) MarshalTo

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

func (*MevNodeToNodeCalculationRequest) MarshalToSizedBuffer

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

func (*MevNodeToNodeCalculationRequest) ProtoMessage

func (*MevNodeToNodeCalculationRequest) ProtoMessage()

func (*MevNodeToNodeCalculationRequest) Reset

func (*MevNodeToNodeCalculationRequest) Size

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

func (*MevNodeToNodeCalculationRequest) String

func (*MevNodeToNodeCalculationRequest) Unmarshal

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

func (*MevNodeToNodeCalculationRequest) XXX_DiscardUnknown

func (m *MevNodeToNodeCalculationRequest) XXX_DiscardUnknown()

func (*MevNodeToNodeCalculationRequest) XXX_Marshal

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

func (*MevNodeToNodeCalculationRequest) XXX_Merge

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

func (*MevNodeToNodeCalculationRequest) XXX_Size

func (m *MevNodeToNodeCalculationRequest) XXX_Size() int

func (*MevNodeToNodeCalculationRequest) XXX_Unmarshal

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

type MevNodeToNodeCalculationResponse

type MevNodeToNodeCalculationResponse struct {
	Results []MevNodeToNodeCalculationResponse_MevAndVolumePerClob `protobuf:"bytes,1,rep,name=results,proto3" json:"results"`
}

MevNodeToNodeCalculationResponse is a response message that contains the MEV node <> node calculation result.

func (*MevNodeToNodeCalculationResponse) Descriptor

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

func (*MevNodeToNodeCalculationResponse) GetResults

func (*MevNodeToNodeCalculationResponse) Marshal

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

func (*MevNodeToNodeCalculationResponse) MarshalTo

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

func (*MevNodeToNodeCalculationResponse) MarshalToSizedBuffer

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

func (*MevNodeToNodeCalculationResponse) ProtoMessage

func (*MevNodeToNodeCalculationResponse) ProtoMessage()

func (*MevNodeToNodeCalculationResponse) Reset

func (*MevNodeToNodeCalculationResponse) Size

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

func (*MevNodeToNodeCalculationResponse) String

func (*MevNodeToNodeCalculationResponse) Unmarshal

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

func (*MevNodeToNodeCalculationResponse) XXX_DiscardUnknown

func (m *MevNodeToNodeCalculationResponse) XXX_DiscardUnknown()

func (*MevNodeToNodeCalculationResponse) XXX_Marshal

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

func (*MevNodeToNodeCalculationResponse) XXX_Merge

func (*MevNodeToNodeCalculationResponse) XXX_Size

func (m *MevNodeToNodeCalculationResponse) XXX_Size() int

func (*MevNodeToNodeCalculationResponse) XXX_Unmarshal

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

type MevNodeToNodeCalculationResponse_MevAndVolumePerClob

type MevNodeToNodeCalculationResponse_MevAndVolumePerClob struct {
	ClobPairId uint32  `protobuf:"varint,1,opt,name=clob_pair_id,json=clobPairId,proto3" json:"clob_pair_id,omitempty"`
	Mev        float32 `protobuf:"fixed32,2,opt,name=mev,proto3" json:"mev,omitempty"`
	Volume     uint64  `protobuf:"varint,3,opt,name=volume,proto3" json:"volume,omitempty"`
}

MevAndVolumePerClob contains information about the MEV and volume per CLOB.

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) Descriptor

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) GetClobPairId

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) GetMev

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) GetVolume

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) Marshal

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) MarshalTo

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) MarshalToSizedBuffer

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

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) ProtoMessage

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) Reset

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) Size

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) String

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) Unmarshal

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) XXX_DiscardUnknown

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) XXX_Marshal

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

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) XXX_Merge

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) XXX_Size

func (*MevNodeToNodeCalculationResponse_MevAndVolumePerClob) XXX_Unmarshal

type MevNodeToNodeMetrics

type MevNodeToNodeMetrics struct {
	ValidatorMevMatches *ValidatorMevMatches `protobuf:"bytes,1,opt,name=validator_mev_matches,json=validatorMevMatches,proto3" json:"validator_mev_matches,omitempty"`
	ClobMidPrices       []ClobMidPrice       `protobuf:"bytes,2,rep,name=clob_mid_prices,json=clobMidPrices,proto3" json:"clob_mid_prices"`
}

MevNodeToNodeMetrics is a data structure for encapsulating all MEV node <> node metrics.

func (*MevNodeToNodeMetrics) Descriptor

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

func (*MevNodeToNodeMetrics) GetClobMidPrices

func (m *MevNodeToNodeMetrics) GetClobMidPrices() []ClobMidPrice

func (*MevNodeToNodeMetrics) GetValidatorMevMatches

func (m *MevNodeToNodeMetrics) GetValidatorMevMatches() *ValidatorMevMatches

func (*MevNodeToNodeMetrics) Marshal

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

func (*MevNodeToNodeMetrics) MarshalTo

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

func (*MevNodeToNodeMetrics) MarshalToSizedBuffer

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

func (*MevNodeToNodeMetrics) ProtoMessage

func (*MevNodeToNodeMetrics) ProtoMessage()

func (*MevNodeToNodeMetrics) Reset

func (m *MevNodeToNodeMetrics) Reset()

func (*MevNodeToNodeMetrics) Size

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

func (*MevNodeToNodeMetrics) String

func (m *MevNodeToNodeMetrics) String() string

func (*MevNodeToNodeMetrics) Unmarshal

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

func (*MevNodeToNodeMetrics) XXX_DiscardUnknown

func (m *MevNodeToNodeMetrics) XXX_DiscardUnknown()

func (*MevNodeToNodeMetrics) XXX_Marshal

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

func (*MevNodeToNodeMetrics) XXX_Merge

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

func (*MevNodeToNodeMetrics) XXX_Size

func (m *MevNodeToNodeMetrics) XXX_Size() int

func (*MevNodeToNodeMetrics) XXX_Unmarshal

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

type MsgCancelOrder

type MsgCancelOrder struct {
	OrderId OrderId `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id"`
	// Information about when the order cancellation expires.
	//
	// Types that are valid to be assigned to GoodTilOneof:
	//	*MsgCancelOrder_GoodTilBlock
	//	*MsgCancelOrder_GoodTilBlockTime
	GoodTilOneof isMsgCancelOrder_GoodTilOneof `protobuf_oneof:"good_til_oneof"`
}

MsgCancelOrder is a request type used for canceling orders.

func NewMsgCancelOrderShortTerm

func NewMsgCancelOrderShortTerm(orderId OrderId, goodTilBlock uint32) *MsgCancelOrder

NewMsgCancelOrderShortTerm constructs a MsgCancelOrder from an `OrderId` and a `GoodTilBlock`. `OrderId` must be for a Short-Term order.

func NewMsgCancelOrderStateful

func NewMsgCancelOrderStateful(orderId OrderId, goodTilBlockTime uint32) *MsgCancelOrder

NewMsgCancelOrderStateful constructs a MsgCancelOrder from an `OrderId` and a `GoodTillBlockTime`. `OrderId` must be for a Stateful Order. Long term and conditional orderIds are acceptable.

func (*MsgCancelOrder) Descriptor

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

func (*MsgCancelOrder) GetGoodTilBlock

func (m *MsgCancelOrder) GetGoodTilBlock() uint32

func (*MsgCancelOrder) GetGoodTilBlockTime

func (m *MsgCancelOrder) GetGoodTilBlockTime() uint32

func (*MsgCancelOrder) GetGoodTilOneof

func (m *MsgCancelOrder) GetGoodTilOneof() isMsgCancelOrder_GoodTilOneof

func (*MsgCancelOrder) GetOrderId

func (m *MsgCancelOrder) GetOrderId() OrderId

func (*MsgCancelOrder) GetSigners

func (msg *MsgCancelOrder) GetSigners() []sdk.AccAddress

func (*MsgCancelOrder) Marshal

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

func (*MsgCancelOrder) MarshalTo

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

func (*MsgCancelOrder) MarshalToSizedBuffer

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

func (*MsgCancelOrder) MustGetUnixGoodTilBlockTime

func (msg *MsgCancelOrder) MustGetUnixGoodTilBlockTime() time.Time

MustGetUnixGoodTilBlockTime returns an instance of `Time` that represents the cancel's `GoodTilBlockTime`. This function panics when the order is a short-term order or when its `GoodTilBlockTime` is zero.

func (*MsgCancelOrder) ProtoMessage

func (*MsgCancelOrder) ProtoMessage()

func (*MsgCancelOrder) Reset

func (m *MsgCancelOrder) Reset()

func (*MsgCancelOrder) Size

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

func (*MsgCancelOrder) String

func (m *MsgCancelOrder) String() string

func (*MsgCancelOrder) Unmarshal

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

func (*MsgCancelOrder) ValidateBasic

func (msg *MsgCancelOrder) ValidateBasic() (err error)

func (*MsgCancelOrder) XXX_DiscardUnknown

func (m *MsgCancelOrder) XXX_DiscardUnknown()

func (*MsgCancelOrder) XXX_Marshal

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

func (*MsgCancelOrder) XXX_Merge

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

func (*MsgCancelOrder) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*MsgCancelOrder) XXX_Size

func (m *MsgCancelOrder) XXX_Size() int

func (*MsgCancelOrder) XXX_Unmarshal

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

type MsgCancelOrderResponse

type MsgCancelOrderResponse struct {
}

MsgCancelOrderResponse is a response type used for canceling orders.

func (*MsgCancelOrderResponse) Descriptor

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

func (*MsgCancelOrderResponse) Marshal

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

func (*MsgCancelOrderResponse) MarshalTo

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

func (*MsgCancelOrderResponse) MarshalToSizedBuffer

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

func (*MsgCancelOrderResponse) ProtoMessage

func (*MsgCancelOrderResponse) ProtoMessage()

func (*MsgCancelOrderResponse) Reset

func (m *MsgCancelOrderResponse) Reset()

func (*MsgCancelOrderResponse) Size

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

func (*MsgCancelOrderResponse) String

func (m *MsgCancelOrderResponse) String() string

func (*MsgCancelOrderResponse) Unmarshal

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

func (*MsgCancelOrderResponse) XXX_DiscardUnknown

func (m *MsgCancelOrderResponse) XXX_DiscardUnknown()

func (*MsgCancelOrderResponse) XXX_Marshal

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

func (*MsgCancelOrderResponse) XXX_Merge

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

func (*MsgCancelOrderResponse) XXX_Size

func (m *MsgCancelOrderResponse) XXX_Size() int

func (*MsgCancelOrderResponse) XXX_Unmarshal

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

type MsgCancelOrder_GoodTilBlock

type MsgCancelOrder_GoodTilBlock struct {
	GoodTilBlock uint32 `protobuf:"varint,2,opt,name=good_til_block,json=goodTilBlock,proto3,oneof" json:"good_til_block,omitempty"`
}

func (*MsgCancelOrder_GoodTilBlock) MarshalTo

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

func (*MsgCancelOrder_GoodTilBlock) MarshalToSizedBuffer

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

func (*MsgCancelOrder_GoodTilBlock) Size

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

type MsgCancelOrder_GoodTilBlockTime

type MsgCancelOrder_GoodTilBlockTime struct {
	GoodTilBlockTime uint32 `protobuf:"fixed32,3,opt,name=good_til_block_time,json=goodTilBlockTime,proto3,oneof" json:"good_til_block_time,omitempty"`
}

func (*MsgCancelOrder_GoodTilBlockTime) MarshalTo

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

func (*MsgCancelOrder_GoodTilBlockTime) MarshalToSizedBuffer

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

func (*MsgCancelOrder_GoodTilBlockTime) Size

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

type MsgClient

type MsgClient interface {
	// ProposedOperations is a temporary message used by block proposers
	// for matching orders as part of the ABCI++ workaround.
	ProposedOperations(ctx context.Context, in *MsgProposedOperations, opts ...grpc.CallOption) (*MsgProposedOperationsResponse, error)
	// PlaceOrder allows accounts to place orders on the orderbook.
	PlaceOrder(ctx context.Context, in *MsgPlaceOrder, opts ...grpc.CallOption) (*MsgPlaceOrderResponse, error)
	// CancelOrder allows accounts to cancel existing orders on the orderbook.
	CancelOrder(ctx context.Context, in *MsgCancelOrder, opts ...grpc.CallOption) (*MsgCancelOrderResponse, error)
	// CreateClobPair creates a new clob pair.
	CreateClobPair(ctx context.Context, in *MsgCreateClobPair, opts ...grpc.CallOption) (*MsgCreateClobPairResponse, error)
	// UpdateClobPair sets the status of a clob pair. Should return an error
	// if the authority is not in the clob keeper's set of authorities,
	// if the ClobPair id is not found in state, or if the update includes
	// an unsupported status transition.
	UpdateClobPair(ctx context.Context, in *MsgUpdateClobPair, opts ...grpc.CallOption) (*MsgUpdateClobPairResponse, error)
	// UpdateEquityTierLimitConfiguration updates the equity tier limit
	// configuration in state.
	UpdateEquityTierLimitConfiguration(ctx context.Context, in *MsgUpdateEquityTierLimitConfiguration, opts ...grpc.CallOption) (*MsgUpdateEquityTierLimitConfigurationResponse, error)
	// UpdateBlockRateLimitConfiguration updates the block rate limit
	// configuration in state.
	UpdateBlockRateLimitConfiguration(ctx context.Context, in *MsgUpdateBlockRateLimitConfiguration, opts ...grpc.CallOption) (*MsgUpdateBlockRateLimitConfigurationResponse, error)
	// UpdateLiquidationsConfig updates the liquidations configuration in state.
	UpdateLiquidationsConfig(ctx context.Context, in *MsgUpdateLiquidationsConfig, opts ...grpc.CallOption) (*MsgUpdateLiquidationsConfigResponse, 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 MsgCreateClobPair

type MsgCreateClobPair struct {
	// The address that controls the module.
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// `clob_pair` defines parameters for the new clob pair.
	ClobPair ClobPair `protobuf:"bytes,2,opt,name=clob_pair,json=clobPair,proto3" json:"clob_pair"`
}

MsgCreateClobPair is a message used by x/gov for creating a new clob pair.

func (*MsgCreateClobPair) Descriptor

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

func (*MsgCreateClobPair) GetAuthority

func (m *MsgCreateClobPair) GetAuthority() string

func (*MsgCreateClobPair) GetClobPair

func (m *MsgCreateClobPair) GetClobPair() ClobPair

func (*MsgCreateClobPair) GetSigners

func (msg *MsgCreateClobPair) GetSigners() []sdk.AccAddress

func (*MsgCreateClobPair) Marshal

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

func (*MsgCreateClobPair) MarshalTo

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

func (*MsgCreateClobPair) MarshalToSizedBuffer

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

func (*MsgCreateClobPair) ProtoMessage

func (*MsgCreateClobPair) ProtoMessage()

func (*MsgCreateClobPair) Reset

func (m *MsgCreateClobPair) Reset()

func (*MsgCreateClobPair) Size

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

func (*MsgCreateClobPair) String

func (m *MsgCreateClobPair) String() string

func (*MsgCreateClobPair) Unmarshal

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

func (*MsgCreateClobPair) ValidateBasic

func (msg *MsgCreateClobPair) ValidateBasic() error

func (*MsgCreateClobPair) XXX_DiscardUnknown

func (m *MsgCreateClobPair) XXX_DiscardUnknown()

func (*MsgCreateClobPair) XXX_Marshal

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

func (*MsgCreateClobPair) XXX_Merge

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

func (*MsgCreateClobPair) XXX_Size

func (m *MsgCreateClobPair) XXX_Size() int

func (*MsgCreateClobPair) XXX_Unmarshal

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

type MsgCreateClobPairResponse

type MsgCreateClobPairResponse struct {
}

MsgCreateClobPairResponse defines the CreateClobPair response type.

func (*MsgCreateClobPairResponse) Descriptor

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

func (*MsgCreateClobPairResponse) Marshal

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

func (*MsgCreateClobPairResponse) MarshalTo

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

func (*MsgCreateClobPairResponse) MarshalToSizedBuffer

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

func (*MsgCreateClobPairResponse) ProtoMessage

func (*MsgCreateClobPairResponse) ProtoMessage()

func (*MsgCreateClobPairResponse) Reset

func (m *MsgCreateClobPairResponse) Reset()

func (*MsgCreateClobPairResponse) Size

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

func (*MsgCreateClobPairResponse) String

func (m *MsgCreateClobPairResponse) String() string

func (*MsgCreateClobPairResponse) Unmarshal

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

func (*MsgCreateClobPairResponse) XXX_DiscardUnknown

func (m *MsgCreateClobPairResponse) XXX_DiscardUnknown()

func (*MsgCreateClobPairResponse) XXX_Marshal

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

func (*MsgCreateClobPairResponse) XXX_Merge

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

func (*MsgCreateClobPairResponse) XXX_Size

func (m *MsgCreateClobPairResponse) XXX_Size() int

func (*MsgCreateClobPairResponse) XXX_Unmarshal

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

type MsgPlaceOrder

type MsgPlaceOrder struct {
	Order Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order"`
}

MsgPlaceOrder is a request type used for placing orders.

func NewMsgPlaceOrder

func NewMsgPlaceOrder(order Order) *MsgPlaceOrder

func (*MsgPlaceOrder) Descriptor

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

func (*MsgPlaceOrder) GetOrder

func (m *MsgPlaceOrder) GetOrder() Order

func (*MsgPlaceOrder) GetSigners

func (msg *MsgPlaceOrder) GetSigners() []sdk.AccAddress

func (*MsgPlaceOrder) Marshal

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

func (*MsgPlaceOrder) MarshalTo

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

func (*MsgPlaceOrder) MarshalToSizedBuffer

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

func (*MsgPlaceOrder) ProtoMessage

func (*MsgPlaceOrder) ProtoMessage()

func (*MsgPlaceOrder) Reset

func (m *MsgPlaceOrder) Reset()

func (*MsgPlaceOrder) Size

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

func (*MsgPlaceOrder) String

func (m *MsgPlaceOrder) String() string

func (*MsgPlaceOrder) Unmarshal

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

func (*MsgPlaceOrder) ValidateBasic

func (msg *MsgPlaceOrder) ValidateBasic() (err error)

func (*MsgPlaceOrder) XXX_DiscardUnknown

func (m *MsgPlaceOrder) XXX_DiscardUnknown()

func (*MsgPlaceOrder) XXX_Marshal

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

func (*MsgPlaceOrder) XXX_Merge

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

func (*MsgPlaceOrder) XXX_Size

func (m *MsgPlaceOrder) XXX_Size() int

func (*MsgPlaceOrder) XXX_Unmarshal

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

type MsgPlaceOrderResponse

type MsgPlaceOrderResponse struct {
}

MsgPlaceOrderResponse is a response type used for placing orders.

func (*MsgPlaceOrderResponse) Descriptor

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

func (*MsgPlaceOrderResponse) Marshal

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

func (*MsgPlaceOrderResponse) MarshalTo

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

func (*MsgPlaceOrderResponse) MarshalToSizedBuffer

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

func (*MsgPlaceOrderResponse) ProtoMessage

func (*MsgPlaceOrderResponse) ProtoMessage()

func (*MsgPlaceOrderResponse) Reset

func (m *MsgPlaceOrderResponse) Reset()

func (*MsgPlaceOrderResponse) Size

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

func (*MsgPlaceOrderResponse) String

func (m *MsgPlaceOrderResponse) String() string

func (*MsgPlaceOrderResponse) Unmarshal

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

func (*MsgPlaceOrderResponse) XXX_DiscardUnknown

func (m *MsgPlaceOrderResponse) XXX_DiscardUnknown()

func (*MsgPlaceOrderResponse) XXX_Marshal

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

func (*MsgPlaceOrderResponse) XXX_Merge

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

func (*MsgPlaceOrderResponse) XXX_Size

func (m *MsgPlaceOrderResponse) XXX_Size() int

func (*MsgPlaceOrderResponse) XXX_Unmarshal

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

type MsgProposedOperations

type MsgProposedOperations struct {
	// The list of operations proposed by the block proposer.
	OperationsQueue []OperationRaw `protobuf:"bytes,1,rep,name=operations_queue,json=operationsQueue,proto3" json:"operations_queue"`
}

MsgProposedOperations is a message injected by block proposers to specify the operations that occurred in a block.

func (*MsgProposedOperations) Descriptor

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

func (*MsgProposedOperations) GetOperationsQueue

func (m *MsgProposedOperations) GetOperationsQueue() []OperationRaw

func (*MsgProposedOperations) GetSigners

func (msg *MsgProposedOperations) GetSigners() []sdk.AccAddress

func (*MsgProposedOperations) Marshal

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

func (*MsgProposedOperations) MarshalTo

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

func (*MsgProposedOperations) MarshalToSizedBuffer

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

func (*MsgProposedOperations) ProtoMessage

func (*MsgProposedOperations) ProtoMessage()

func (*MsgProposedOperations) Reset

func (m *MsgProposedOperations) Reset()

func (*MsgProposedOperations) Size

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

func (*MsgProposedOperations) String

func (m *MsgProposedOperations) String() string

func (*MsgProposedOperations) Unmarshal

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

func (*MsgProposedOperations) ValidateBasic

func (msg *MsgProposedOperations) ValidateBasic() error

Stateless validation for MsgProposedOperations is located in ValidateAndTransformRawOperations.

func (*MsgProposedOperations) XXX_DiscardUnknown

func (m *MsgProposedOperations) XXX_DiscardUnknown()

func (*MsgProposedOperations) XXX_Marshal

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

func (*MsgProposedOperations) XXX_Merge

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

func (*MsgProposedOperations) XXX_Size

func (m *MsgProposedOperations) XXX_Size() int

func (*MsgProposedOperations) XXX_Unmarshal

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

type MsgProposedOperationsResponse

type MsgProposedOperationsResponse struct {
}

MsgProposedOperationsResponse is the response type of the message injected by block proposers to specify the operations that occurred in a block.

func (*MsgProposedOperationsResponse) Descriptor

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

func (*MsgProposedOperationsResponse) Marshal

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

func (*MsgProposedOperationsResponse) MarshalTo

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

func (*MsgProposedOperationsResponse) MarshalToSizedBuffer

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

func (*MsgProposedOperationsResponse) ProtoMessage

func (*MsgProposedOperationsResponse) ProtoMessage()

func (*MsgProposedOperationsResponse) Reset

func (m *MsgProposedOperationsResponse) Reset()

func (*MsgProposedOperationsResponse) Size

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

func (*MsgProposedOperationsResponse) String

func (*MsgProposedOperationsResponse) Unmarshal

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

func (*MsgProposedOperationsResponse) XXX_DiscardUnknown

func (m *MsgProposedOperationsResponse) XXX_DiscardUnknown()

func (*MsgProposedOperationsResponse) XXX_Marshal

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

func (*MsgProposedOperationsResponse) XXX_Merge

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

func (*MsgProposedOperationsResponse) XXX_Size

func (m *MsgProposedOperationsResponse) XXX_Size() int

func (*MsgProposedOperationsResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// ProposedOperations is a temporary message used by block proposers
	// for matching orders as part of the ABCI++ workaround.
	ProposedOperations(context.Context, *MsgProposedOperations) (*MsgProposedOperationsResponse, error)
	// PlaceOrder allows accounts to place orders on the orderbook.
	PlaceOrder(context.Context, *MsgPlaceOrder) (*MsgPlaceOrderResponse, error)
	// CancelOrder allows accounts to cancel existing orders on the orderbook.
	CancelOrder(context.Context, *MsgCancelOrder) (*MsgCancelOrderResponse, error)
	// CreateClobPair creates a new clob pair.
	CreateClobPair(context.Context, *MsgCreateClobPair) (*MsgCreateClobPairResponse, error)
	// UpdateClobPair sets the status of a clob pair. Should return an error
	// if the authority is not in the clob keeper's set of authorities,
	// if the ClobPair id is not found in state, or if the update includes
	// an unsupported status transition.
	UpdateClobPair(context.Context, *MsgUpdateClobPair) (*MsgUpdateClobPairResponse, error)
	// UpdateEquityTierLimitConfiguration updates the equity tier limit
	// configuration in state.
	UpdateEquityTierLimitConfiguration(context.Context, *MsgUpdateEquityTierLimitConfiguration) (*MsgUpdateEquityTierLimitConfigurationResponse, error)
	// UpdateBlockRateLimitConfiguration updates the block rate limit
	// configuration in state.
	UpdateBlockRateLimitConfiguration(context.Context, *MsgUpdateBlockRateLimitConfiguration) (*MsgUpdateBlockRateLimitConfigurationResponse, error)
	// UpdateLiquidationsConfig updates the liquidations configuration in state.
	UpdateLiquidationsConfig(context.Context, *MsgUpdateLiquidationsConfig) (*MsgUpdateLiquidationsConfigResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdateBlockRateLimitConfiguration

type MsgUpdateBlockRateLimitConfiguration struct {
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// Defines the block rate limit configuration to update to. All fields must be
	// set.
	BlockRateLimitConfig BlockRateLimitConfiguration `protobuf:"bytes,3,opt,name=block_rate_limit_config,json=blockRateLimitConfig,proto3" json:"block_rate_limit_config"`
}

MsgUpdateBlockRateLimitConfiguration is the Msg/BlockRateLimitConfiguration request type.

func (*MsgUpdateBlockRateLimitConfiguration) Descriptor

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

func (*MsgUpdateBlockRateLimitConfiguration) GetAuthority

func (m *MsgUpdateBlockRateLimitConfiguration) GetAuthority() string

func (*MsgUpdateBlockRateLimitConfiguration) GetBlockRateLimitConfig

func (*MsgUpdateBlockRateLimitConfiguration) GetSigners

func (*MsgUpdateBlockRateLimitConfiguration) Marshal

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

func (*MsgUpdateBlockRateLimitConfiguration) MarshalTo

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

func (*MsgUpdateBlockRateLimitConfiguration) MarshalToSizedBuffer

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

func (*MsgUpdateBlockRateLimitConfiguration) ProtoMessage

func (*MsgUpdateBlockRateLimitConfiguration) ProtoMessage()

func (*MsgUpdateBlockRateLimitConfiguration) Reset

func (*MsgUpdateBlockRateLimitConfiguration) Size

func (*MsgUpdateBlockRateLimitConfiguration) String

func (*MsgUpdateBlockRateLimitConfiguration) Unmarshal

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

func (*MsgUpdateBlockRateLimitConfiguration) ValidateBasic

func (msg *MsgUpdateBlockRateLimitConfiguration) ValidateBasic() error

func (*MsgUpdateBlockRateLimitConfiguration) XXX_DiscardUnknown

func (m *MsgUpdateBlockRateLimitConfiguration) XXX_DiscardUnknown()

func (*MsgUpdateBlockRateLimitConfiguration) XXX_Marshal

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

func (*MsgUpdateBlockRateLimitConfiguration) XXX_Merge

func (*MsgUpdateBlockRateLimitConfiguration) XXX_Size

func (*MsgUpdateBlockRateLimitConfiguration) XXX_Unmarshal

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

type MsgUpdateBlockRateLimitConfigurationResponse

type MsgUpdateBlockRateLimitConfigurationResponse struct {
}

MsgUpdateBlockRateLimitConfiguration is a response type for updating the liquidations config.

func (*MsgUpdateBlockRateLimitConfigurationResponse) Descriptor

func (*MsgUpdateBlockRateLimitConfigurationResponse) Marshal

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

func (*MsgUpdateBlockRateLimitConfigurationResponse) MarshalTo

func (*MsgUpdateBlockRateLimitConfigurationResponse) MarshalToSizedBuffer

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

func (*MsgUpdateBlockRateLimitConfigurationResponse) ProtoMessage

func (*MsgUpdateBlockRateLimitConfigurationResponse) Reset

func (*MsgUpdateBlockRateLimitConfigurationResponse) Size

func (*MsgUpdateBlockRateLimitConfigurationResponse) String

func (*MsgUpdateBlockRateLimitConfigurationResponse) Unmarshal

func (*MsgUpdateBlockRateLimitConfigurationResponse) XXX_DiscardUnknown

func (m *MsgUpdateBlockRateLimitConfigurationResponse) XXX_DiscardUnknown()

func (*MsgUpdateBlockRateLimitConfigurationResponse) XXX_Marshal

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

func (*MsgUpdateBlockRateLimitConfigurationResponse) XXX_Merge

func (*MsgUpdateBlockRateLimitConfigurationResponse) XXX_Size

func (*MsgUpdateBlockRateLimitConfigurationResponse) XXX_Unmarshal

type MsgUpdateClobPair

type MsgUpdateClobPair struct {
	// Authority is the address that may send this message.
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// `clob_pair` is the ClobPair to write to state.
	ClobPair ClobPair `protobuf:"bytes,2,opt,name=clob_pair,json=clobPair,proto3" json:"clob_pair"`
}

MsgUpdateClobPair is a request type used for updating a ClobPair in state.

func (*MsgUpdateClobPair) Descriptor

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

func (*MsgUpdateClobPair) GetAuthority

func (m *MsgUpdateClobPair) GetAuthority() string

func (*MsgUpdateClobPair) GetClobPair

func (m *MsgUpdateClobPair) GetClobPair() ClobPair

func (*MsgUpdateClobPair) GetSigners

func (msg *MsgUpdateClobPair) GetSigners() []sdk.AccAddress

GetSigners requires that the MsgUpdateClobPair message is signed by the gov module.

func (*MsgUpdateClobPair) Marshal

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

func (*MsgUpdateClobPair) MarshalTo

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

func (*MsgUpdateClobPair) MarshalToSizedBuffer

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

func (*MsgUpdateClobPair) ProtoMessage

func (*MsgUpdateClobPair) ProtoMessage()

func (*MsgUpdateClobPair) Reset

func (m *MsgUpdateClobPair) Reset()

func (*MsgUpdateClobPair) Size

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

func (*MsgUpdateClobPair) String

func (m *MsgUpdateClobPair) String() string

func (*MsgUpdateClobPair) Unmarshal

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

func (*MsgUpdateClobPair) ValidateBasic

func (msg *MsgUpdateClobPair) ValidateBasic() error

ValidateBasic validates that the message's ClobPair status is a supported status.

func (*MsgUpdateClobPair) XXX_DiscardUnknown

func (m *MsgUpdateClobPair) XXX_DiscardUnknown()

func (*MsgUpdateClobPair) XXX_Marshal

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

func (*MsgUpdateClobPair) XXX_Merge

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

func (*MsgUpdateClobPair) XXX_Size

func (m *MsgUpdateClobPair) XXX_Size() int

func (*MsgUpdateClobPair) XXX_Unmarshal

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

type MsgUpdateClobPairResponse

type MsgUpdateClobPairResponse struct {
}

MsgUpdateClobPairResponse is a response type used for setting a ClobPair's status.

func (*MsgUpdateClobPairResponse) Descriptor

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

func (*MsgUpdateClobPairResponse) Marshal

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

func (*MsgUpdateClobPairResponse) MarshalTo

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

func (*MsgUpdateClobPairResponse) MarshalToSizedBuffer

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

func (*MsgUpdateClobPairResponse) ProtoMessage

func (*MsgUpdateClobPairResponse) ProtoMessage()

func (*MsgUpdateClobPairResponse) Reset

func (m *MsgUpdateClobPairResponse) Reset()

func (*MsgUpdateClobPairResponse) Size

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

func (*MsgUpdateClobPairResponse) String

func (m *MsgUpdateClobPairResponse) String() string

func (*MsgUpdateClobPairResponse) Unmarshal

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

func (*MsgUpdateClobPairResponse) XXX_DiscardUnknown

func (m *MsgUpdateClobPairResponse) XXX_DiscardUnknown()

func (*MsgUpdateClobPairResponse) XXX_Marshal

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

func (*MsgUpdateClobPairResponse) XXX_Merge

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

func (*MsgUpdateClobPairResponse) XXX_Size

func (m *MsgUpdateClobPairResponse) XXX_Size() int

func (*MsgUpdateClobPairResponse) XXX_Unmarshal

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

type MsgUpdateEquityTierLimitConfiguration

type MsgUpdateEquityTierLimitConfiguration struct {
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// Defines the equity tier limit configuration to update to. All fields must
	// be set.
	EquityTierLimitConfig EquityTierLimitConfiguration `protobuf:"bytes,2,opt,name=equity_tier_limit_config,json=equityTierLimitConfig,proto3" json:"equity_tier_limit_config"`
}

MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration request type.

func (*MsgUpdateEquityTierLimitConfiguration) Descriptor

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

func (*MsgUpdateEquityTierLimitConfiguration) GetAuthority

func (*MsgUpdateEquityTierLimitConfiguration) GetEquityTierLimitConfig

func (*MsgUpdateEquityTierLimitConfiguration) GetSigners

func (*MsgUpdateEquityTierLimitConfiguration) Marshal

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

func (*MsgUpdateEquityTierLimitConfiguration) MarshalTo

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

func (*MsgUpdateEquityTierLimitConfiguration) MarshalToSizedBuffer

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

func (*MsgUpdateEquityTierLimitConfiguration) ProtoMessage

func (*MsgUpdateEquityTierLimitConfiguration) ProtoMessage()

func (*MsgUpdateEquityTierLimitConfiguration) Reset

func (*MsgUpdateEquityTierLimitConfiguration) Size

func (*MsgUpdateEquityTierLimitConfiguration) String

func (*MsgUpdateEquityTierLimitConfiguration) Unmarshal

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

func (*MsgUpdateEquityTierLimitConfiguration) ValidateBasic

func (msg *MsgUpdateEquityTierLimitConfiguration) ValidateBasic() error

func (*MsgUpdateEquityTierLimitConfiguration) XXX_DiscardUnknown

func (m *MsgUpdateEquityTierLimitConfiguration) XXX_DiscardUnknown()

func (*MsgUpdateEquityTierLimitConfiguration) XXX_Marshal

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

func (*MsgUpdateEquityTierLimitConfiguration) XXX_Merge

func (*MsgUpdateEquityTierLimitConfiguration) XXX_Size

func (*MsgUpdateEquityTierLimitConfiguration) XXX_Unmarshal

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

type MsgUpdateEquityTierLimitConfigurationResponse

type MsgUpdateEquityTierLimitConfigurationResponse struct {
}

MsgUpdateEquityTierLimitConfiguration is the Msg/EquityTierLimitConfiguration response type.

func (*MsgUpdateEquityTierLimitConfigurationResponse) Descriptor

func (*MsgUpdateEquityTierLimitConfigurationResponse) Marshal

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

func (*MsgUpdateEquityTierLimitConfigurationResponse) MarshalTo

func (*MsgUpdateEquityTierLimitConfigurationResponse) MarshalToSizedBuffer

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

func (*MsgUpdateEquityTierLimitConfigurationResponse) ProtoMessage

func (*MsgUpdateEquityTierLimitConfigurationResponse) Reset

func (*MsgUpdateEquityTierLimitConfigurationResponse) Size

func (*MsgUpdateEquityTierLimitConfigurationResponse) String

func (*MsgUpdateEquityTierLimitConfigurationResponse) Unmarshal

func (*MsgUpdateEquityTierLimitConfigurationResponse) XXX_DiscardUnknown

func (m *MsgUpdateEquityTierLimitConfigurationResponse) XXX_DiscardUnknown()

func (*MsgUpdateEquityTierLimitConfigurationResponse) XXX_Marshal

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

func (*MsgUpdateEquityTierLimitConfigurationResponse) XXX_Merge

func (*MsgUpdateEquityTierLimitConfigurationResponse) XXX_Size

func (*MsgUpdateEquityTierLimitConfigurationResponse) XXX_Unmarshal

type MsgUpdateLiquidationsConfig

type MsgUpdateLiquidationsConfig struct {
	// Authority is the address that may send this message.
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// Defines the liquidations configuration to update to. All fields must
	// be set.
	LiquidationsConfig LiquidationsConfig `protobuf:"bytes,2,opt,name=liquidations_config,json=liquidationsConfig,proto3" json:"liquidations_config"`
}

MsgUpdateLiquidationsConfig is a request type for updating the liquidations config.

func (*MsgUpdateLiquidationsConfig) Descriptor

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

func (*MsgUpdateLiquidationsConfig) GetAuthority

func (m *MsgUpdateLiquidationsConfig) GetAuthority() string

func (*MsgUpdateLiquidationsConfig) GetLiquidationsConfig

func (m *MsgUpdateLiquidationsConfig) GetLiquidationsConfig() LiquidationsConfig

func (*MsgUpdateLiquidationsConfig) GetSigners

func (msg *MsgUpdateLiquidationsConfig) GetSigners() []sdk.AccAddress

GetSigners requires that the MsgUpdateLiquidationsConfig message is signed by the gov module.

func (*MsgUpdateLiquidationsConfig) Marshal

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

func (*MsgUpdateLiquidationsConfig) MarshalTo

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

func (*MsgUpdateLiquidationsConfig) MarshalToSizedBuffer

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

func (*MsgUpdateLiquidationsConfig) ProtoMessage

func (*MsgUpdateLiquidationsConfig) ProtoMessage()

func (*MsgUpdateLiquidationsConfig) Reset

func (m *MsgUpdateLiquidationsConfig) Reset()

func (*MsgUpdateLiquidationsConfig) Size

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

func (*MsgUpdateLiquidationsConfig) String

func (m *MsgUpdateLiquidationsConfig) String() string

func (*MsgUpdateLiquidationsConfig) Unmarshal

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

func (*MsgUpdateLiquidationsConfig) ValidateBasic

func (msg *MsgUpdateLiquidationsConfig) ValidateBasic() error

ValidateBasic validates the message's LiquidationConfig. Returns an error if the authority is empty or if the LiquidationsConfig is invalid.

func (*MsgUpdateLiquidationsConfig) XXX_DiscardUnknown

func (m *MsgUpdateLiquidationsConfig) XXX_DiscardUnknown()

func (*MsgUpdateLiquidationsConfig) XXX_Marshal

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

func (*MsgUpdateLiquidationsConfig) XXX_Merge

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

func (*MsgUpdateLiquidationsConfig) XXX_Size

func (m *MsgUpdateLiquidationsConfig) XXX_Size() int

func (*MsgUpdateLiquidationsConfig) XXX_Unmarshal

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

type MsgUpdateLiquidationsConfigResponse

type MsgUpdateLiquidationsConfigResponse struct {
}

MsgUpdateLiquidationsConfig is the Msg/LiquidationsConfig response type.

func (*MsgUpdateLiquidationsConfigResponse) Descriptor

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

func (*MsgUpdateLiquidationsConfigResponse) Marshal

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

func (*MsgUpdateLiquidationsConfigResponse) MarshalTo

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

func (*MsgUpdateLiquidationsConfigResponse) MarshalToSizedBuffer

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

func (*MsgUpdateLiquidationsConfigResponse) ProtoMessage

func (*MsgUpdateLiquidationsConfigResponse) ProtoMessage()

func (*MsgUpdateLiquidationsConfigResponse) Reset

func (*MsgUpdateLiquidationsConfigResponse) Size

func (*MsgUpdateLiquidationsConfigResponse) String

func (*MsgUpdateLiquidationsConfigResponse) Unmarshal

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

func (*MsgUpdateLiquidationsConfigResponse) XXX_DiscardUnknown

func (m *MsgUpdateLiquidationsConfigResponse) XXX_DiscardUnknown()

func (*MsgUpdateLiquidationsConfigResponse) XXX_Marshal

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

func (*MsgUpdateLiquidationsConfigResponse) XXX_Merge

func (*MsgUpdateLiquidationsConfigResponse) XXX_Size

func (*MsgUpdateLiquidationsConfigResponse) XXX_Unmarshal

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

type OffchainUpdateMessage

type OffchainUpdateMessage struct {
	Type    OffchainUpdateMessageType
	OrderId OrderId
	Message msgsender.Message
}

Represents a single message added to the OffchainUpdates. It contains additional metadata needed for message manipulation for specific scenarios, such as Replay.

type OffchainUpdateMessageType

type OffchainUpdateMessageType int
const (
	PlaceMessageType OffchainUpdateMessageType = iota
	RemoveMessageType
	UpdateMessageType
)

Enum used to track the types of messages, should correspond to the types of messages defined in https://github.com/dydxprotocol/v4-proto/blob/main/dydxprotocol/indexer/off_chain_updates/off_chain_updates.proto

type OffchainUpdates

type OffchainUpdates struct {
	Messages []OffchainUpdateMessage
}

Handles the collection of messages meant for Indexer's off-chain update ingestion.

func NewOffchainUpdates

func NewOffchainUpdates() *OffchainUpdates

NewOffchainupdates creates a new OffchainUpdates struct and returns a pointer to it.

func (*OffchainUpdates) AddPlaceMessage

func (om *OffchainUpdates) AddPlaceMessage(orderId OrderId, message msgsender.Message)

AddPlaceMessage adds an off-chain message for the placing of an order to the OffchainUpdates.

func (*OffchainUpdates) AddRemoveMessage

func (om *OffchainUpdates) AddRemoveMessage(orderId OrderId, message msgsender.Message)

AddRemoveMessage adds an off-chain message for the removal of an order to the OffchainUpdates.

func (*OffchainUpdates) AddUpdateMessage

func (om *OffchainUpdates) AddUpdateMessage(orderId OrderId, message msgsender.Message)

AddUpdateMessage adds an off-chain message for the update of an order to the OffchainUpdates.

func (*OffchainUpdates) Append

func (om *OffchainUpdates) Append(newMessages *OffchainUpdates)

Append adds all of of the messages from another OffchainUpdates struct in order.

func (*OffchainUpdates) CondenseMessagesForReplay

func (om *OffchainUpdates) CondenseMessagesForReplay()

CondenseMessageForReplay removes all but the last off-chain message for each OrderId from the slice of all off-chain messages tracked by the OffchainUpdates struct with the exception of OrderPlace messages. Intended for use after off-chain messages are generated when replaying multiple operations.

func (*OffchainUpdates) GetMessages

func (om *OffchainUpdates) GetMessages() []msgsender.Message

GetMessages returns all the off-chaim messages in the OffchainUpdates struct.

type Operation

type Operation struct {
	// operation represents the operation that occurred, which can be a match,
	// short term order placement, short term order cancellation, or the placement
	// of a pre-existing stateful order.
	//
	// Types that are valid to be assigned to Operation:
	//	*Operation_Match
	//	*Operation_ShortTermOrderPlacement
	//	*Operation_ShortTermOrderCancellation
	//	*Operation_PreexistingStatefulOrder
	Operation isOperation_Operation `protobuf_oneof:"operation"`
}

Operation represents an operation in the proposed operations. Operation is used internally within the memclob only.

func (*Operation) Descriptor

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

func (*Operation) GetMatch

func (m *Operation) GetMatch() *ClobMatch

func (*Operation) GetOperation

func (m *Operation) GetOperation() isOperation_Operation

func (*Operation) GetPreexistingStatefulOrder

func (m *Operation) GetPreexistingStatefulOrder() *OrderId

func (*Operation) GetShortTermOrderCancellation

func (m *Operation) GetShortTermOrderCancellation() *MsgCancelOrder

func (*Operation) GetShortTermOrderPlacement

func (m *Operation) GetShortTermOrderPlacement() *MsgPlaceOrder

func (*Operation) Marshal

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

func (*Operation) MarshalTo

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

func (*Operation) MarshalToSizedBuffer

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

func (*Operation) ProtoMessage

func (*Operation) ProtoMessage()

func (*Operation) Reset

func (m *Operation) Reset()

func (*Operation) Size

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

func (*Operation) String

func (m *Operation) String() string

func (*Operation) Unmarshal

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

func (*Operation) XXX_DiscardUnknown

func (m *Operation) XXX_DiscardUnknown()

func (*Operation) XXX_Marshal

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

func (*Operation) XXX_Merge

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

func (*Operation) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*Operation) XXX_Size

func (m *Operation) XXX_Size() int

func (*Operation) XXX_Unmarshal

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

type OperationRaw

type OperationRaw struct {
	// operationRaw represents an operation that occurred, which can be a match,
	// a signed order placement, or an order removal.
	//
	// Types that are valid to be assigned to Operation:
	//
	//	*OperationRaw_Match
	//	*OperationRaw_ShortTermOrderPlacement
	//	*OperationRaw_OrderRemoval
	Operation isOperationRaw_Operation `protobuf_oneof:"operation"`
}

OperationRaw represents an operation in the proposed operations. Note that the `order_placement` operation is a signed message.

func (*OperationRaw) Descriptor

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

func (*OperationRaw) GetMatch

func (m *OperationRaw) GetMatch() *ClobMatch

func (*OperationRaw) GetOperation

func (m *OperationRaw) GetOperation() isOperationRaw_Operation

func (*OperationRaw) GetOrderRemoval

func (m *OperationRaw) GetOrderRemoval() *OrderRemoval

func (*OperationRaw) GetShortTermOrderPlacement

func (m *OperationRaw) GetShortTermOrderPlacement() []byte

func (*OperationRaw) Marshal

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

func (*OperationRaw) MarshalTo

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

func (*OperationRaw) MarshalToSizedBuffer

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

func (*OperationRaw) ProtoMessage

func (*OperationRaw) ProtoMessage()

func (*OperationRaw) Reset

func (m *OperationRaw) Reset()

func (*OperationRaw) Size

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

func (*OperationRaw) String

func (m *OperationRaw) String() string

func (*OperationRaw) Unmarshal

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

func (*OperationRaw) XXX_DiscardUnknown

func (m *OperationRaw) XXX_DiscardUnknown()

func (*OperationRaw) XXX_Marshal

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

func (*OperationRaw) XXX_Merge

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

func (*OperationRaw) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*OperationRaw) XXX_Size

func (m *OperationRaw) XXX_Size() int

func (*OperationRaw) XXX_Unmarshal

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

type OperationRaw_Match

type OperationRaw_Match struct {
	Match *ClobMatch `protobuf:"bytes,1,opt,name=match,proto3,oneof" json:"match,omitempty"`
}

func (*OperationRaw_Match) MarshalTo

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

func (*OperationRaw_Match) MarshalToSizedBuffer

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

func (*OperationRaw_Match) Size

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

type OperationRaw_OrderRemoval

type OperationRaw_OrderRemoval struct {
	OrderRemoval *OrderRemoval `protobuf:"bytes,3,opt,name=order_removal,json=orderRemoval,proto3,oneof" json:"order_removal,omitempty"`
}

func (*OperationRaw_OrderRemoval) MarshalTo

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

func (*OperationRaw_OrderRemoval) MarshalToSizedBuffer

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

func (*OperationRaw_OrderRemoval) Size

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

type OperationRaw_ShortTermOrderPlacement

type OperationRaw_ShortTermOrderPlacement struct {
	ShortTermOrderPlacement []byte `` /* 140-byte string literal not displayed */
}

func (*OperationRaw_ShortTermOrderPlacement) MarshalTo

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

func (*OperationRaw_ShortTermOrderPlacement) MarshalToSizedBuffer

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

func (*OperationRaw_ShortTermOrderPlacement) Size

type Operation_Match

type Operation_Match struct {
	Match *ClobMatch `protobuf:"bytes,1,opt,name=match,proto3,oneof" json:"match,omitempty"`
}

func (*Operation_Match) MarshalTo

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

func (*Operation_Match) MarshalToSizedBuffer

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

func (*Operation_Match) Size

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

type Operation_PreexistingStatefulOrder

type Operation_PreexistingStatefulOrder struct {
	PreexistingStatefulOrder *OrderId `` /* 141-byte string literal not displayed */
}

func (*Operation_PreexistingStatefulOrder) MarshalTo

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

func (*Operation_PreexistingStatefulOrder) MarshalToSizedBuffer

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

func (*Operation_PreexistingStatefulOrder) Size

type Operation_ShortTermOrderCancellation

type Operation_ShortTermOrderCancellation struct {
	ShortTermOrderCancellation *MsgCancelOrder `` /* 149-byte string literal not displayed */
}

func (*Operation_ShortTermOrderCancellation) MarshalTo

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

func (*Operation_ShortTermOrderCancellation) MarshalToSizedBuffer

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

func (*Operation_ShortTermOrderCancellation) Size

type Operation_ShortTermOrderPlacement

type Operation_ShortTermOrderPlacement struct {
	ShortTermOrderPlacement *MsgPlaceOrder `` /* 140-byte string literal not displayed */
}

func (*Operation_ShortTermOrderPlacement) MarshalTo

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

func (*Operation_ShortTermOrderPlacement) MarshalToSizedBuffer

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

func (*Operation_ShortTermOrderPlacement) Size

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

type OperationsStats

type OperationsStats struct {
	// Stat fields.
	MatchedShortTermOrdersCount            uint
	MatchedLongTermOrdersCount             uint
	MatchedConditionalOrdersCount          uint
	TakerOrdersCount                       uint
	LiquidationOrdersCount                 uint
	DeleveragingOperationsCount            uint
	TotalFillsCount                        uint
	LongTermOrderRemovalsCount             uint
	ConditionalOrderRemovalsCount          uint
	UniqueSubaccountsLiquidated            uint
	UniqueSubaccountsDeleveraged           uint
	UniqueSubaccountsOffsettingDeleveraged uint
	// contains filtered or unexported fields
}

OperationsStats is a struct that holds stats about a list of operations that were proposed in a block.

func StatMsgProposedOperations

func StatMsgProposedOperations(
	rawOperations []OperationRaw,
) OperationsStats

StatMsgProposedOperations generates statistics from a list of internal operations and returns them in an `OperationsStats` struct.

func (*OperationsStats) EmitStats

func (stats *OperationsStats) EmitStats(abciCallback string)

EmitStats emits stats about the internal operations. It includes the provided ABCI callback as a label in the stat.

type OperationsToPropose

type OperationsToPropose struct {
	// An ordered list of operations to propose in a block.
	OperationsQueue []InternalOperation
	// A set of order hashes where the order placement has already been included in the operations queue.
	OrderHashesInOperationsQueue map[OrderHash]bool
	// A map of Short-Term order hashes to the raw transaction bytes of the order placement.
	// This is used in `GetOperationsQueueRaw` for returning a slice of `OperationRaw` for
	// the purposes of constructing `MsgProposedOperations`.
	ShortTermOrderHashToTxBytes map[OrderHash][]byte
	// A map from order ID to the orders themselves for each order that
	// was matched. Note: there may be multiple distinct orders with the same
	// ID that are matched. In that case, only the "greatest" of any such orders
	// is maintained in this map.
	MatchedOrderIdToOrder map[OrderId]Order
	// A set of order ids where the order removal has already been included in the operations queue.
	OrderRemovalsInOperationsQueue map[OrderId]bool
}

OperationsToPropose is a struct encapsulating data required for determining the operations to propose in a block. TODO(DEC-1889): Fix hack where struct fields are public.

func NewOperationsToPropose

func NewOperationsToPropose() *OperationsToPropose

NewOperationsToPropose returns a new instance of `OperationsToPropose`.

func (*OperationsToPropose) ClearOperationsQueue

func (o *OperationsToPropose) ClearOperationsQueue()

ClearOperationsQueue clears out all operations in the operations queue and all entries in the `OrderHashesInOperationsQueue` set. Note that we don't clear `ShortTermOrderHashToTxBytes` because it is updated in the `mustRemoveOrder` and `RemoveAndClearOperationsQueue` functions.

func (*OperationsToPropose) GetOperationsToPropose

func (o *OperationsToPropose) GetOperationsToPropose() []OperationRaw

GetOperationsToPropose returns a slice of OperationRaw. Note this function returns all operations in the operations queue *except* pre-existing stateful order placements, since those operations are only used when replaying a local validator’s operations queue. They do not need to be proposed again. This function will panic if any of the Short-Term order placement operations do not have an entry in ShortTermOrderHashToTxBytes, since that is necessary for constructing the list of OperationRaw.

func (*OperationsToPropose) GetOperationsToReplay

func (o *OperationsToPropose) GetOperationsToReplay() (
	[]InternalOperation,
	map[OrderHash][]byte,
)

GetOperationsToReplay returns all operations in the operations queue and a map of all Short-Term order hashes to their TX bytes. Note the returned operations include pre-existing stateful order placements, since those operations are only used when replaying a local validator’s operations queue. This function will panic if any of the Short-Term order placement operations do not have an entry in ShortTermOrderHashToTxBytes, since that is necessary for constructing the list of OperationWithTxBytes.

func (*OperationsToPropose) IsOrderPlacementInOperationsQueue

func (o *OperationsToPropose) IsOrderPlacementInOperationsQueue(
	order Order,
) bool

IsOrderPlacementInOperationsQueue returns true if the provided order hash is included in `orderHashesInOperationsQueue`, false if not. This function should be used for determining if a Short-Term or stateful order placement should be added to the operations queue.

func (*OperationsToPropose) IsOrderRemovalInOperationsQueue

func (o *OperationsToPropose) IsOrderRemovalInOperationsQueue(
	orderId OrderId,
) bool

IsOrderRemovalInOperationsQueue returns true if the provided order ID is included in `OrderRemovalsInOperationsQueue`, false if not.

func (*OperationsToPropose) MustAddDeleveragingToOperationsQueue

func (o *OperationsToPropose) MustAddDeleveragingToOperationsQueue(
	liquidatedSubaccountId satypes.SubaccountId,
	perpetualId uint32,
	fills []MatchPerpetualDeleveraging_Fill,
)

MustAddDeleveragingToOperationsQueue adds a deleveraging match operation to the operations queue. This function will panic if:

  • The number of maker fills is zero.
  • The fill amount is zero for any of the maker fills.
  • Maker fills contain duplicated subaccount IDs.
  • Maker fills contain liquidated subaccount ID.

func (*OperationsToPropose) MustAddMatchToOperationsQueue

func (o *OperationsToPropose) MustAddMatchToOperationsQueue(
	takerMatchableOrder MatchableOrder,
	makerFillsWithOrders []MakerFillWithOrder,
)

MustAddMatchToOperationsQueue adds a match operation to the operations queue. This function will panic if any of the following conditions are true:

  • The taker order is not a liquidation order and the number of maker fills is zero.
  • The taker order hash is not present in `orderHashesInOperationsQueue`.
  • There exist filled maker orders where the order hash is not present in `orderHashesInOperationsQueue`.

func (*OperationsToPropose) MustAddOrderRemovalToOperationsQueue

func (o *OperationsToPropose) MustAddOrderRemovalToOperationsQueue(
	orderId OrderId,
	removalReason OrderRemoval_RemovalReason,
)

MustAddOrderRemovalToOperationsQueue adds an order removal operation to the operations queue. This function will panic if given an unspecified removal reason.

func (*OperationsToPropose) MustAddShortTermOrderPlacementToOperationsQueue

func (o *OperationsToPropose) MustAddShortTermOrderPlacementToOperationsQueue(
	order Order,
)

MustAddShortTermOrderPlacementToOperationsQueue adds a Short-Term order placement operation to the operations queue. This function will panic if the order is not a Short-Term order, the order already exists in `OrderHashesInOperationsQueue`, or the order does not exist in `ShortTermOrderHashToTxBytes`.

func (*OperationsToPropose) MustAddShortTermOrderTxBytes

func (o *OperationsToPropose) MustAddShortTermOrderTxBytes(
	order Order,
	txBytes []byte,
)

MustAddShortTermOrderTxBytes adds the provided Short-Term order hash and TX bytes into `ShortTermOrderHashToTxBytes`. This function will panic if the provided order is not a Short-Term order or this order already exists in `ShortTermOrderHashToTxBytes`.

func (*OperationsToPropose) MustAddStatefulOrderPlacementToOperationsQueue

func (o *OperationsToPropose) MustAddStatefulOrderPlacementToOperationsQueue(
	order Order,
)

MustAddStatefulOrderPlacementToOperationsQueue adds a stateful order placement operation to the operations queue. This function will panic if this stateful order already exists in `OrderHashesInOperationsQueue`, or the provided order is not a stateful order.

func (*OperationsToPropose) RemoveShortTermOrderTxBytes

func (o *OperationsToPropose) RemoveShortTermOrderTxBytes(
	order Order,
)

RemoveShortTermOrderTxBytes removes a short term order from `ShortTermOrderHashToTxBytes`. This function will panic for any of the following: - the order is not a short term order. - the order hash is present in `OrderHashesInOperationsQueue` - the order hash is not present in `ShortTermOrderHashToTxBytes`

type Order

type Order struct {
	// The unique ID of this order. Meant to be unique across all orders.
	OrderId OrderId    `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id"`
	Side    Order_Side `protobuf:"varint,2,opt,name=side,proto3,enum=dydxprotocol.clob.Order_Side" json:"side,omitempty"`
	// The size of this order in base quantums. Must be a multiple of
	// `ClobPair.StepBaseQuantums` (where `ClobPair.Id = orderId.ClobPairId`).
	Quantums uint64 `protobuf:"varint,3,opt,name=quantums,proto3" json:"quantums,omitempty"`
	// The price level that this order will be placed at on the orderbook,
	// in subticks. Must be a multiple of ClobPair.SubticksPerTick
	// (where `ClobPair.Id = orderId.ClobPairId`).
	Subticks uint64 `protobuf:"varint,4,opt,name=subticks,proto3" json:"subticks,omitempty"`
	// Information about when the order expires.
	//
	// Types that are valid to be assigned to GoodTilOneof:
	//
	//	*Order_GoodTilBlock
	//	*Order_GoodTilBlockTime
	GoodTilOneof isOrder_GoodTilOneof `protobuf_oneof:"good_til_oneof"`
	// The time in force of this order.
	TimeInForce Order_TimeInForce `` /* 138-byte string literal not displayed */
	// Enforces that the order can only reduce the size of an existing position.
	// If a ReduceOnly order would change the side of the existing position,
	// its size is reduced to that of the remaining size of the position.
	// If existing orders on the book with ReduceOnly
	// would already close the position, the least aggressive (out-of-the-money)
	// ReduceOnly orders are resized and canceled first.
	ReduceOnly bool `protobuf:"varint,8,opt,name=reduce_only,json=reduceOnly,proto3" json:"reduce_only,omitempty"`
	// Set of bit flags set arbitrarily by clients and ignored by the protocol.
	// Used by indexer to infer information about a placed order.
	ClientMetadata uint32              `protobuf:"varint,9,opt,name=client_metadata,json=clientMetadata,proto3" json:"client_metadata,omitempty"`
	ConditionType  Order_ConditionType `` /* 145-byte string literal not displayed */
	// conditional_order_trigger_subticks represents the price at which this order
	// will be triggered. If the condition_type is CONDITION_TYPE_UNSPECIFIED,
	// this value is enforced to be 0. If this value is nonzero, condition_type
	// cannot be CONDITION_TYPE_UNSPECIFIED. Value is in subticks.
	// Must be a multiple of ClobPair.SubticksPerTick (where `ClobPair.Id =
	// orderId.ClobPairId`).
	ConditionalOrderTriggerSubticks uint64 `` /* 160-byte string literal not displayed */
}

Order represents a single order belonging to a `Subaccount` for a particular `ClobPair`.

func (*Order) CanTrigger

func (o *Order) CanTrigger(subticks Subticks) bool

CanTrigger returns if a condition order is eligible to be triggered based on a given subticks value. Function will panic if order is not a conditional order.

func (*Order) Descriptor

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

func (*Order) GetBaseQuantums

func (o *Order) GetBaseQuantums() satypes.BaseQuantums

GetBaseQuantums returns the quantums of this order. This function is necessary for the `Order` type to implement the `MatchableOrder` interface.

func (*Order) GetBigQuantums

func (o *Order) GetBigQuantums() *big.Int

GetBigQuantums returns the quantums of this order. The returned quantums is positive if long, negative if short, and zero if `o.Quantums == 0`. This function is necessary for the `Order` type to implement the `MatchableOrder` interface.

func (*Order) GetClientMetadata

func (m *Order) GetClientMetadata() uint32

func (*Order) GetClobPairId

func (o *Order) GetClobPairId() ClobPairId

GetClobPairId returns the CLOB pair ID of this order. This function implements the `MatchableOrder` interface.

func (*Order) GetConditionType

func (m *Order) GetConditionType() Order_ConditionType

func (*Order) GetConditionalOrderTriggerSubticks

func (m *Order) GetConditionalOrderTriggerSubticks() uint64

func (*Order) GetGoodTilBlock

func (m *Order) GetGoodTilBlock() uint32

func (*Order) GetGoodTilBlockTime

func (m *Order) GetGoodTilBlockTime() uint32

func (*Order) GetGoodTilOneof

func (m *Order) GetGoodTilOneof() isOrder_GoodTilOneof

func (*Order) GetOrderHash

func (o *Order) GetOrderHash() OrderHash

GetOrderHash returns the SHA256 hash of this order. This function is necessary for the `Order` type to implement the `MatchableOrder` interface.

func (*Order) GetOrderId

func (m *Order) GetOrderId() OrderId

func (*Order) GetOrderLabels

func (o *Order) GetOrderLabels() []gometrics.Label

GetOrderLabels returns the telemetry labels of this order.

func (*Order) GetOrderSubticks

func (o *Order) GetOrderSubticks() Subticks

GetOrderSubticks returns the subticks of this order. This function is necessary for the `Order` type to implement the `MatchableOrder` interface.

func (*Order) GetOrderTextString

func (o *Order) GetOrderTextString() string

GetOrderTextString returns the JSON representation of this order.

func (*Order) GetQuantums

func (m *Order) GetQuantums() uint64

func (*Order) GetReduceOnly

func (m *Order) GetReduceOnly() bool

func (*Order) GetSide

func (m *Order) GetSide() Order_Side

func (*Order) GetSubaccountId

func (o *Order) GetSubaccountId() satypes.SubaccountId

GetSubaccountId returns the subaccount ID that placed this order. This function is necessary for the `Order` type to implement the `MatchableOrder` interface.

func (*Order) GetSubticks

func (m *Order) GetSubticks() uint64

func (*Order) GetTimeInForce

func (m *Order) GetTimeInForce() Order_TimeInForce

func (*Order) IsBuy

func (o *Order) IsBuy() bool

IsBuy returns true if this is a buy order, false if not. This function is necessary for the `Order` type to implement the `MatchableOrder` interface.

func (*Order) IsConditionalOrder

func (o *Order) IsConditionalOrder() bool

IsConditionalOrder returns whether this order is a conditional order.

func (*Order) IsLiquidation

func (o *Order) IsLiquidation() bool

IsLiquidation always returns false since this order is not a liquidation. This function is necessary for the `Order` type to implement the `MatchableOrder` interface.

func (*Order) IsReduceOnly

func (o *Order) IsReduceOnly() bool

IsReduceOnly returns whether this is a reduce-only order.

func (*Order) IsShortTermOrder

func (o *Order) IsShortTermOrder() bool

IsShortTermOrder returns whether this is a Short-Term order.

func (*Order) IsStatefulOrder

func (o *Order) IsStatefulOrder() bool

IsStatefulOrder returns whether this order is a stateful order, which is true for Long-Term and conditional orders and false for Short-Term orders.

func (*Order) IsStopLossOrder

func (o *Order) IsStopLossOrder() bool

IsStopLossOrder returns whether this is order is a conditional stop loss order.

func (*Order) IsTakeProfitOrder

func (o *Order) IsTakeProfitOrder() bool

IsTakeProfitOrder returns whether this is order is a conditional take profit order.

func (*Order) Marshal

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

func (*Order) MarshalTo

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

func (*Order) MarshalToSizedBuffer

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

func (*Order) MustBeConditionalOrder

func (o *Order) MustBeConditionalOrder()

MustBeConditionalOrder panics if the order is not a conditional order.

func (*Order) MustBeStatefulOrder

func (o *Order) MustBeStatefulOrder()

MustBeStatefulOrder panics if the order is not a stateful order, else it does nothing.

func (*Order) MustBeValidOrderSide

func (o *Order) MustBeValidOrderSide()

func (*Order) MustCmpReplacementOrder

func (x *Order) MustCmpReplacementOrder(y *Order) int

MustCmpReplacementOrder compares x to y and returns: 1 if x > y 0 if x = y -1 if x < y The orders are compared primarily by `GoodTilBlock` for Short-Term orders and `GoodTilBlockTime` for stateful orders. If the order expirations are equal, then they are compared by their SHA256 hash. Note that this function panics if the order IDs are not equal.

func (*Order) MustGetLiquidatedPerpetualId

func (o *Order) MustGetLiquidatedPerpetualId() uint32

MustGetLiquidatedPerpetualId always panics since there is no underlying perpetual ID for a `Order`. This function is necessary for the `Order` type to implement the `MatchableOrder` interface.

func (*Order) MustGetOrder

func (o *Order) MustGetOrder() Order

MustGetOrder returns the underlying `Order` type. This function is necessary for the `Order` type to implement the `MatchableOrder` interface.

func (*Order) MustGetUnixGoodTilBlockTime

func (o *Order) MustGetUnixGoodTilBlockTime() time.Time

MustGetUnixGoodTilBlockTime returns an instance of `Time` that represents the order's `GoodTilBlockTime`. This function panics when the order is a short-term order or when its `GoodTilBlockTime` is zero.

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) RequiresImmediateExecution

func (o *Order) RequiresImmediateExecution() bool

RequiresImmediateExecution returns whether this order has to be executed immediately.

func (*Order) Reset

func (m *Order) Reset()

func (*Order) Size

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

func (*Order) String

func (m *Order) String() string

func (*Order) Unmarshal

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

func (*Order) XXX_DiscardUnknown

func (m *Order) XXX_DiscardUnknown()

func (*Order) XXX_Marshal

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

func (*Order) XXX_Merge

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

func (*Order) XXX_OneofWrappers

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*Order) XXX_Size

func (m *Order) XXX_Size() int

func (*Order) XXX_Unmarshal

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

type OrderFillState

type OrderFillState struct {
	// The current fillAmount of the order according to on-chain state.
	FillAmount uint64 `protobuf:"varint,1,opt,name=fill_amount,json=fillAmount,proto3" json:"fill_amount,omitempty"`
	// The block height at which the fillAmount state for this order can be
	// pruned.
	PrunableBlockHeight uint32 `protobuf:"varint,2,opt,name=prunable_block_height,json=prunableBlockHeight,proto3" json:"prunable_block_height,omitempty"`
}

OrderFillState represents the fill amount of an order according to on-chain state. This proto includes both the current on-chain fill amount of the order, as well as the block at which this information can be pruned from state.

func (*OrderFillState) Descriptor

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

func (*OrderFillState) GetFillAmount

func (m *OrderFillState) GetFillAmount() uint64

func (*OrderFillState) GetPrunableBlockHeight

func (m *OrderFillState) GetPrunableBlockHeight() uint32

func (*OrderFillState) Marshal

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

func (*OrderFillState) MarshalTo

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

func (*OrderFillState) MarshalToSizedBuffer

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

func (*OrderFillState) ProtoMessage

func (*OrderFillState) ProtoMessage()

func (*OrderFillState) Reset

func (m *OrderFillState) Reset()

func (*OrderFillState) Size

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

func (*OrderFillState) String

func (m *OrderFillState) String() string

func (*OrderFillState) Unmarshal

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

func (*OrderFillState) XXX_DiscardUnknown

func (m *OrderFillState) XXX_DiscardUnknown()

func (*OrderFillState) XXX_Marshal

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

func (*OrderFillState) XXX_Merge

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

func (*OrderFillState) XXX_Size

func (m *OrderFillState) XXX_Size() int

func (*OrderFillState) XXX_Unmarshal

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

type OrderHash

type OrderHash [32]byte

OrderHash is used to represent the SHA256 hash of an order.

func (OrderHash) ToBytes

func (oh OrderHash) ToBytes() []byte

type OrderId

type OrderId struct {
	// The subaccount ID that opened this order.
	// Note that this field has `gogoproto.nullable = false` so that it is
	// generated as a value instead of a pointer. This is because the `OrderId`
	// proto is used as a key within maps, and map comparisons will compare
	// pointers for equality (when the desired behavior is to compare the values).
	SubaccountId types.SubaccountId `protobuf:"bytes,1,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id"`
	// The client ID of this order, unique with respect to the specific
	// sub account (I.E., the same subaccount can't have two orders with
	// the same ClientId).
	ClientId uint32 `protobuf:"fixed32,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
	// order_flags represent order flags for the order. This field is invalid if
	// it's greater than 127 (larger than one byte). Each bit in the first byte
	// represents a different flag. Currently only two flags are supported.
	//
	// Starting from the bit after the most MSB (note that the MSB is used in
	// proto varint encoding, and therefore cannot be used): Bit 1 is set if this
	// order is a Long-Term order (0x40, or 64 as a uint8). Bit 2 is set if this
	// order is a Conditional order (0x20, or 32 as a uint8).
	//
	// If neither bit is set, the order is assumed to be a Short-Term order.
	//
	// If both bits are set or bits other than the 2nd and 3rd are set, the order
	// ID is invalid.
	OrderFlags uint32 `protobuf:"varint,3,opt,name=order_flags,json=orderFlags,proto3" json:"order_flags,omitempty"`
	// ID of the CLOB the order is created for.
	ClobPairId uint32 `protobuf:"varint,4,opt,name=clob_pair_id,json=clobPairId,proto3" json:"clob_pair_id,omitempty"`
}

OrderId refers to a single order belonging to a Subaccount.

func (*OrderId) Descriptor

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

func (*OrderId) GetClientId

func (m *OrderId) GetClientId() uint32

func (*OrderId) GetClobPairId

func (m *OrderId) GetClobPairId() uint32

func (*OrderId) GetOrderFlags

func (m *OrderId) GetOrderFlags() uint32

func (*OrderId) GetOrderIdLabels

func (o *OrderId) GetOrderIdLabels() []gometrics.Label

GetOrderIdLabels returns the telemetry labels of this order ID.

func (*OrderId) GetSubaccountId

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

func (*OrderId) IsConditionalOrder

func (o *OrderId) IsConditionalOrder() bool

IsConditionalOrder returns true if this order ID is for a conditional order, false if not (which implies the order ID is for a short-term or long-term order).

func (*OrderId) IsLongTermOrder

func (o *OrderId) IsLongTermOrder() bool

IsLongTermOrder returns true if this order ID is for a long-term order, false if not (which implies the order ID is for a short-term or conditional order).

func (*OrderId) IsShortTermOrder

func (o *OrderId) IsShortTermOrder() bool

IsShortTermOrder returns true if this order ID is for a short-term order, false if not (which implies the order ID is for a long-term or conditional order). Note that all short-term orders will have the `OrderFlags` field set to 0.

func (*OrderId) IsStatefulOrder

func (o *OrderId) IsStatefulOrder() bool

IsStatefulOrder returns whether this order is a stateful order, which is true for Long-Term and conditional orders and false for Short-Term orders.

func (*OrderId) Marshal

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

func (*OrderId) MarshalTo

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

func (*OrderId) MarshalToSizedBuffer

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

func (*OrderId) MustBeConditionalOrder

func (o *OrderId) MustBeConditionalOrder()

MustBeConditionalOrder panics if the orderId is not a conditional order, else it does nothing.

func (*OrderId) MustBeShortTermOrder

func (o *OrderId) MustBeShortTermOrder()

MustBeShortTermOrder panics if the orderId is not a short term order, else it does nothing.

func (*OrderId) MustBeStatefulOrder

func (o *OrderId) MustBeStatefulOrder()

MustBeStatefulOrder panics if the orderId is not a stateful order, else it does nothing.

func (*OrderId) ProtoMessage

func (*OrderId) ProtoMessage()

func (*OrderId) Reset

func (m *OrderId) Reset()

func (*OrderId) Size

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

func (*OrderId) String

func (m *OrderId) String() string

func (*OrderId) ToStateKey added in v0.4.0

func (o *OrderId) ToStateKey() []byte

ToStateKey returns a bytes representation of a OrderId for use as a state key. The key uses the proto marshaling of the object such that it can be unmarshalled in the same way if it needs to be.

func (*OrderId) Unmarshal

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

func (*OrderId) Validate

func (o *OrderId) Validate() error

Validate performs checks on the OrderId. It performs the following checks: - Validates subaccount id - checks OrderFlags for validity

func (*OrderId) XXX_DiscardUnknown

func (m *OrderId) XXX_DiscardUnknown()

func (*OrderId) XXX_Marshal

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

func (*OrderId) XXX_Merge

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

func (*OrderId) XXX_Size

func (m *OrderId) XXX_Size() int

func (*OrderId) XXX_Unmarshal

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

type OrderRemoval

type OrderRemoval struct {
	OrderId       OrderId                    `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id"`
	RemovalReason OrderRemoval_RemovalReason `` /* 151-byte string literal not displayed */
}

OrderRemoval is a request type used for forced removal of stateful orders.

func (*OrderRemoval) Descriptor

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

func (*OrderRemoval) GetOrderId

func (m *OrderRemoval) GetOrderId() OrderId

func (*OrderRemoval) GetRemovalReason

func (m *OrderRemoval) GetRemovalReason() OrderRemoval_RemovalReason

func (*OrderRemoval) Marshal

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

func (*OrderRemoval) MarshalTo

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

func (*OrderRemoval) MarshalToSizedBuffer

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

func (*OrderRemoval) ProtoMessage

func (*OrderRemoval) ProtoMessage()

func (*OrderRemoval) Reset

func (m *OrderRemoval) Reset()

func (*OrderRemoval) Size

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

func (*OrderRemoval) String

func (m *OrderRemoval) String() string

func (*OrderRemoval) Unmarshal

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

func (*OrderRemoval) XXX_DiscardUnknown

func (m *OrderRemoval) XXX_DiscardUnknown()

func (*OrderRemoval) XXX_Marshal

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

func (*OrderRemoval) XXX_Merge

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

func (*OrderRemoval) XXX_Size

func (m *OrderRemoval) XXX_Size() int

func (*OrderRemoval) XXX_Unmarshal

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

type OrderRemoval_RemovalReason

type OrderRemoval_RemovalReason int32
const (
	// REMOVAL_REASON_UNSPECIFIED represents an unspecified removal reason. This
	// removal reason is used as a catchall and should never appear on an
	// OrderRemoval in the operations queue.
	OrderRemoval_REMOVAL_REASON_UNSPECIFIED OrderRemoval_RemovalReason = 0
	// REMOVAL_REASON_UNDERCOLLATERALIZED represents a removal of an order which
	// if filled in isolation with respect to the current state of the
	// subaccount would leave the subaccount undercollateralized.
	OrderRemoval_REMOVAL_REASON_UNDERCOLLATERALIZED OrderRemoval_RemovalReason = 1
	// REMOVAL_REASON_INVALID_REDUCE_ONLY represents a removal of a reduce-only
	// order which if filled in isolation with respect to the current state of
	// the subaccount would cause the subaccount's existing position to increase
	// or change sides.
	OrderRemoval_REMOVAL_REASON_INVALID_REDUCE_ONLY OrderRemoval_RemovalReason = 2
	// REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER represents a removal of
	// a stateful post-only order that was deemed invalid because it crossed
	// maker orders on the book of the proposer.
	OrderRemoval_REMOVAL_REASON_POST_ONLY_WOULD_CROSS_MAKER_ORDER OrderRemoval_RemovalReason = 3
	// REMOVAL_REASON_INVALID_SELF_TRADE represents a removal of a stateful
	// order that was deemed invalid because it constituted a self trade on the
	// proposers orderbook.
	OrderRemoval_REMOVAL_REASON_INVALID_SELF_TRADE OrderRemoval_RemovalReason = 4
	// REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED represents a
	// removal of a conditional FOK order that was deemed invalid because it
	// could not be completely filled. Conditional FOK orders should always be
	// fully-filled or removed in the block after they are triggered.
	OrderRemoval_REMOVAL_REASON_CONDITIONAL_FOK_COULD_NOT_BE_FULLY_FILLED OrderRemoval_RemovalReason = 5
	// REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK represents a removal
	// of a conditional IOC order.
	// Conditional IOC orders should always have their remaining size removed
	// in the block after they are triggered.
	OrderRemoval_REMOVAL_REASON_CONDITIONAL_IOC_WOULD_REST_ON_BOOK OrderRemoval_RemovalReason = 6
	// REMOVAL_REASON_FULLY_FILLED represents a removal of an order that
	// was fully filled and should therefore be removed from state.
	OrderRemoval_REMOVAL_REASON_FULLY_FILLED OrderRemoval_RemovalReason = 7
)

func (OrderRemoval_RemovalReason) EnumDescriptor

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

func (OrderRemoval_RemovalReason) String

type OrderStatus

type OrderStatus uint

OrderStatus represents the status of an order after attempting to place it on the orderbook.

const (
	// Success indicates the order was successfully matched and / or added to the orderbook.
	Success OrderStatus = iota
	// Undercollateralized indicates the order failed collateralization checks while matching or
	// when placed on the orderbook, and was therefore canceled.
	Undercollateralized
	// InternalError indicates the order caused an internal error during collateralization checks
	// while matching or when placed on the orderbook, and was therefore canceled.
	InternalError
	// ImmediateOrCancelWouldRestOnBook indicates this is an IOC order that would have been placed
	// on the orderbook as resting liquidity, and was therefore canceled.
	ImmediateOrCancelWouldRestOnBook
	// ReduceOnlyResized indicates the reduce-only order was resized since it would have changed
	// the user's position side.
	ReduceOnlyResized
	// LiquidationRequiresDeleveraging indicates that there wasn't enough liquidity to liquidate
	// the subaccount profitably on the orderbook and the order was subsequently not fully matched
	// because the insurance fund did not have enough funds to cover the losses from performing
	// the liquidation.
	LiquidationRequiresDeleveraging
	// LiquidationExceededSubaccountMaxNotionalLiquidated indicates that the liquidation order
	// could not be matched because it exceeded the max notional liquidated in this block.
	LiquidationExceededSubaccountMaxNotionalLiquidated
	// LiquidationExceededSubaccountMaxInsuranceLost indicates that the liquidation order could not
	// be matched because it exceeded the maximum funds lost for the insurance fund in this block.
	LiquidationExceededSubaccountMaxInsuranceLost
)

func (OrderStatus) IsSuccess

func (os OrderStatus) IsSuccess() bool

IsSuccess returns `true` if this `OrderStatus` enum is `Success`, else returns `false`.

func (OrderStatus) String

func (os OrderStatus) String() string

String returns a string representation of this `OrderStatus` enum.

type Order_ConditionType

type Order_ConditionType int32
const (
	// CONDITION_TYPE_UNSPECIFIED represents the default behavior where an
	// order will be placed immediately on the orderbook.
	Order_CONDITION_TYPE_UNSPECIFIED Order_ConditionType = 0
	// CONDITION_TYPE_STOP_LOSS represents a stop order. A stop order will
	// trigger when the oracle price moves at or above the trigger price for
	// buys, and at or below the trigger price for sells.
	Order_CONDITION_TYPE_STOP_LOSS Order_ConditionType = 1
	// CONDITION_TYPE_TAKE_PROFIT represents a take profit order. A take profit
	// order will trigger when the oracle price moves at or below the trigger
	// price for buys and at or above the trigger price for sells.
	Order_CONDITION_TYPE_TAKE_PROFIT Order_ConditionType = 2
)

func (Order_ConditionType) EnumDescriptor

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

func (Order_ConditionType) String

func (x Order_ConditionType) String() string

type Order_GoodTilBlock

type Order_GoodTilBlock struct {
	GoodTilBlock uint32 `protobuf:"varint,5,opt,name=good_til_block,json=goodTilBlock,proto3,oneof" json:"good_til_block,omitempty"`
}

func (*Order_GoodTilBlock) MarshalTo

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

func (*Order_GoodTilBlock) MarshalToSizedBuffer

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

func (*Order_GoodTilBlock) Size

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

type Order_GoodTilBlockTime

type Order_GoodTilBlockTime struct {
	GoodTilBlockTime uint32 `protobuf:"fixed32,6,opt,name=good_til_block_time,json=goodTilBlockTime,proto3,oneof" json:"good_til_block_time,omitempty"`
}

func (*Order_GoodTilBlockTime) MarshalTo

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

func (*Order_GoodTilBlockTime) MarshalToSizedBuffer

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

func (*Order_GoodTilBlockTime) Size

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

type Order_Side

type Order_Side int32

Represents the side of the orderbook the order will be placed on. Note that Side.SIDE_UNSPECIFIED is an invalid order and cannot be placed on the orderbook.

const (
	// Default value. This value is invalid and unused.
	Order_SIDE_UNSPECIFIED Order_Side = 0
	// SIDE_BUY is used to represent a BUY order.
	Order_SIDE_BUY Order_Side = 1
	// SIDE_SELL is used to represent a SELL order.
	Order_SIDE_SELL Order_Side = 2
)

func (Order_Side) EnumDescriptor

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

func (Order_Side) String

func (x Order_Side) String() string

type Order_TimeInForce

type Order_TimeInForce int32

TimeInForce indicates how long an order will remain active before it is executed or expires.

const (
	// TIME_IN_FORCE_UNSPECIFIED represents the default behavior where an
	// order will first match with existing orders on the book, and any
	// remaining size will be added to the book as a maker order.
	Order_TIME_IN_FORCE_UNSPECIFIED Order_TimeInForce = 0
	// TIME_IN_FORCE_IOC enforces that an order only be matched with
	// maker orders on the book. If the order has remaining size after
	// matching with existing orders on the book, the remaining size
	// is not placed on the book.
	Order_TIME_IN_FORCE_IOC Order_TimeInForce = 1
	// TIME_IN_FORCE_POST_ONLY enforces that an order only be placed
	// on the book as a maker order. Note this means that validators will cancel
	// any newly-placed post only orders that would cross with other maker
	// orders.
	Order_TIME_IN_FORCE_POST_ONLY Order_TimeInForce = 2
	// TIME_IN_FORCE_FILL_OR_KILL enforces that an order will either be filled
	// completely and immediately by maker orders on the book or canceled if the
	// entire amount can‘t be matched.
	Order_TIME_IN_FORCE_FILL_OR_KILL Order_TimeInForce = 3
)

func (Order_TimeInForce) EnumDescriptor

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

func (Order_TimeInForce) String

func (x Order_TimeInForce) String() string

type Orderbook

type Orderbook struct {
	// Defines the tick size of the orderbook by defining how many subticks
	// are in one tick. That is, the subticks of any valid order must be a
	// multiple of this value. Generally this value should start `>= 100` to
	// allow room for decreasing it. This field is stored in state as part of a
	// `ClobPair`, but must be made available to the in-memory `Orderbook` in
	// order to efficiently remove orders from the orderbook. See the `removeOrder`
	// implementation for more information.
	SubticksPerTick SubticksPerTick
	// Map of price level (in subticks) to buy orders contained at that level.
	Bids map[Subticks]*Level
	// Map of price level (in subticks) to sell orders contained at that level.
	Asks map[Subticks]*Level
	// The highest bid on this orderbook, in subticks. 0 if no bids exist.
	BestBid Subticks
	// The lowest ask on this orderbook, in subticks. math.MaxUint64 if no asks exist.
	BestAsk Subticks
	// Contains all open orders on this CLOB for a given subaccount and side.
	// Used for fetching open orders for the add to orderbook collateralization
	// check for a subaccount.
	SubaccountOpenClobOrders map[satypes.SubaccountId]map[Order_Side]map[OrderId]bool
	// Minimum size of an order on the CLOB, in base quantums.
	MinOrderBaseQuantums satypes.BaseQuantums
	// Contains all open reduce-only orders on this CLOB from each subaccount. Used for tracking
	// which open reduce-only orders should be canceled when a position changes sides.
	SubaccountOpenReduceOnlyOrders map[satypes.SubaccountId]map[OrderId]bool
	// TotalOpenOrders tracks the total number of open orders in an orderbook for observability purposes.
	TotalOpenOrders uint
}

Orderbook holds the bids and asks for a specific product.

func (*Orderbook) GetMidPrice

func (ob *Orderbook) GetMidPrice() (Subticks, bool)

GetMidPrice returns the mid price of the orderbook and whether or not it exists.

func (*Orderbook) GetSide

func (ob *Orderbook) GetSide(isBuy bool) map[Subticks]*Level

GetSide returns the Bid-side levels if `isBuy == true` otherwise, returns the Ask-side levels.

type OrdersFilledDuringLatestBlock

type OrdersFilledDuringLatestBlock struct {
	// A list of unique order_ids that were filled by any non-zero amount in the
	// latest block.
	OrderIds []OrderId `protobuf:"bytes,1,rep,name=order_ids,json=orderIds,proto3" json:"order_ids"`
}

OrdersFilledDuringLatestBlock represents a list of `OrderIds` that were filled by any non-zero amount in the latest block.

func (*OrdersFilledDuringLatestBlock) Descriptor

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

func (*OrdersFilledDuringLatestBlock) GetOrderIds

func (m *OrdersFilledDuringLatestBlock) GetOrderIds() []OrderId

func (*OrdersFilledDuringLatestBlock) Marshal

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

func (*OrdersFilledDuringLatestBlock) MarshalTo

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

func (*OrdersFilledDuringLatestBlock) MarshalToSizedBuffer

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

func (*OrdersFilledDuringLatestBlock) ProtoMessage

func (*OrdersFilledDuringLatestBlock) ProtoMessage()

func (*OrdersFilledDuringLatestBlock) Reset

func (m *OrdersFilledDuringLatestBlock) Reset()

func (*OrdersFilledDuringLatestBlock) Size

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

func (*OrdersFilledDuringLatestBlock) String

func (*OrdersFilledDuringLatestBlock) Unmarshal

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

func (*OrdersFilledDuringLatestBlock) XXX_DiscardUnknown

func (m *OrdersFilledDuringLatestBlock) XXX_DiscardUnknown()

func (*OrdersFilledDuringLatestBlock) XXX_Marshal

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

func (*OrdersFilledDuringLatestBlock) XXX_Merge

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

func (*OrdersFilledDuringLatestBlock) XXX_Size

func (m *OrdersFilledDuringLatestBlock) XXX_Size() int

func (*OrdersFilledDuringLatestBlock) XXX_Unmarshal

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

type PendingOpenOrder

type PendingOpenOrder struct {
	// The amount of base quantums that is remaining for this order.
	RemainingQuantums satypes.BaseQuantums
	// True if this is a buy order, false if it's a sell order.
	IsBuy bool
	// The price that this order would be matched at.
	Subticks Subticks
	// The ID of the CLOB this order would be placed on.
	ClobPairId ClobPairId
}

PendingOpenOrder is a utility struct used for representing an order a subaccount will open. This is used for collateralization checks, to specifically verify that the number of quantums in this order can be opened for this subaccount. Only used for representing maker orders in add-to-orderbook collat check. TODO(CLOB-849) Remove this struct.

type PendingUpdates

type PendingUpdates struct {
	// contains filtered or unexported fields
}

pendingUpdates is a utility struct used for storing the working updates to all Subaccounts.

func NewPendingUpdates

func NewPendingUpdates() *PendingUpdates

newPendingUpdates returns a new `pendingUpdates`.

func (*PendingUpdates) AddPerpetualFill

func (p *PendingUpdates) AddPerpetualFill(
	subaccountId satypes.SubaccountId,
	perpetualId uint32,
	isBuy bool,
	feePpm int32,
	bigFillBaseQuantums *big.Int,
	bigFillQuoteQuantums *big.Int,
)

AddPerpetualFill adds a new fill to the PendingUpdate object, by updating quoteBalanceDelta, perpetualUpdate and fees paid or received by a subaccount.

func (*PendingUpdates) ConvertToUpdates

func (p *PendingUpdates) ConvertToUpdates() []satypes.Update

ConvertToUpdates converts a `pendingUpdates` struct to a slice of Subaccount Updates.

type PerpetualClobMetadata

type PerpetualClobMetadata struct {
	// Id of the Perpetual the CLOB allows trading of.
	PerpetualId uint32 `protobuf:"varint,1,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"`
}

PerpetualClobMetadata contains metadata for a `ClobPair` representing a Perpetual product.

func (*PerpetualClobMetadata) Descriptor

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

func (*PerpetualClobMetadata) GetPerpetualId

func (m *PerpetualClobMetadata) GetPerpetualId() uint32

func (*PerpetualClobMetadata) Marshal

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

func (*PerpetualClobMetadata) MarshalTo

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

func (*PerpetualClobMetadata) MarshalToSizedBuffer

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

func (*PerpetualClobMetadata) ProtoMessage

func (*PerpetualClobMetadata) ProtoMessage()

func (*PerpetualClobMetadata) Reset

func (m *PerpetualClobMetadata) Reset()

func (*PerpetualClobMetadata) Size

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

func (*PerpetualClobMetadata) String

func (m *PerpetualClobMetadata) String() string

func (*PerpetualClobMetadata) Unmarshal

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

func (*PerpetualClobMetadata) XXX_DiscardUnknown

func (m *PerpetualClobMetadata) XXX_DiscardUnknown()

func (*PerpetualClobMetadata) XXX_Marshal

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

func (*PerpetualClobMetadata) XXX_Merge

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

func (*PerpetualClobMetadata) XXX_Size

func (m *PerpetualClobMetadata) XXX_Size() int

func (*PerpetualClobMetadata) XXX_Unmarshal

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

type PerpetualLiquidationInfo

type PerpetualLiquidationInfo struct {
	// The id of the subaccount that got liquidated/deleveraged or was deleveraged
	// onto.
	SubaccountId types.SubaccountId `protobuf:"bytes,1,opt,name=subaccount_id,json=subaccountId,proto3" json:"subaccount_id"`
	// The id of the perpetual involved.
	PerpetualId uint32 `protobuf:"varint,2,opt,name=perpetual_id,json=perpetualId,proto3" json:"perpetual_id,omitempty"`
}

PerpetualLiquidationInfo holds information about a liquidation that occurred for a position held by a subaccount. Note this proto is defined to make it easier to hash the metadata of a liquidation, and is never written to state.

func (*PerpetualLiquidationInfo) Descriptor

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

func (*PerpetualLiquidationInfo) GetPerpetualId

func (m *PerpetualLiquidationInfo) GetPerpetualId() uint32

func (*PerpetualLiquidationInfo) GetSubaccountId

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

func (*PerpetualLiquidationInfo) Marshal

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

func (*PerpetualLiquidationInfo) MarshalTo

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

func (*PerpetualLiquidationInfo) MarshalToSizedBuffer

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

func (*PerpetualLiquidationInfo) ProtoMessage

func (*PerpetualLiquidationInfo) ProtoMessage()

func (*PerpetualLiquidationInfo) Reset

func (m *PerpetualLiquidationInfo) Reset()

func (*PerpetualLiquidationInfo) Size

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

func (*PerpetualLiquidationInfo) String

func (m *PerpetualLiquidationInfo) String() string

func (*PerpetualLiquidationInfo) Unmarshal

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

func (*PerpetualLiquidationInfo) XXX_DiscardUnknown

func (m *PerpetualLiquidationInfo) XXX_DiscardUnknown()

func (*PerpetualLiquidationInfo) XXX_Marshal

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

func (*PerpetualLiquidationInfo) XXX_Merge

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

func (*PerpetualLiquidationInfo) XXX_Size

func (m *PerpetualLiquidationInfo) XXX_Size() int

func (*PerpetualLiquidationInfo) XXX_Unmarshal

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

type PerpetualsKeeper

type PerpetualsKeeper interface {
	GetNetNotional(
		ctx sdk.Context,
		id uint32,
		bigQuantums *big.Int,
	) (
		bigNetNotionalQuoteQuantums *big.Int,
		err error,
	)
	GetNotionalInBaseQuantums(
		ctx sdk.Context,
		id uint32,
		bigQuoteQuantums *big.Int,
	) (
		bigBaseQuantums *big.Int,
		err error,
	)
	GetNetCollateral(
		ctx sdk.Context,
		id uint32,
		bigQuantums *big.Int,
	) (
		bigNetCollateralQuoteQuantums *big.Int,
		err error,
	)
	GetMarginRequirements(
		ctx sdk.Context,
		id uint32,
		bigQuantums *big.Int,
	) (
		bigInitialMarginQuoteQuantums *big.Int,
		bigMaintenanceMarginQuoteQuantums *big.Int,
		err error,
	)
	GetPerpetual(
		ctx sdk.Context,
		id uint32,
	) (val perpetualsmoduletypes.Perpetual, err error)
	GetPerpetualAndMarketPrice(
		ctx sdk.Context,
		perpetualId uint32,
	) (perpetualsmoduletypes.Perpetual, pricestypes.MarketPrice, error)
	GetSettlementPpm(
		ctx sdk.Context,
		perpetualId uint32,
		quantums *big.Int,
		index *big.Int,
	) (
		bigNetSettlement *big.Int,
		newFundingIndex *big.Int,
		err error,
	)
	MaybeProcessNewFundingTickEpoch(ctx sdk.Context)
}

type PositionBlockLimits

type PositionBlockLimits struct {
	// The minimum amount of quantums to liquidate for each message (in
	// quote quantums).
	// Overridden by the maximum size of the position.
	MinPositionNotionalLiquidated uint64 `` /* 153-byte string literal not displayed */
	// The maximum portion of the position liquidated (in parts-per-
	// million). Overridden by min_position_notional_liquidated.
	MaxPositionPortionLiquidatedPpm uint32 `` /* 161-byte string literal not displayed */
}

PositionBlockLimits stores all configurable fields related to limits around how much of a single position can be liquidated within a single block.

func (*PositionBlockLimits) Descriptor

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

func (*PositionBlockLimits) GetMaxPositionPortionLiquidatedPpm

func (m *PositionBlockLimits) GetMaxPositionPortionLiquidatedPpm() uint32

func (*PositionBlockLimits) GetMinPositionNotionalLiquidated

func (m *PositionBlockLimits) GetMinPositionNotionalLiquidated() uint64

func (*PositionBlockLimits) Marshal

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

func (*PositionBlockLimits) MarshalTo

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

func (*PositionBlockLimits) MarshalToSizedBuffer

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

func (*PositionBlockLimits) ProtoMessage

func (*PositionBlockLimits) ProtoMessage()

func (*PositionBlockLimits) Reset

func (m *PositionBlockLimits) Reset()

func (*PositionBlockLimits) Size

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

func (*PositionBlockLimits) String

func (m *PositionBlockLimits) String() string

func (*PositionBlockLimits) Unmarshal

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

func (*PositionBlockLimits) XXX_DiscardUnknown

func (m *PositionBlockLimits) XXX_DiscardUnknown()

func (*PositionBlockLimits) XXX_Marshal

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

func (*PositionBlockLimits) XXX_Merge

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

func (*PositionBlockLimits) XXX_Size

func (m *PositionBlockLimits) XXX_Size() int

func (*PositionBlockLimits) XXX_Unmarshal

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

type PotentiallyPrunableOrders

type PotentiallyPrunableOrders struct {
	// A list of unique order_ids that may potentially be pruned from state at a
	// future block height.
	OrderIds []OrderId `protobuf:"bytes,1,rep,name=order_ids,json=orderIds,proto3" json:"order_ids"`
}

PotentiallyPrunableOrders represents a list of orders that may be prunable from state at a future block height.

func (*PotentiallyPrunableOrders) Descriptor

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

func (*PotentiallyPrunableOrders) GetOrderIds

func (m *PotentiallyPrunableOrders) GetOrderIds() []OrderId

func (*PotentiallyPrunableOrders) Marshal

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

func (*PotentiallyPrunableOrders) MarshalTo

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

func (*PotentiallyPrunableOrders) MarshalToSizedBuffer

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

func (*PotentiallyPrunableOrders) ProtoMessage

func (*PotentiallyPrunableOrders) ProtoMessage()

func (*PotentiallyPrunableOrders) Reset

func (m *PotentiallyPrunableOrders) Reset()

func (*PotentiallyPrunableOrders) Size

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

func (*PotentiallyPrunableOrders) String

func (m *PotentiallyPrunableOrders) String() string

func (*PotentiallyPrunableOrders) Unmarshal

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

func (*PotentiallyPrunableOrders) XXX_DiscardUnknown

func (m *PotentiallyPrunableOrders) XXX_DiscardUnknown()

func (*PotentiallyPrunableOrders) XXX_Marshal

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

func (*PotentiallyPrunableOrders) XXX_Merge

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

func (*PotentiallyPrunableOrders) XXX_Size

func (m *PotentiallyPrunableOrders) XXX_Size() int

func (*PotentiallyPrunableOrders) XXX_Unmarshal

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

type ProcessProposerMatchesEvents

type ProcessProposerMatchesEvents struct {
	PlacedLongTermOrderIds                  []OrderId `protobuf:"bytes,1,rep,name=placed_long_term_order_ids,json=placedLongTermOrderIds,proto3" json:"placed_long_term_order_ids"`
	ExpiredStatefulOrderIds                 []OrderId `protobuf:"bytes,2,rep,name=expired_stateful_order_ids,json=expiredStatefulOrderIds,proto3" json:"expired_stateful_order_ids"`
	OrderIdsFilledInLastBlock               []OrderId `` /* 134-byte string literal not displayed */
	PlacedStatefulCancellationOrderIds      []OrderId `` /* 159-byte string literal not displayed */
	RemovedStatefulOrderIds                 []OrderId `protobuf:"bytes,5,rep,name=removed_stateful_order_ids,json=removedStatefulOrderIds,proto3" json:"removed_stateful_order_ids"`
	ConditionalOrderIdsTriggeredInLastBlock []OrderId `` /* 178-byte string literal not displayed */
	PlacedConditionalOrderIds               []OrderId `` /* 130-byte string literal not displayed */
	BlockHeight                             uint32    `protobuf:"varint,8,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
}

ProcessProposerMatchesEvents is used for communicating which events occurred in the last block that require updating the state of the memclob in the Commit blocker. It contains information about the following state updates: - Long term order IDs that were placed in the last block. - Stateful order IDs that were expired in the last block. - Order IDs that were filled in the last block. - Stateful cancellations order IDs that were placed in the last block. - Stateful order IDs forcefully removed in the last block. - Conditional order IDs triggered in the last block. - Conditional order IDs placed, but not triggered in the last block. - The height of the block in which the events occurred.

func (*ProcessProposerMatchesEvents) Descriptor

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

func (*ProcessProposerMatchesEvents) GetBlockHeight

func (m *ProcessProposerMatchesEvents) GetBlockHeight() uint32

func (*ProcessProposerMatchesEvents) GetConditionalOrderIdsTriggeredInLastBlock

func (m *ProcessProposerMatchesEvents) GetConditionalOrderIdsTriggeredInLastBlock() []OrderId

func (*ProcessProposerMatchesEvents) GetExpiredStatefulOrderIds

func (m *ProcessProposerMatchesEvents) GetExpiredStatefulOrderIds() []OrderId

func (*ProcessProposerMatchesEvents) GetOrderIdsFilledInLastBlock

func (m *ProcessProposerMatchesEvents) GetOrderIdsFilledInLastBlock() []OrderId

func (*ProcessProposerMatchesEvents) GetPlacedConditionalOrderIds

func (m *ProcessProposerMatchesEvents) GetPlacedConditionalOrderIds() []OrderId

func (*ProcessProposerMatchesEvents) GetPlacedLongTermOrderIds

func (m *ProcessProposerMatchesEvents) GetPlacedLongTermOrderIds() []OrderId

func (*ProcessProposerMatchesEvents) GetPlacedStatefulCancellationOrderIds

func (m *ProcessProposerMatchesEvents) GetPlacedStatefulCancellationOrderIds() []OrderId

func (*ProcessProposerMatchesEvents) GetRemovedStatefulOrderIds

func (m *ProcessProposerMatchesEvents) GetRemovedStatefulOrderIds() []OrderId

func (*ProcessProposerMatchesEvents) Marshal

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

func (*ProcessProposerMatchesEvents) MarshalTo

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

func (*ProcessProposerMatchesEvents) MarshalToSizedBuffer

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

func (*ProcessProposerMatchesEvents) ProtoMessage

func (*ProcessProposerMatchesEvents) ProtoMessage()

func (*ProcessProposerMatchesEvents) Reset

func (m *ProcessProposerMatchesEvents) Reset()

func (*ProcessProposerMatchesEvents) Size

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

func (*ProcessProposerMatchesEvents) String

func (*ProcessProposerMatchesEvents) Unmarshal

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

func (*ProcessProposerMatchesEvents) XXX_DiscardUnknown

func (m *ProcessProposerMatchesEvents) XXX_DiscardUnknown()

func (*ProcessProposerMatchesEvents) XXX_Marshal

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

func (*ProcessProposerMatchesEvents) XXX_Merge

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

func (*ProcessProposerMatchesEvents) XXX_Size

func (m *ProcessProposerMatchesEvents) XXX_Size() int

func (*ProcessProposerMatchesEvents) XXX_Unmarshal

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

type QueryAllClobPairRequest

type QueryAllClobPairRequest struct {
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryAllClobPairRequest is request type for the ClobPairAll method.

func (*QueryAllClobPairRequest) Descriptor

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

func (*QueryAllClobPairRequest) GetPagination

func (m *QueryAllClobPairRequest) GetPagination() *query.PageRequest

func (*QueryAllClobPairRequest) Marshal

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

func (*QueryAllClobPairRequest) MarshalTo

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

func (*QueryAllClobPairRequest) MarshalToSizedBuffer

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

func (*QueryAllClobPairRequest) ProtoMessage

func (*QueryAllClobPairRequest) ProtoMessage()

func (*QueryAllClobPairRequest) Reset

func (m *QueryAllClobPairRequest) Reset()

func (*QueryAllClobPairRequest) Size

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

func (*QueryAllClobPairRequest) String

func (m *QueryAllClobPairRequest) String() string

func (*QueryAllClobPairRequest) Unmarshal

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

func (*QueryAllClobPairRequest) XXX_DiscardUnknown

func (m *QueryAllClobPairRequest) XXX_DiscardUnknown()

func (*QueryAllClobPairRequest) XXX_Marshal

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

func (*QueryAllClobPairRequest) XXX_Merge

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

func (*QueryAllClobPairRequest) XXX_Size

func (m *QueryAllClobPairRequest) XXX_Size() int

func (*QueryAllClobPairRequest) XXX_Unmarshal

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

type QueryBlockRateLimitConfigurationRequest added in v1.0.1

type QueryBlockRateLimitConfigurationRequest struct {
}

QueryBlockRateLimitConfigurationRequest is a request message for BlockRateLimitConfiguration.

func (*QueryBlockRateLimitConfigurationRequest) Descriptor added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationRequest) Marshal added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationRequest) MarshalTo added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationRequest) MarshalToSizedBuffer added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationRequest) ProtoMessage added in v1.0.1

func (*QueryBlockRateLimitConfigurationRequest) Reset added in v1.0.1

func (*QueryBlockRateLimitConfigurationRequest) Size added in v1.0.1

func (*QueryBlockRateLimitConfigurationRequest) String added in v1.0.1

func (*QueryBlockRateLimitConfigurationRequest) Unmarshal added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationRequest) XXX_DiscardUnknown added in v1.0.1

func (m *QueryBlockRateLimitConfigurationRequest) XXX_DiscardUnknown()

func (*QueryBlockRateLimitConfigurationRequest) XXX_Marshal added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationRequest) XXX_Merge added in v1.0.1

func (*QueryBlockRateLimitConfigurationRequest) XXX_Size added in v1.0.1

func (*QueryBlockRateLimitConfigurationRequest) XXX_Unmarshal added in v1.0.1

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

type QueryBlockRateLimitConfigurationResponse added in v1.0.1

type QueryBlockRateLimitConfigurationResponse struct {
	BlockRateLimitConfig BlockRateLimitConfiguration `protobuf:"bytes,1,opt,name=block_rate_limit_config,json=blockRateLimitConfig,proto3" json:"block_rate_limit_config"`
}

QueryBlockRateLimitConfigurationResponse is a response message that contains the BlockRateLimitConfiguration.

func (*QueryBlockRateLimitConfigurationResponse) Descriptor added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationResponse) GetBlockRateLimitConfig added in v1.0.1

func (*QueryBlockRateLimitConfigurationResponse) Marshal added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationResponse) MarshalTo added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationResponse) MarshalToSizedBuffer added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationResponse) ProtoMessage added in v1.0.1

func (*QueryBlockRateLimitConfigurationResponse) Reset added in v1.0.1

func (*QueryBlockRateLimitConfigurationResponse) Size added in v1.0.1

func (*QueryBlockRateLimitConfigurationResponse) String added in v1.0.1

func (*QueryBlockRateLimitConfigurationResponse) Unmarshal added in v1.0.1

func (*QueryBlockRateLimitConfigurationResponse) XXX_DiscardUnknown added in v1.0.1

func (m *QueryBlockRateLimitConfigurationResponse) XXX_DiscardUnknown()

func (*QueryBlockRateLimitConfigurationResponse) XXX_Marshal added in v1.0.1

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

func (*QueryBlockRateLimitConfigurationResponse) XXX_Merge added in v1.0.1

func (*QueryBlockRateLimitConfigurationResponse) XXX_Size added in v1.0.1

func (*QueryBlockRateLimitConfigurationResponse) XXX_Unmarshal added in v1.0.1

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

type QueryClient

type QueryClient interface {
	// Queries a ClobPair by id.
	ClobPair(ctx context.Context, in *QueryGetClobPairRequest, opts ...grpc.CallOption) (*QueryClobPairResponse, error)
	// Queries a list of ClobPair items.
	ClobPairAll(ctx context.Context, in *QueryAllClobPairRequest, opts ...grpc.CallOption) (*QueryClobPairAllResponse, error)
	// Returns whether a subaccount is liquidatable.
	AreSubaccountsLiquidatable(ctx context.Context, in *AreSubaccountsLiquidatableRequest, opts ...grpc.CallOption) (*AreSubaccountsLiquidatableResponse, error)
	// Runs the MEV node <> node calculation with the provided parameters.
	MevNodeToNodeCalculation(ctx context.Context, in *MevNodeToNodeCalculationRequest, opts ...grpc.CallOption) (*MevNodeToNodeCalculationResponse, error)
	// Queries EquityTierLimitConfiguration.
	EquityTierLimitConfiguration(ctx context.Context, in *QueryEquityTierLimitConfigurationRequest, opts ...grpc.CallOption) (*QueryEquityTierLimitConfigurationResponse, error)
	// Queries BlockRateLimitConfiguration.
	BlockRateLimitConfiguration(ctx context.Context, in *QueryBlockRateLimitConfigurationRequest, opts ...grpc.CallOption) (*QueryBlockRateLimitConfigurationResponse, error)
	// Queries LiquidationsConfiguration.
	LiquidationsConfiguration(ctx context.Context, in *QueryLiquidationsConfigurationRequest, opts ...grpc.CallOption) (*QueryLiquidationsConfigurationResponse, 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 QueryClobPairAllResponse

type QueryClobPairAllResponse struct {
	ClobPair   []ClobPair          `protobuf:"bytes,1,rep,name=clob_pair,json=clobPair,proto3" json:"clob_pair"`
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryClobPairAllResponse is response type for the ClobPairAll method.

func (*QueryClobPairAllResponse) Descriptor

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

func (*QueryClobPairAllResponse) GetClobPair

func (m *QueryClobPairAllResponse) GetClobPair() []ClobPair

func (*QueryClobPairAllResponse) GetPagination

func (m *QueryClobPairAllResponse) GetPagination() *query.PageResponse

func (*QueryClobPairAllResponse) Marshal

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

func (*QueryClobPairAllResponse) MarshalTo

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

func (*QueryClobPairAllResponse) MarshalToSizedBuffer

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

func (*QueryClobPairAllResponse) ProtoMessage

func (*QueryClobPairAllResponse) ProtoMessage()

func (*QueryClobPairAllResponse) Reset

func (m *QueryClobPairAllResponse) Reset()

func (*QueryClobPairAllResponse) Size

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

func (*QueryClobPairAllResponse) String

func (m *QueryClobPairAllResponse) String() string

func (*QueryClobPairAllResponse) Unmarshal

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

func (*QueryClobPairAllResponse) XXX_DiscardUnknown

func (m *QueryClobPairAllResponse) XXX_DiscardUnknown()

func (*QueryClobPairAllResponse) XXX_Marshal

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

func (*QueryClobPairAllResponse) XXX_Merge

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

func (*QueryClobPairAllResponse) XXX_Size

func (m *QueryClobPairAllResponse) XXX_Size() int

func (*QueryClobPairAllResponse) XXX_Unmarshal

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

type QueryClobPairResponse

type QueryClobPairResponse struct {
	ClobPair ClobPair `protobuf:"bytes,1,opt,name=clob_pair,json=clobPair,proto3" json:"clob_pair"`
}

QueryClobPairResponse is response type for the ClobPair method.

func (*QueryClobPairResponse) Descriptor

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

func (*QueryClobPairResponse) GetClobPair

func (m *QueryClobPairResponse) GetClobPair() ClobPair

func (*QueryClobPairResponse) Marshal

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

func (*QueryClobPairResponse) MarshalTo

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

func (*QueryClobPairResponse) MarshalToSizedBuffer

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

func (*QueryClobPairResponse) ProtoMessage

func (*QueryClobPairResponse) ProtoMessage()

func (*QueryClobPairResponse) Reset

func (m *QueryClobPairResponse) Reset()

func (*QueryClobPairResponse) Size

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

func (*QueryClobPairResponse) String

func (m *QueryClobPairResponse) String() string

func (*QueryClobPairResponse) Unmarshal

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

func (*QueryClobPairResponse) XXX_DiscardUnknown

func (m *QueryClobPairResponse) XXX_DiscardUnknown()

func (*QueryClobPairResponse) XXX_Marshal

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

func (*QueryClobPairResponse) XXX_Merge

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

func (*QueryClobPairResponse) XXX_Size

func (m *QueryClobPairResponse) XXX_Size() int

func (*QueryClobPairResponse) XXX_Unmarshal

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

type QueryEquityTierLimitConfigurationRequest

type QueryEquityTierLimitConfigurationRequest struct {
}

QueryEquityTierLimitConfigurationRequest is a request message for EquityTierLimitConfiguration.

func (*QueryEquityTierLimitConfigurationRequest) Descriptor

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

func (*QueryEquityTierLimitConfigurationRequest) Marshal

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

func (*QueryEquityTierLimitConfigurationRequest) MarshalTo

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

func (*QueryEquityTierLimitConfigurationRequest) MarshalToSizedBuffer

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

func (*QueryEquityTierLimitConfigurationRequest) ProtoMessage

func (*QueryEquityTierLimitConfigurationRequest) Reset

func (*QueryEquityTierLimitConfigurationRequest) Size

func (*QueryEquityTierLimitConfigurationRequest) String

func (*QueryEquityTierLimitConfigurationRequest) Unmarshal

func (*QueryEquityTierLimitConfigurationRequest) XXX_DiscardUnknown

func (m *QueryEquityTierLimitConfigurationRequest) XXX_DiscardUnknown()

func (*QueryEquityTierLimitConfigurationRequest) XXX_Marshal

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

func (*QueryEquityTierLimitConfigurationRequest) XXX_Merge

func (*QueryEquityTierLimitConfigurationRequest) XXX_Size

func (*QueryEquityTierLimitConfigurationRequest) XXX_Unmarshal

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

type QueryEquityTierLimitConfigurationResponse

type QueryEquityTierLimitConfigurationResponse struct {
	EquityTierLimitConfig EquityTierLimitConfiguration `protobuf:"bytes,1,opt,name=equity_tier_limit_config,json=equityTierLimitConfig,proto3" json:"equity_tier_limit_config"`
}

QueryEquityTierLimitConfigurationResponse is a response message that contains the EquityTierLimitConfiguration.

func (*QueryEquityTierLimitConfigurationResponse) Descriptor

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

func (*QueryEquityTierLimitConfigurationResponse) GetEquityTierLimitConfig

func (*QueryEquityTierLimitConfigurationResponse) Marshal

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

func (*QueryEquityTierLimitConfigurationResponse) MarshalTo

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

func (*QueryEquityTierLimitConfigurationResponse) MarshalToSizedBuffer

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

func (*QueryEquityTierLimitConfigurationResponse) ProtoMessage

func (*QueryEquityTierLimitConfigurationResponse) Reset

func (*QueryEquityTierLimitConfigurationResponse) Size

func (*QueryEquityTierLimitConfigurationResponse) String

func (*QueryEquityTierLimitConfigurationResponse) Unmarshal

func (*QueryEquityTierLimitConfigurationResponse) XXX_DiscardUnknown

func (m *QueryEquityTierLimitConfigurationResponse) XXX_DiscardUnknown()

func (*QueryEquityTierLimitConfigurationResponse) XXX_Marshal

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

func (*QueryEquityTierLimitConfigurationResponse) XXX_Merge

func (*QueryEquityTierLimitConfigurationResponse) XXX_Size

func (*QueryEquityTierLimitConfigurationResponse) XXX_Unmarshal

type QueryGetClobPairRequest

type QueryGetClobPairRequest struct {
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}

QueryGetClobPairRequest is request type for the ClobPair method.

func (*QueryGetClobPairRequest) Descriptor

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

func (*QueryGetClobPairRequest) GetId

func (m *QueryGetClobPairRequest) GetId() uint32

func (*QueryGetClobPairRequest) Marshal

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

func (*QueryGetClobPairRequest) MarshalTo

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

func (*QueryGetClobPairRequest) MarshalToSizedBuffer

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

func (*QueryGetClobPairRequest) ProtoMessage

func (*QueryGetClobPairRequest) ProtoMessage()

func (*QueryGetClobPairRequest) Reset

func (m *QueryGetClobPairRequest) Reset()

func (*QueryGetClobPairRequest) Size

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

func (*QueryGetClobPairRequest) String

func (m *QueryGetClobPairRequest) String() string

func (*QueryGetClobPairRequest) Unmarshal

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

func (*QueryGetClobPairRequest) XXX_DiscardUnknown

func (m *QueryGetClobPairRequest) XXX_DiscardUnknown()

func (*QueryGetClobPairRequest) XXX_Marshal

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

func (*QueryGetClobPairRequest) XXX_Merge

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

func (*QueryGetClobPairRequest) XXX_Size

func (m *QueryGetClobPairRequest) XXX_Size() int

func (*QueryGetClobPairRequest) XXX_Unmarshal

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

type QueryLiquidationsConfigurationRequest added in v1.0.1

type QueryLiquidationsConfigurationRequest struct {
}

QueryLiquidationsConfigurationRequest is a request message for LiquidationsConfiguration.

func (*QueryLiquidationsConfigurationRequest) Descriptor added in v1.0.1

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

func (*QueryLiquidationsConfigurationRequest) Marshal added in v1.0.1

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

func (*QueryLiquidationsConfigurationRequest) MarshalTo added in v1.0.1

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

func (*QueryLiquidationsConfigurationRequest) MarshalToSizedBuffer added in v1.0.1

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

func (*QueryLiquidationsConfigurationRequest) ProtoMessage added in v1.0.1

func (*QueryLiquidationsConfigurationRequest) ProtoMessage()

func (*QueryLiquidationsConfigurationRequest) Reset added in v1.0.1

func (*QueryLiquidationsConfigurationRequest) Size added in v1.0.1

func (*QueryLiquidationsConfigurationRequest) String added in v1.0.1

func (*QueryLiquidationsConfigurationRequest) Unmarshal added in v1.0.1

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

func (*QueryLiquidationsConfigurationRequest) XXX_DiscardUnknown added in v1.0.1

func (m *QueryLiquidationsConfigurationRequest) XXX_DiscardUnknown()

func (*QueryLiquidationsConfigurationRequest) XXX_Marshal added in v1.0.1

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

func (*QueryLiquidationsConfigurationRequest) XXX_Merge added in v1.0.1

func (*QueryLiquidationsConfigurationRequest) XXX_Size added in v1.0.1

func (*QueryLiquidationsConfigurationRequest) XXX_Unmarshal added in v1.0.1

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

type QueryLiquidationsConfigurationResponse added in v1.0.1

type QueryLiquidationsConfigurationResponse struct {
	LiquidationsConfig LiquidationsConfig `protobuf:"bytes,1,opt,name=liquidations_config,json=liquidationsConfig,proto3" json:"liquidations_config"`
}

QueryLiquidationsConfigurationResponse is a response message that contains the LiquidationsConfiguration.

func (*QueryLiquidationsConfigurationResponse) Descriptor added in v1.0.1

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

func (*QueryLiquidationsConfigurationResponse) GetLiquidationsConfig added in v1.0.1

func (*QueryLiquidationsConfigurationResponse) Marshal added in v1.0.1

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

func (*QueryLiquidationsConfigurationResponse) MarshalTo added in v1.0.1

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

func (*QueryLiquidationsConfigurationResponse) MarshalToSizedBuffer added in v1.0.1

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

func (*QueryLiquidationsConfigurationResponse) ProtoMessage added in v1.0.1

func (*QueryLiquidationsConfigurationResponse) Reset added in v1.0.1

func (*QueryLiquidationsConfigurationResponse) Size added in v1.0.1

func (*QueryLiquidationsConfigurationResponse) String added in v1.0.1

func (*QueryLiquidationsConfigurationResponse) Unmarshal added in v1.0.1

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

func (*QueryLiquidationsConfigurationResponse) XXX_DiscardUnknown added in v1.0.1

func (m *QueryLiquidationsConfigurationResponse) XXX_DiscardUnknown()

func (*QueryLiquidationsConfigurationResponse) XXX_Marshal added in v1.0.1

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

func (*QueryLiquidationsConfigurationResponse) XXX_Merge added in v1.0.1

func (*QueryLiquidationsConfigurationResponse) XXX_Size added in v1.0.1

func (*QueryLiquidationsConfigurationResponse) XXX_Unmarshal added in v1.0.1

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

type QueryServer

type QueryServer interface {
	// Queries a ClobPair by id.
	ClobPair(context.Context, *QueryGetClobPairRequest) (*QueryClobPairResponse, error)
	// Queries a list of ClobPair items.
	ClobPairAll(context.Context, *QueryAllClobPairRequest) (*QueryClobPairAllResponse, error)
	// Returns whether a subaccount is liquidatable.
	AreSubaccountsLiquidatable(context.Context, *AreSubaccountsLiquidatableRequest) (*AreSubaccountsLiquidatableResponse, error)
	// Runs the MEV node <> node calculation with the provided parameters.
	MevNodeToNodeCalculation(context.Context, *MevNodeToNodeCalculationRequest) (*MevNodeToNodeCalculationResponse, error)
	// Queries EquityTierLimitConfiguration.
	EquityTierLimitConfiguration(context.Context, *QueryEquityTierLimitConfigurationRequest) (*QueryEquityTierLimitConfigurationResponse, error)
	// Queries BlockRateLimitConfiguration.
	BlockRateLimitConfiguration(context.Context, *QueryBlockRateLimitConfigurationRequest) (*QueryBlockRateLimitConfigurationResponse, error)
	// Queries LiquidationsConfiguration.
	LiquidationsConfiguration(context.Context, *QueryLiquidationsConfigurationRequest) (*QueryLiquidationsConfigurationResponse, error)
}

QueryServer is the server API for Query service.

type RewardsKeeper

type RewardsKeeper interface {
	AddRewardSharesForFill(
		ctx sdk.Context,
		takerAddress string,
		makerAddress string,
		bigFillQuoteQuantums *big.Int,
		bigTakerFeeQuoteQuantums *big.Int,
		bigMakerFeeQuoteQuantums *big.Int,
	)
}

type SortedClobPairId

type SortedClobPairId []ClobPairId

SortedClobPairId is type alias for `[]ClobPairId` which supports deterministic sorting of clob pair Ids. This list assumes that all clob pair ids are unique and will panic if any two order placements have the same block height and transaction index.

func (SortedClobPairId) Len

func (s SortedClobPairId) Len() int

func (SortedClobPairId) Less

func (s SortedClobPairId) Less(i, j int) bool

func (SortedClobPairId) Swap

func (s SortedClobPairId) Swap(i, j int)

type SortedLongTermOrderPlacements

type SortedLongTermOrderPlacements []LongTermOrderPlacement

SortedLongTermOrderPlacements is type alias for `[]LongTermOrderPlacement` which supports deterministic sorting. Long Term order placements are first ordered by block height, followed by transaction index. This list assumes that all order placements are unique and will panic if any two order placements have the same block height and transaction index.

func (SortedLongTermOrderPlacements) Len

func (SortedLongTermOrderPlacements) Less

func (s SortedLongTermOrderPlacements) Less(i, j int) bool

func (SortedLongTermOrderPlacements) Swap

func (s SortedLongTermOrderPlacements) Swap(i, j int)

type SortedOrderHashes added in v0.3.0

type SortedOrderHashes []OrderHash

func (SortedOrderHashes) Len added in v0.3.0

func (s SortedOrderHashes) Len() int

func (SortedOrderHashes) Less added in v0.3.0

func (s SortedOrderHashes) Less(i, j int) bool

func (SortedOrderHashes) Swap added in v0.3.0

func (s SortedOrderHashes) Swap(i, j int)

type SortedOrders

type SortedOrders []OrderId

SortedOrders is type alias for `*OrderId` which supports deterministic sorting. Orders are first ordered by string comparison of their `Subaccount` owner, followed by integer comparison of their `Subaccount` number, followed by `ClientId` of the order, followed by `OrderFlags`, and finally by `ClobPairId` of the order. If two `*OrderIds` have equal Owners, Numbers, ClientIds, OrderFlags, and ClobPairId, they are assumed to be equal, and their sorted order is not deterministic.

func (SortedOrders) Len

func (s SortedOrders) Len() int

func (SortedOrders) Less

func (s SortedOrders) Less(i, j int) bool

func (SortedOrders) Swap

func (s SortedOrders) Swap(i, j int)

type SortedStatefulOrderPlacement

type SortedStatefulOrderPlacement []StatefulOrderPlacement

SortedStatefulOrderPlacement is type alias for `[]StatefulOrderPlacement` which supports deterministic sorting. Stateful orders must expose one TransactionOrdering to be sorted on. Ordering is first by block height, then transaction index. The following types are currently supported: - LongTermOrderPlacement - ConditionalOrderPlacement This list assumes that all order placements are unique and will panic if any two stateful order placements have the same TransactionOrdering.

func (SortedStatefulOrderPlacement) Len

func (SortedStatefulOrderPlacement) Less

func (s SortedStatefulOrderPlacement) Less(i, j int) bool

func (SortedStatefulOrderPlacement) Swap

func (s SortedStatefulOrderPlacement) Swap(i, j int)

type SpotClobMetadata

type SpotClobMetadata struct {
	// Id of the base Asset in the trading pair.
	BaseAssetId uint32 `protobuf:"varint,1,opt,name=base_asset_id,json=baseAssetId,proto3" json:"base_asset_id,omitempty"`
	// Id of the quote Asset in the trading pair.
	QuoteAssetId uint32 `protobuf:"varint,2,opt,name=quote_asset_id,json=quoteAssetId,proto3" json:"quote_asset_id,omitempty"`
}

PerpetualClobMetadata contains metadata for a `ClobPair` representing a Spot product.

func (*SpotClobMetadata) Descriptor

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

func (*SpotClobMetadata) GetBaseAssetId

func (m *SpotClobMetadata) GetBaseAssetId() uint32

func (*SpotClobMetadata) GetQuoteAssetId

func (m *SpotClobMetadata) GetQuoteAssetId() uint32

func (*SpotClobMetadata) Marshal

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

func (*SpotClobMetadata) MarshalTo

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

func (*SpotClobMetadata) MarshalToSizedBuffer

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

func (*SpotClobMetadata) ProtoMessage

func (*SpotClobMetadata) ProtoMessage()

func (*SpotClobMetadata) Reset

func (m *SpotClobMetadata) Reset()

func (*SpotClobMetadata) Size

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

func (*SpotClobMetadata) String

func (m *SpotClobMetadata) String() string

func (*SpotClobMetadata) Unmarshal

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

func (*SpotClobMetadata) XXX_DiscardUnknown

func (m *SpotClobMetadata) XXX_DiscardUnknown()

func (*SpotClobMetadata) XXX_Marshal

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

func (*SpotClobMetadata) XXX_Merge

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

func (*SpotClobMetadata) XXX_Size

func (m *SpotClobMetadata) XXX_Size() int

func (*SpotClobMetadata) XXX_Unmarshal

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

type StatefulOrderPlacement

type StatefulOrderPlacement interface {
	GetTransactionIndex() TransactionOrdering
}

StatefulOrderPlacement represents any type of order placement that is stored in state. An stateful order placement exposes a `TransactionOrdering` transaction index that is used when sorting the stateful order placements. Ordering is first by block height, then transaction index. The following types are currently supported: - LongTermOrderPlacement - ConditionalOrderPlacement

type StatefulOrderTimeSliceValue

type StatefulOrderTimeSliceValue struct {
	// A unique list of order_ids that expire at this timestamp, sorted in
	// ascending order by block height and transaction index of each stateful
	// order.
	OrderIds []OrderId `protobuf:"bytes,1,rep,name=order_ids,json=orderIds,proto3" json:"order_ids"`
}

StatefulOrderTimeSliceValue represents the type of the value of the `StatefulOrdersTimeSlice` in state. The `StatefulOrdersTimeSlice` in state consists of key/value pairs where the keys are UTF-8-encoded `RFC3339NANO` timestamp strings with right-padded zeroes and no time zone info, and the values are of type `StatefulOrderTimeSliceValue`. This `StatefulOrderTimeSliceValue` in state is used for managing stateful order expiration. Stateful order expirations can be for either long term or conditional orders.

func (*StatefulOrderTimeSliceValue) Descriptor

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

func (*StatefulOrderTimeSliceValue) GetOrderIds

func (m *StatefulOrderTimeSliceValue) GetOrderIds() []OrderId

func (*StatefulOrderTimeSliceValue) Marshal

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

func (*StatefulOrderTimeSliceValue) MarshalTo

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

func (*StatefulOrderTimeSliceValue) MarshalToSizedBuffer

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

func (*StatefulOrderTimeSliceValue) ProtoMessage

func (*StatefulOrderTimeSliceValue) ProtoMessage()

func (*StatefulOrderTimeSliceValue) Reset

func (m *StatefulOrderTimeSliceValue) Reset()

func (*StatefulOrderTimeSliceValue) Size

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

func (*StatefulOrderTimeSliceValue) String

func (m *StatefulOrderTimeSliceValue) String() string

func (*StatefulOrderTimeSliceValue) Unmarshal

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

func (*StatefulOrderTimeSliceValue) XXX_DiscardUnknown

func (m *StatefulOrderTimeSliceValue) XXX_DiscardUnknown()

func (*StatefulOrderTimeSliceValue) XXX_Marshal

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

func (*StatefulOrderTimeSliceValue) XXX_Merge

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

func (*StatefulOrderTimeSliceValue) XXX_Size

func (m *StatefulOrderTimeSliceValue) XXX_Size() int

func (*StatefulOrderTimeSliceValue) XXX_Unmarshal

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

type StatsKeeper

type StatsKeeper interface {
	RecordFill(ctx sdk.Context, takerAddress string, makerAddress string, notional *big.Int)
}

type SubaccountBlockLimits

type SubaccountBlockLimits struct {
	// The maximum notional amount that a single subaccount can have
	// liquidated (in quote quantums) per block.
	MaxNotionalLiquidated uint64 `` /* 127-byte string literal not displayed */
	// The maximum insurance-fund payout amount for a given subaccount
	// per block. I.e. how much it can cover for that subaccount.
	MaxQuantumsInsuranceLost uint64 `` /* 138-byte string literal not displayed */
}

SubaccountBlockLimits stores all configurable fields related to limits around how many quote quantums from a single subaccount can be liquidated within a single block.

func (*SubaccountBlockLimits) Descriptor

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

func (*SubaccountBlockLimits) GetMaxNotionalLiquidated

func (m *SubaccountBlockLimits) GetMaxNotionalLiquidated() uint64

func (*SubaccountBlockLimits) GetMaxQuantumsInsuranceLost

func (m *SubaccountBlockLimits) GetMaxQuantumsInsuranceLost() uint64

func (*SubaccountBlockLimits) Marshal

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

func (*SubaccountBlockLimits) MarshalTo

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

func (*SubaccountBlockLimits) MarshalToSizedBuffer

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

func (*SubaccountBlockLimits) ProtoMessage

func (*SubaccountBlockLimits) ProtoMessage()

func (*SubaccountBlockLimits) Reset

func (m *SubaccountBlockLimits) Reset()

func (*SubaccountBlockLimits) Size

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

func (*SubaccountBlockLimits) String

func (m *SubaccountBlockLimits) String() string

func (*SubaccountBlockLimits) Unmarshal

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

func (*SubaccountBlockLimits) XXX_DiscardUnknown

func (m *SubaccountBlockLimits) XXX_DiscardUnknown()

func (*SubaccountBlockLimits) XXX_Marshal

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

func (*SubaccountBlockLimits) XXX_Merge

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

func (*SubaccountBlockLimits) XXX_Size

func (m *SubaccountBlockLimits) XXX_Size() int

func (*SubaccountBlockLimits) XXX_Unmarshal

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

type SubaccountLiquidationInfo

type SubaccountLiquidationInfo struct {
	// An unsorted list of unique perpetual IDs that the subaccount has previously
	// liquidated.
	PerpetualsLiquidated []uint32 `` /* 129-byte string literal not displayed */
	// The notional value (in quote quantums, determined by the oracle price) of
	// all positions liquidated for this subaccount.
	NotionalLiquidated uint64 `protobuf:"varint,2,opt,name=notional_liquidated,json=notionalLiquidated,proto3" json:"notional_liquidated,omitempty"`
	// The amount of funds that the insurance fund has lost
	// covering this subaccount.
	QuantumsInsuranceLost uint64 `` /* 127-byte string literal not displayed */
}

SubaccountLiquidationInfo holds liquidation information per-subaccount in the current block.

func (*SubaccountLiquidationInfo) Descriptor

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

func (*SubaccountLiquidationInfo) GetNotionalLiquidated

func (m *SubaccountLiquidationInfo) GetNotionalLiquidated() uint64

func (*SubaccountLiquidationInfo) GetPerpetualsLiquidated

func (m *SubaccountLiquidationInfo) GetPerpetualsLiquidated() []uint32

func (*SubaccountLiquidationInfo) GetQuantumsInsuranceLost

func (m *SubaccountLiquidationInfo) GetQuantumsInsuranceLost() uint64

func (*SubaccountLiquidationInfo) HasPerpetualBeenLiquidatedForSubaccount

func (sli *SubaccountLiquidationInfo) HasPerpetualBeenLiquidatedForSubaccount(
	perpetualId uint32,
) bool

func (*SubaccountLiquidationInfo) Marshal

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

func (*SubaccountLiquidationInfo) MarshalTo

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

func (*SubaccountLiquidationInfo) MarshalToSizedBuffer

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

func (*SubaccountLiquidationInfo) ProtoMessage

func (*SubaccountLiquidationInfo) ProtoMessage()

func (*SubaccountLiquidationInfo) Reset

func (m *SubaccountLiquidationInfo) Reset()

func (*SubaccountLiquidationInfo) Size

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

func (*SubaccountLiquidationInfo) String

func (m *SubaccountLiquidationInfo) String() string

func (*SubaccountLiquidationInfo) Unmarshal

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

func (*SubaccountLiquidationInfo) XXX_DiscardUnknown

func (m *SubaccountLiquidationInfo) XXX_DiscardUnknown()

func (*SubaccountLiquidationInfo) XXX_Marshal

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

func (*SubaccountLiquidationInfo) XXX_Merge

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

func (*SubaccountLiquidationInfo) XXX_Size

func (m *SubaccountLiquidationInfo) XXX_Size() int

func (*SubaccountLiquidationInfo) XXX_Unmarshal

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

type SubaccountsKeeper

type SubaccountsKeeper interface {
	CanUpdateSubaccounts(
		ctx sdk.Context,
		updates []satypes.Update,
	) (
		success bool,
		successPerUpdate []satypes.UpdateResult,
		err error,
	)
	GetNetCollateralAndMarginRequirements(
		ctx sdk.Context,
		update satypes.Update,
	) (
		bigNetCollateral *big.Int,
		bigInitialMargin *big.Int,
		bigMaintenanceMargin *big.Int,
		err error,
	)
	GetSubaccount(
		ctx sdk.Context,
		id satypes.SubaccountId,
	) (
		val satypes.Subaccount,
	)
	GetAllSubaccount(
		ctx sdk.Context,
	) (
		list []satypes.Subaccount,
	)
	ForEachSubaccountRandomStart(
		ctx sdk.Context,
		callback func(satypes.Subaccount) (finished bool),
		rand *rand.Rand,
	)
	GetRandomSubaccount(
		ctx sdk.Context,
		rand *rand.Rand,
	) (
		satypes.Subaccount,
		error,
	)
	UpdateSubaccounts(
		ctx sdk.Context,
		updates []satypes.Update,
	) (
		success bool,
		successPerUpdate []satypes.UpdateResult,
		err error,
	)
	TransferFeesToFeeCollectorModule(
		ctx sdk.Context,
		assetId uint32,
		amount *big.Int,
	) error
	TransferInsuranceFundPayments(
		ctx sdk.Context,
		amount *big.Int,
	) error
}

type Subticks

type Subticks uint64

Subticks is used to represent the price level that an order will be placed on the orderbook.

func (Subticks) ToBigInt

func (st Subticks) ToBigInt() *big.Int

func (Subticks) ToBigRat

func (st Subticks) ToBigRat() *big.Rat

func (Subticks) ToUint64

func (st Subticks) ToUint64() uint64

type SubticksPerTick

type SubticksPerTick uint32

SubticksPerTick is used to represent how many subticks are in one tick. That is, the subticks of any valid order must be a multiple of this value.

type TakerOrderStatus

type TakerOrderStatus struct {
	// The state of the taker order after attempting to match it against the orderbook.
	OrderStatus OrderStatus
	// The amount of remaining (non-matched) base quantums of this taker order.
	RemainingQuantums satypes.BaseQuantums
	// The amount of base quantums that were optimistically filled (from this current matching cycle) of this taker
	// order. Note that if any quantums of this order were optimistically filled or filled in state before the current
	// matching cycle, this value will not include them.
	OrderOptimisticallyFilledQuantums satypes.BaseQuantums
}

TakerOrderStatus is a utility struct used for representing the status, remaining size, and optimistically filled size of a taker order after attempting to match it on the orderbook.

type TransactionOrdering

type TransactionOrdering struct {
	// Block height in which the transaction was placed.
	BlockHeight uint32 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	// Within the block, the unique transaction index.
	TransactionIndex uint32 `protobuf:"varint,2,opt,name=transaction_index,json=transactionIndex,proto3" json:"transaction_index,omitempty"`
}

TransactionOrdering represents a unique location in the block where a transaction was placed. This proto includes both block height and the transaction index that the specific transaction was placed. This information is used for ordering by time priority when the chain is restarted.

func (*TransactionOrdering) Descriptor

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

func (*TransactionOrdering) GetBlockHeight

func (m *TransactionOrdering) GetBlockHeight() uint32

func (*TransactionOrdering) GetTransactionIndex

func (m *TransactionOrdering) GetTransactionIndex() uint32

func (*TransactionOrdering) Marshal

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

func (*TransactionOrdering) MarshalTo

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

func (*TransactionOrdering) MarshalToSizedBuffer

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

func (*TransactionOrdering) ProtoMessage

func (*TransactionOrdering) ProtoMessage()

func (*TransactionOrdering) Reset

func (m *TransactionOrdering) Reset()

func (*TransactionOrdering) Size

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

func (*TransactionOrdering) String

func (m *TransactionOrdering) String() string

func (*TransactionOrdering) Unmarshal

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

func (*TransactionOrdering) XXX_DiscardUnknown

func (m *TransactionOrdering) XXX_DiscardUnknown()

func (*TransactionOrdering) XXX_Marshal

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

func (*TransactionOrdering) XXX_Merge

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

func (*TransactionOrdering) XXX_Size

func (m *TransactionOrdering) XXX_Size() int

func (*TransactionOrdering) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) CancelOrder

func (*UnimplementedMsgServer) CreateClobPair

func (*UnimplementedMsgServer) PlaceOrder

func (*UnimplementedMsgServer) ProposedOperations

func (*UnimplementedMsgServer) UpdateClobPair

func (*UnimplementedMsgServer) UpdateLiquidationsConfig

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) AreSubaccountsLiquidatable

func (*UnimplementedQueryServer) BlockRateLimitConfiguration added in v1.0.1

func (*UnimplementedQueryServer) ClobPair

func (*UnimplementedQueryServer) ClobPairAll

func (*UnimplementedQueryServer) LiquidationsConfiguration added in v1.0.1

func (*UnimplementedQueryServer) MevNodeToNodeCalculation

type ValidatorMevMatches

type ValidatorMevMatches struct {
	Matches            []MEVMatch            `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches"`
	LiquidationMatches []MEVLiquidationMatch `protobuf:"bytes,2,rep,name=liquidation_matches,json=liquidationMatches,proto3" json:"liquidation_matches"`
}

ValidatorMevMatches contains all matches from the validator's local operations queue.

func (*ValidatorMevMatches) Descriptor

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

func (*ValidatorMevMatches) GetLiquidationMatches

func (m *ValidatorMevMatches) GetLiquidationMatches() []MEVLiquidationMatch

func (*ValidatorMevMatches) GetMatches

func (m *ValidatorMevMatches) GetMatches() []MEVMatch

func (*ValidatorMevMatches) Marshal

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

func (*ValidatorMevMatches) MarshalTo

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

func (*ValidatorMevMatches) MarshalToSizedBuffer

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

func (*ValidatorMevMatches) ProtoMessage

func (*ValidatorMevMatches) ProtoMessage()

func (*ValidatorMevMatches) Reset

func (m *ValidatorMevMatches) Reset()

func (*ValidatorMevMatches) Size

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

func (*ValidatorMevMatches) String

func (m *ValidatorMevMatches) String() string

func (*ValidatorMevMatches) Unmarshal

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

func (*ValidatorMevMatches) XXX_DiscardUnknown

func (m *ValidatorMevMatches) XXX_DiscardUnknown()

func (*ValidatorMevMatches) XXX_Marshal

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

func (*ValidatorMevMatches) XXX_Merge

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

func (*ValidatorMevMatches) XXX_Size

func (m *ValidatorMevMatches) XXX_Size() int

func (*ValidatorMevMatches) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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