interface FakeBrokerOptions {
    accounts?: readonly FakeAccountSeed[];
    features?: TradingFeatureSource;
    latency?: (
        operation: FakeBrokerOperation,
        accountId: undefined | string,
    ) => void | Promise<void>;
    now?: () => number;
}

Properties

accounts?: readonly FakeAccountSeed[]

Enables account ledgers. Omitted keeps the original book-only simulation.

What the simulated provider declares. Default with accounts: every feature and duration.

latency?: (
    operation: FakeBrokerOperation,
    accountId: undefined | string,
) => void | Promise<void>

Awaited before each call is answered, so a test can hold one account's answer and release it later.

now?: () => number

Clock in UTC seconds for snapshots, executions, history and expiry. Default Date.now() / 1000.