Releases: MathisWellmann/lfest-rs
0.37
0.35 Fill price information in `Order`
- removes
executed
field fromOrder
- Adds
filled
field (enumFilled
) toOrder
for additional fill price information.
Two releases in one day? Check out the previous 0.34
release which is much more important.
0.34: ClearingHouse, RiskEngine, ContractSpecification and more
This major redesign includes:
- New
RiskEngine
trait withIsolatedMarginRiskEngine
implementation - Improved limit order margining mechanism
ClearingHouse
used to settle the transactions, acting as a central counterpartyContractSpecification
: Contains a few more configurations for the marketMarketState
now contains the current market information- Many new methods with old ones removed
- Removed
Margin
struct - Restructures internals heavily
This version requires consumers to call new methods, but the general principals stay the same.
Happy trading!
0.33
Some minor API changes include:
- Annualized
sharpe
andsortino
ratios now returnDecimal
type. - Removed
ReturnsSource:TickByTick
as it had limited use and now its saving memory as well.
Order filters
Adds support for PriceFilter
and QuantityFilter
.
This ensures user orders and market data follow a set of rules.
Pricing rules include:
min_price: Defines the minimum price allowed. Disabled if min_price == 0
max_price: Defines the maximum price allowed. Disabled if max_price == 0
tick_size: Defines the intervals that a price can be increased / decreased by. For the filter to pass, (order.limit_price - min_price) % tick_size == 0
multiplier_up: Defines valid ranges for the order price relative to the mark price. To pass this filter, order.limit_price <= mark_price * multiplier_up
multiplier_down: Defines valid ranges for the order price relative to the mark price To pass this filter, order.limit_price >= mark_price * multiplier_down
Quantity rules:
min_quantity: Defines the minimum quantity of any order. Disabled if 0
max_quantity: Defines the maximum quantity of any order. Disabled if 0
step_size: Defines the intervals that a quantity can be increased / decreased by. For the filter to pass, (quantity - min_qty) % step_size == 0
Automatically infer futures type
Removes the FuturesType
enum in favor of an automatic mechanism to infer the futures type through the configured margin currency.
The field starting_wb
of Config
defines the margin Currency
to use which infers the futures type automatically.
The mapping is as follows:
QuoteCurrency
-> linear futures contract
BaseCurrency
-> inverse futures contract
This makes miss configuration impossible and is strictly better.
Fixed Point Arithmetic and NewType pattern
This major release touches every aspect of the codebase.
- The NewType pattern is used to enforce correct types at function boundaries.
This introducesBaseCurrency
,QuoteCurrency
,Fee
andLeverage
so it is impossible to accidentally pass a value denoted inUSD
into a function that expectBTC
for example. - Use of fixed point arithmetic instead of
f64
for fast and precise money calculations, thanks to the fpdec crate. - Lots of smaller changes to harmonize the codebase
better way of setting bid, ask and timestamp
Added update_state(&self, bid: f64, ask: f64, timestamp: u64) method to Exchange for better handling and user defined bid and ask levels. This also removes the dependency to trade_aggregation-rs
Methods removed are:
consume_trade()
consume_candle()