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. |
| Market slippage | Optional slippage_bps on market / stop-market caps walk vs mark; omitted → venue max. |
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 | — | New order |
| Cancel | 1 | — | Cancel one order |
| Modify | 1 | — | Amend one order |
| Batch cancel / modify | 2 | — | Batch operation |
| Mass quote | 5 | — | One batch, up to 20 legs |
| Cancel all / close all | 5 | — | Account-wide operation |
Credits are charged against the request's trading rate class; mass quote is in the order-generating class.
Minimum Notional
Each order must have a notional value specified in the fee tier. Calculate notional as:
notional = quantity × price
Quote Rest Period
Quotes must rest for at least 500 ms before a price-improving replacement.
Self-Trade Prevention
stp_mode determines whether the maker, taker, or both are cancelled when the same account would self-match.