A Trade is either a buy/sell offer at a Station, or an active trade order between buyer and seller. Trades are the unit of station economy — every Trade subscription update is a list of trades; every trade-completed event references a trade.
Inheritance: None — trade is its own root datatype. Trade is a transient operation entity, not a physical object.
⚠ .amount vs .desiredamount vs .offeramount — three different quantities: actual current amount, what the buyer wants (regardless of affordability), and amount-plus-reservations. Don’t conflate.
⚠ .bundle / .unbundle change content type on transfer. A bundle trade converts ammo/units into wares; unbundle does the reverse. Check before assuming “wares in = wares out”.
⚠ Free trades still transfer wares..buyfree=true means the buyer pays nothing; the wares still move. Use for mission-reward trades that don’t drain the treasury.
⚠ Restriction list is a whitelist by default..restriction.inverted=true flips it to a blacklist. Read both fields to interpret correctly.
⚠ Ship-to-ship trades have one stationary party..isbuyerpassive / .issellerpassive mark which side waits. Used for mining-ship-to-trader exchanges.