Trade Protection Rules

The matching engine enforces rate limits, minimum notional requirements, and other trade protections.

Protection Rules

ProtectionRule
Rate limitingWeighted action rate per symbol (see below).
Minimum notionalMinimum order size according to fee tier.
Quote restMinimum time between price-improving modifications.
Self-trade preventionOrders from the same account do not match each other.

Rejects: Error Codes.

Rate Limiting — Weighted Action Costs

Not every operation costs the same. GoDark uses a weighted action cost model:

ActionWeightMinimum IntervalDescription
Order placement1.01ms per symbolNew book insert
Cancel0.2200μs per symbolPosition-indexed lookup
Modify1.21ms per symbolCancel (0.2) + insert (1.0)
Mass quote (batch)1.0 per batch1ms per symbolOne batch, up to 20 legs

This weighted model allows higher cancel throughput than a flat action rate. Market makers, who typically cancel 10–50× more than they place, benefit from the lower cancel weight.

Minimum Notional

Each order must have a notional value specified in the fee tier. Calculate notional as:

notional = quantity × price

Quote Rest Period

After modifying a price, you must wait 1 millisecond before making another price-improving modification on the same order.

Self-Trade Prevention

Orders from the same account never match each other. This prevents accidental wash trading and ensures all executions are against different counterparties.