Trade Protection Rules
The matching engine enforces rate limits, minimum notional requirements, and other trade protections.
Protection Rules
| Protection | Rule |
|---|---|
| Rate limiting | Weighted action rate per symbol (see below). |
| Minimum notional | Minimum order size according to fee tier. |
| Quote rest | Minimum time between price-improving modifications. |
| Self-trade prevention | Orders 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:
| Action | Weight | Minimum Interval | Description |
|---|---|---|---|
| Order placement | 1.0 | 1ms per symbol | New book insert |
| Cancel | 0.2 | 200μs per symbol | Position-indexed lookup |
| Modify | 1.2 | 1ms per symbol | Cancel (0.2) + insert (1.0) |
| Mass quote (batch) | 1.0 per batch | 1ms per symbol | One 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.