nautechsystems/nautilus_trader · error
Derive does not support {aggregation:?} bars
Error message
Derive does not support {aggregation:?} bars What it means
bar_spec_to_derive_period only implements Minute/Hour/Day/Week aggregations for the Derive adapter; any other NautilusTrader BarAggregation (e.g. Second, Tick, Volume) has no Derive interval mapping and is rejected with this bail.
Source
Thrown at crates/adapters/derive/src/websocket/parse.rs:678
BarAggregation::Hour => match step {
1 => Ok(3600),
4 => Ok(14400),
8 => Ok(28800),
_ => anyhow::bail!("Derive only supports hour intervals 1, 4, 8"),
},
BarAggregation::Day => {
if step != 1 {
anyhow::bail!("Derive only supports 1 DAY interval bars");
}
Ok(86400)
}
BarAggregation::Week => {
if step != 1 {
anyhow::bail!("Derive only supports 1 WEEK interval bars");
}
Ok(604800)
}
_ => anyhow::bail!("Derive does not support {aggregation:?} bars"),
}
}
fn timestamp_seconds_to_nanos(value: u64, field: &str) -> anyhow::Result<UnixNanos> {
let nanos = value
.checked_mul(NANOSECONDS_IN_SECOND)
.with_context(|| format!("Derive {field} overflows nanoseconds"))?;
Ok(UnixNanos::from(nanos))
}
/// Parses an option ticker payload into [`OptionGreeks`].
///
/// Returns `Ok(None)` when the ticker does not carry option pricing.
///
/// # Errors
///
/// Returns an error when the ticker timestamp is negative or overflows.
pub fn parse_option_greeks(View on GitHub (pinned to 18893faf8b)
Solutions
- Use Minute, Hour, Day, or Week aggregation in the BarSpecification
- Use second-based bars only with an adapter that supports them
- Check Derive's supported intervals before configuring bar subscriptions
Example fix
// before let spec = BarSpecification::new(15.into(), BarAggregation::Second, PriceType::Last); // after let spec = BarSpecification::new(15.into(), BarAggregation::Minute, PriceType::Last);
Defensive patterns
Strategy: validation
Validate before calling
const DERIVE_AGGREGATIONS: &[BarAggregation] = &[BarAggregation::Minute, BarAggregation::Hour, BarAggregation::Day, BarAggregation::Week];
fn is_derive_aggregation_supported(agg: BarAggregation) -> bool {
DERIVE_AGGREGATIONS.contains(&agg)
} Prevention
- Restrict Derive bar specs to Minute/Hour/Day/Week aggregations
- Validate bar specs at config-load time, before requests are issued
When it happens
Trigger: Calling request_bars with a BarSpecification whose aggregation is not Minute, Hour, Day, or Week — e.g. BarAggregation::Second, Tick, Volume, or Dollar based bars.
Common situations: Reusing a bar spec written for a tick/volume-capable adapter with the Derive adapter; defaulting specs that use second-based aggregation for intraday strategies.
Related errors
- Derive only supports 1 WEEK interval bars
- Unsupported bar aggregation: {:?}
- Unsupported bar aggregation for Kraken Futures: {other:?}
- `handle_bar` is not implemented for `{}`
- Aggregation not time based
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/ef4071b6ff2c1e04.
Report an issue: GitHub.