Skip to main content

parse_derive_trade_to_fill_report

Function parse_derive_trade_to_fill_report 

Source
pub fn parse_derive_trade_to_fill_report(
    trade: &DeriveTrade,
    account_id: AccountId,
    fee_currency: Currency,
    ts_init: UnixNanos,
) -> Result<Option<FillReport>>
Expand description

Builds a [FillReport] from a Derive trade record.

Quote-currency commission is reported in the same currency as the instrument’s settlement (USDC for perps and options). client_order_id is sourced from the trade label when it is a valid Nautilus identifier. Trailing zero padding is removed without changing the value. Returns Ok(None) with a warning when the trade or order identifier is empty.

§Errors

Returns an error if a nonempty required identifier is invalid or a decimal field cannot be converted to a Nautilus Price, Quantity, or Money.