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: S: The Currency representing the order quantity
  • 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
  • Fee as a fraction
  • Leverage
  • Defines an order
  • 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.
  • Whether the order has been executed
  • 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
  • Defines the available order types
  • 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

  • This is defined as a convenience.