Module lfest::prelude

source ·
Expand description

Exports common types

Re-exports§

Macros§

  • Macro used to convert a number literal into a Decimal.
  • Allows the quick construction of BaseCurrency
  • Creates the MarketUpdate::Bba variant.
  • Allows the quick construction of Fee
  • Allows the quick construction of Leverage
  • Allows the quick construction of QuoteCurrency

Structs§

  • The users account Generic over: M: The Currency representing the margin currency. UserOrderId: The type for the user defined order id.
  • The markets BASE currency, e.g.: BTCUSD -> BTC is the BASE currency
  • Define the Exchange configuration
  • Specifies the details of the futures contract
  • Represents a decimal number as a coefficient (i128) combined with a value (u8) specifying the number of fractional decimal digits.
  • The main leveraged futures exchange for simulated trading
  • Additional data about the order filled in by the exchange.
  • Fee as a fraction
  • The order has been fully filled. The executed order quantity is stored elsewhere.
  • Leverage
  • Defines a limit order. Is generic over: S: The order size aka quantity which is denoted in either base or quote currency. UserOrderId: The type of user order id to use. Set to () if you don’t need one.
  • Natural Logarithmic Returns newtype wrapping a borrowed slice of generic floats.
  • Defines an market order aka taker order. Is generic over: S: The order size aka quantity which is denoted in either base or quote currency. UserOrderId: The type of user order id to use.
  • Some information regarding the state of the market.
  • A new order has not been received by the exchange and has thus some pieces of information not available. This also means the various filters (e.g PriceFilter and QuantityFilter) have not been checked.
  • The order is pending execution, but it already has additional information filled in by the exchange.
  • Describes the position information of the account. It assumes isolated margining mechanism, because the margin is directly associated with the position.
  • The PriceFilter defines the price rules for a symbol
  • The SizeFilter defines the quantity rules that each order needs to follow The generic currency S is always the PairedCurrency of the margin currency
  • The markets QUOTE currency, e.g.: BTCUSD -> USD is the quote currency

Enums§

  • Describes possible Errors that may occur when calling methods in this crate
  • The two types of fees in the maker-taker model.
  • Contains the filled order quantity along with the average fill price.
  • Contains the possible updates to limit orders.
  • Which price to use in mark-to-market calculations
  • Decribes the possible updates to the market state
  • Defines the possible order errors that can occur when submitting a new order
  • The error that the RiskEngine outputs, if any.
  • Side of the order

Traits§

  • Every unit of account must implement this trait
  • Each Currency that is used as margin has to implement this trait. The margin currency of an account defines which type of futures contract is traded. Here is how the margin Currency maps to the futures type: QuoteCurrency: linear futures. BaseCurrency: inverse futures.

Type Aliases§

  • The type for the global order id sequence number used by the exchange.
  • This is defined as a convenience.
  • The type of a timestamp that is measured in nanoseconds.