Trades Stack

Updated by Sameer Soleja

Broadly, Trades are for managing forwards, futures, swaps, and options. In Molecule, we think they should generally represent transactions that have happened.

Stack

Lifecycle

After a Trade is booked in Molecule, the following things happen:

  1. Legs are created, based on the Trade and associated Product
  2. Sublegs are created
  3. Valuations, for each subleg, from Trade Date to Subleg expiry, are created. Where no data is available, Valuations are still created.

In general, the above happens immediately — but in practice, Molecule has frequently-evolving queuing and prioritization infrastructure that (a) protects the platform from load-driven downtime, and (b) prioritizes the data users are likely to want first (i.e., Valuations for as-of = today).

When a trade is edited, all of the above items happen again.

When market data comes in for a particular as-of date, the Valuation rows for that as-of date, for anything linked to that market data, recalculate.

User Interaction

Users have limited ability for control downstream of the Trade object. The system enforces data consistency and quality, including making sure that leg/subleg volumes correctly add up to trade volumes. Custom shapes are not directly editable; that happens via Asset-Linked trades.

Users can directly control:

  • Trade Groups: by assigning trades to a group manually
  • the Trades themselves
  • Subleg settlement dates
  • the distribution of Subleg volumes — by splitting Sublegs
  • total Subleg volumes via Actualization (or Asset linking, or Ticket linking, which share the same underlying logic)
  • various informational fields on Sublegs, like Assets

Downstream

Once Trades are booked (and, ultimately, Valuations are created) the following objects are affected:

  • YTDs: an aggregation that calculates MTD/QTD/YTD values for each trade that was alive during a certain period.
  • Hourly Flows (aka Electron Flows): an aggregation that turns all power into its implied hourly volumes
  • Tickets: for any physical non-power trades, tickets are created.
  • VaR: VaR reruns, with a short lag to prevent excessive calculations.


How did we do?