Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsShortTermClobMsgTx ¶
IsShortTermClobMsgTx returns `true` if the supplied `tx` consist of a single clob message (`MsgPlaceOrder` or `MsgCancelOrder`) which references a Short-Term Order. If `msgs` consist of multiple clob messages, or a mix of on-chain and clob messages, an error is returned.
func IsSingleClobMsgTx ¶
IsSingleClobMsgTx returns `true` if the supplied `tx` consist of a single clob message (`MsgPlaceOrder` or `MsgCancelOrder`). If `msgs` consist of multiple clob messages, or a mix of on-chain and clob messages, an error is returned.
Types ¶
type ClobDecorator ¶
type ClobDecorator struct {
// contains filtered or unexported fields
}
ClobDecorator is an AnteDecorator which is responsible for:
- adding short term order placements and cancelations to the in-memory orderbook (`CheckTx` only).
- adding stateful order placements and cancelations to state (`CheckTx` and `RecheckTx` only).
This AnteDecorator also enforces that any Transaction which contains a `MsgPlaceOrder`, or a `MsgCancelOrder`, must consist only of a single message.
This AnteDecorator is a no-op if:
- No messages in the transaction are `MsgPlaceOrder` or `MsgCancelOrder`.
- This AnteDecorator is called during `DeliverTx`.
This AnteDecorator returns an error if:
- The transaction contains multiple messages, and one of them is a `MsgPlaceOrder` or `MsgCancelOrder` message.
- The underlying `PlaceStatefulOrder`, `PlaceShortTermOrder`, `CancelStatefulOrder`, or `CancelShortTermOrder` methods on the keeper return errors.
func NewClobDecorator ¶
func NewClobDecorator(clobKeeper types.ClobKeeper) ClobDecorator
func (ClobDecorator) AnteHandle ¶
type ClobRateLimitDecorator ¶
type ClobRateLimitDecorator struct {
// contains filtered or unexported fields
}
ClobRateLimitDecorator is an AnteDecorator which is responsible for rate limiting MsgCancelOrder and MsgPlaceOrder requests.
This AnteDecorator is a no-op if:
- No messages in the transaction are `MsgCancelOrder` or `MsgPlaceOrder`.
This AnteDecorator returns an error if:
- The rate limit is exceeded for any `MsgCancelOrder` messages.
- The rate limit is exceeded for any `MsgPlaceOrder` messages.
TODO(CLOB-721): Rate limit short term order cancellations.
func NewRateLimitDecorator ¶
func NewRateLimitDecorator(clobKeeper types.ClobKeeper) ClobRateLimitDecorator
func (ClobRateLimitDecorator) AnteHandle ¶
type ShortTermSingleMsgClobTxAnteWrapper ¶
type ShortTermSingleMsgClobTxAnteWrapper struct {
// contains filtered or unexported fields
}
ShortTermSingleMsgClobTxAnteWrapper is a wrapper for Antehandlers that need to be skipped for single msg clob txs `MsgPlaceOrder` and `MsgCancelOrder` which reference Short-Term orders. For example, these transactions do not require sequence number validation.
func NewShortTermSingleMsgClobTxAnteWrapper ¶
func NewShortTermSingleMsgClobTxAnteWrapper(handler sdk.AnteDecorator) ShortTermSingleMsgClobTxAnteWrapper
func (ShortTermSingleMsgClobTxAnteWrapper) AnteHandle ¶
func (ShortTermSingleMsgClobTxAnteWrapper) GetAnteHandler ¶
func (antWrapper ShortTermSingleMsgClobTxAnteWrapper) GetAnteHandler() sdk.AnteDecorator
type SingleMsgClobTxAnteWrapper ¶
type SingleMsgClobTxAnteWrapper struct {
// contains filtered or unexported fields
}
SingleMsgClobTxAnteWrapper is a wrapper for Antehandlers that need to be skipped for single msg clob txs `MsgPlaceOrder` and `MsgCancelOrder`. These transactions should always have `0` Gas, and therefore should never be charged a gas fee.
func NewSingleMsgClobTxAnteWrapper ¶
func NewSingleMsgClobTxAnteWrapper(handler sdk.AnteDecorator) SingleMsgClobTxAnteWrapper
func (SingleMsgClobTxAnteWrapper) AnteHandle ¶
func (SingleMsgClobTxAnteWrapper) GetAnteHandler ¶
func (antWrapper SingleMsgClobTxAnteWrapper) GetAnteHandler() sdk.AnteDecorator