mock-fintrade/docs/concepts/what is a trade?
concept · 5 min read

A trade in this system is the record of an execution — a deal that already happened on a venue (NYSE, NASDAQ, etc.). It is not an order, which is the request. Orders may be partially filled, cancelled, or rejected; trades are the fills that survived.

The four sides

When mock-fintrade composes a trade, the side field tells StarClear what to do with the customer's position. There are four:

siderequireseffect on position
BUYcash (or margin BP)opens or grows a long position
SELLholding the longcloses or reduces a long position
SELL_SHORTan APPROVED locateopens or grows a short position
BUY_TO_COVERholding the shortcloses or reduces a short position

Gross vs net

The price you send is per share. The total dollar amount has two flavors:

Trade date vs settlement date

Two dates matter for every trade:

What StarClear does with a trade POST

  1. Resolves the symbol against the security master (matching on ticker OR CUSIP OR ISIN).
  2. Computes SEC + TAF fees from the regulatory schedules (server-side authoritative).
  3. Computes settlement_date = T+1 skipping weekends + holidays (unless you sent one explicitly for a DTC-fail or balance-open case).
  4. Writes a balanced journal entry to journal_master (the back-office double-entry ledger).
  5. Returns 201 with the trade id and journal number — or RFC-7807 problem details on rejection.

The OMS' job before the POST

A real OMS doesn't blindly POST every trade — it gates first. mock-fintrade enforces 5 of 10 gates (G1, G2, G4, G5, G10) before touching v2; the other 5 are stubs awaiting server-fed registries. See how the gates work · stub.


Next: browse the 63-endpoint API reference →