Skip to main content

Crate rustrade_execution

Crate rustrade_execution 

Source
Expand description

§Barter-Execution

Stream private account data from financial venues, and execute (live or mock) orders. Also provides a feature rich MockExchange and MockExecutionClient to assist with backtesting and paper-trading.

It is:

  • Easy: ExecutionClient trait provides a unified and simple language for interacting with exchanges.
  • Normalised: Allow your strategy to communicate with every real or MockExchange using the same interface.
  • Extensible: Barter-Execution is highly extensible, making it easy to contribute by adding new exchange integrations!

See README.md for more information and examples.

Re-exports§

pub use borrow_capacity::BorrowCapacity;
pub use cash_flow::CashFlow;
pub use cash_flow::CashFlowId;
pub use cash_flow::CashFlowKind;
pub use cash_flow::CashFlowsRead;
pub use fee::FeeModel;
pub use fee::FeeModelConfig;
pub use fee::Liquidity;
pub use fee::PerContractFeeModel;
pub use fee::PercentageFeeModel;
pub use fee::SpotFeeAsset;
pub use fee::ZeroFeeModel;
pub use fill::BidAskFillModel;
pub use fill::FillContext;
pub use fill::FillModel;
pub use fill::LastPriceFillModel;
pub use fill::MidpointFillModel;
pub use fill::SimFillConfig;
pub use fill_recovery::FillRecoveryFailure;
pub use fill_recovery::FillRecoveryGap;
pub use fill_recovery::FillRecoveryScope;
pub use holding_cost::AccrualDays;
pub use holding_cost::BorrowFeeModel;
pub use holding_cost::DailyAccrual;
pub use holding_cost::DayCount;
pub use holding_cost::FinancingModel;
pub use holding_cost::FinancingRates;
pub use holding_cost::FundingModel;
pub use holding_cost::HeldPosition;
pub use holding_cost::HoldingCharge;
pub use holding_cost::HoldingCostModel;
pub use holding_cost::HolidayCalendar;
pub use holding_cost::RateSeries;
pub use holding_cost::RateSeriesUnsorted;
pub use holding_cost::SettlementCalendar;
pub use holding_cost::WeekendsOnly;
pub use market::MarketDepth;
pub use market::MarketSnapshot;
pub use notice::AccountNotice;
pub use notice::NoticeKind;
pub use shortability::Shortability;
pub use shortability::ShortabilityProvider;
pub use shortability::ShortabilityTable;
pub use slippage::SlippageConfig;
pub use slippage::SlippageConfigError;

Modules§

balance
borrow_capacity
How much more this account can borrow now: what a venue says about the account’s own capacity to borrow, as opposed to Shortability, which says what the venue has to lend.
cash_flow
Cash that moves into or out of an account other than by a trade: perpetual funding, margin interest, stock borrow fees and rebates.
client
Execution client implementations for various exchanges.
error
Error types for ExecutionClient operations.
exchange
fee
fill
fill_recovery
What an account stream reports when its fill recovery gives up on a span of fills.
holding_cost
What a simulated position costs to hold over time: perpetual funding, borrow fees and overnight financing.
indexer
map
market
notice
Notices a venue sends about an account’s state that are not trades, orders or balances: margin calls, liquidation warnings, a liquidation under way, and the all-clear after them.
order
position
shortability
Whether an instrument can be sold short, and on what terms: what a venue says about lending it.
slippage
Adverse slippage on the simulated venue’s taker fills.
trade

Structs§

AccountEvent
AccountSnapshot
InstrumentAccountSnapshot
One instrument’s slice of an AccountSnapshot: its orders, and its position or isolated balances where the venue has them.
InstrumentBalanceUpdate
Live per-instrument isolated-margin balance update payload (the AccountEventKind::InstrumentBalanceUpdate counterpart of IsolatedInstrumentState).
IsolatedInstrumentState
Per-pair isolated-margin state attached to an InstrumentAccountSnapshot.
IsolatedMarginRisk
Per-pair isolated-margin risk metrics, surfaced on IsolatedInstrumentState.

Enums§

AccountEventKind

Type Aliases§

UnindexedAccountEvent
Convenient type alias for an AccountEvent keyed with ExchangeId, AssetNameExchange, and InstrumentNameExchange.
UnindexedAccountSnapshot
Convenient type alias for an AccountSnapshot keyed with ExchangeId, AssetNameExchange, and InstrumentNameExchange.