Skip to main content

Crate qx_execution

Crate qx_execution 

Source
Expand description

统一执行层边界。

Venue 只返回 VenueEvent,执行层负责把这些事件转换成运行时标准事实, 再通过本 crate application 子模块的执行端口交给 EventLog、订单状态和 Ledger。Paper、 Binance 以及未来连接器都必须复用这里的事实转换,不能在 CLI 中各写一套。 本 crate 不依赖任何具体运行时或存储后端。

Re-exports§

pub use algo_execution::AlgoExecutionState;
pub use algo_execution::AlgoExecutionStatus;
pub use algo_execution::AlgoExecutionStep;
pub use algo_execution::AlgoParentOrder;
pub use algo_execution::ALGO_EXECUTION_STATE_SCHEMA_VERSION;
pub use application::*;

Modules§

algo_execution
Bounded, restartable submission of a deterministic TWAP/VWAP child plan.
application
应用层端口。

Structs§

AlgoChildSlice
BorrowedVenuePort
把仍使用旧版 Venue trait 的连接器借用到统一 VenuePort,使只持有可变 借用的执行入口(Paper worker、多腿编排)也走同一个 ExecutionGateway。
CanonicalRiskPort
直接适配 qx-risk::OrderRiskContext 的应用层端口。
EventLogReconcilePort
把“结果未知,必须先对账”写成运行时事实的端口适配器(对账判定唯一口径在 qx-genglu 的 order_reconcile_verdict,本端口只落事实、不复制判定)。
HedgeRecoveryOutcome
Explicit recovery result for a spread group whose confirmed exposure needs to be offset. The worker never submits a hedge for an unknown original leg; that case remains ReconcileRequired and must be resolved by the venue reconciliation flow first.
HedgeRecoveryWorker
Restart-safe single-node hedge recovery worker.
PaperSubmitRequest
Required Paper execution inputs. Every safety and pricing decision is a named, mandatory field; this type intentionally has no Default implementation.
PortExecutionResult
PortExecutionService
完全基于 Application Ports 的单腿执行器。
RiskContextPort
把当前账户快照适配为应用层 RiskPort,便于回测、Paper 和实盘执行器 替换风控实现而不改动 ExecutionGateway 的订单副作用边界。
RiskExecutionContext
SubmitOrderWithRiskRequest
Required inputs for the shared order submission boundary. The group store stays explicit so a caller cannot accidentally bypass the multi-leg barrier.
VenuePortAdapter
将现有 Venue 事实适配为应用层 VenuePort。它只做事实类型转换,不写 EventLog/OMS;真正的副作用仍由 ExecutionGateway(PortExecutionService)统一编排。
VwapVolumeBucket

Enums§

AlgoExecutionError

Constants§

MAX_ALGO_CHILDREN

Traits§

HedgeOrderValidator

Functions§

execute_paper_submit_effect
Paper 执行的统一单轨入口:风控预检、行情门禁与事实写入语义只由执行端口决定。
ingest_venue_events
将 Venue 返回的订单事实统一归约到执行事件端口(EventLog/Ledger 管线)。
ingest_venue_events_with_spec
将含有冻结产品规格的 Venue 成交归约为衍生品记账事实。
plan_twap
Split a parent quantity into near-equal slices distributed over the closed [start_ts, end_ts] interval. Remainder units go to earlier slices so the result is deterministic and exactly conserves the parent quantity.
plan_vwap
Allocate parent quantity proportional to a frozen market-volume profile. The last bucket receives the integer rounding remainder, preserving the exact parent quantity. The profile is bounded and must contain strictly increasing timestamps and positive volumes.
spread_group_barrier
submit_order_with_risk
提交一条已通过控制面审计的 SubmitOrder:框架唯一的订单提交入口。

Type Aliases§

ExecutionGateway
统一执行网关名称。新运行时、Paper、回测和语言绑定应依赖这个端口化 入口;保留 PortExecutionService 作为兼容的具体类型名,避免已有适配器 在迁移期间被迫同时修改。