ibkr-agent-gateway 0.5.2

Unofficial local-first CLI and MCP gateway for Interactive Brokers workflows.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Market-data policy validation.

use crate::internal::domain::{ErrorCode, GatewayError, MarketDataPolicy};

/// Validates local market-data freshness policy.
pub fn validate_market_data_policy(policy: &MarketDataPolicy) -> Result<(), GatewayError> {
    if policy.max_snapshot_age_seconds == 0 {
        return Err(GatewayError::new(
            ErrorCode::ConfigInvalid,
            "market_data.max_snapshot_age_seconds must be positive",
            false,
            Some("Set max_snapshot_age_seconds to a positive value".to_string()),
        ));
    }

    Ok(())
}