RawPositionNotification
The raw position-state notification frame as it arrives on the wire (snake_case), mirroring the hedger/solver payload — one variant per notifications protocol, unioned:
type RawPositionNotification = RawEnigmaPositionNotification | RawRasaPositionNotification;Consumers normally receive the normalized Notification; the wire-faithful frame is retained on it as raw. The endpoints omit fields that do not apply to a given frame (for example an InstantRFQ report carries no id), so almost every field is optional; normalizeNotification fills sensible defaults and reconciles the per-wire value quirks.
Shared fields (both variants)
Fields both wires return. Amount/price fields are typed to the widest wire form (number | string | null) — rasa sends a numeric 0 for “no value”, enigma only ever a decimal string. Only fields exclusive to one wire live on the variants.
idstringoptionalquote_idnumberoptionalOn-chain quote id — 0 (enigma) or the negative temp id (rasa) while the order is still off-chain.
temp_quote_idnumberoptionalNegative placeholder id assigned before the on-chain quote id exists.
create_timenumberoptionalmodify_timenumberoptionalcounterparty_addressstringoptionaladdressstringoptionalSubAccount address the notification belongs to. On the enigma wire it is hoisted from the envelope; rasa frames do not carry it — the watcher stamps it from its own subscription.
filled_amount_opennumber | string | nulloptionalFilled base amount on the open leg. Decimal string when present (enigma always; rasa on a report); numeric 0 on
a rasa alert duplicate; absent/null otherwise. Same for the three fields below.
filled_amount_closenumber | string | nulloptionalavg_price_opennumber | string | nulloptionalavg_price_closenumber | string | nulloptionallast_seen_actionstring | nulloptionalLast solver action seen for this quote (e.g. SendQuoteTransaction).
action_statusstring | nulloptionalsuccess | failed | seen.
failure_typestring | nulloptionalerror_codenumber | nulloptionalstate_typestring | nulloptionalreport | alert.
RawEnigmaPositionNotification
The enigma (channel-scoped) wire, after the envelope unwrap. Adds the fields only this wire carries; on this wire the shared amount/price fields are always decimal strings (or null/absent), never numbers.
va_addressstringoptionalSolver-assigned Virtual Account address (lowcap), when present.
failure_messagestring | nulloptionalversionnumberoptionalRawRasaPositionNotification
The rasa position-state wire, bare (no envelope), kept exactly as sent. The shared amount/price fields are the numeric 0 when the frame carries no value (an alert duplicate) and a decimal string when it does (a report); normalizeNotification reconciles them.
order_typenumberoptionalOrder type discriminant the rasa wire attaches (e.g. 1).
EnigmaNotificationEnvelope
The enigma endpoint nests the notification under data, with the SubAccount address hoisted to the top level. parseNotificationFrame unwraps it back into a RawEnigmaPositionNotification.
dataRawEnigmaPositionNotificationThe nested notification frame.
addressstringThe SubAccount address, hoisted to the envelope root.
Related
- Notifications overview — the
enigmavsrasaprotocol axis these variants belong to. - Solvers & Chains — which chain speaks which notifications protocol.
- Notification — the normalized shape this becomes.
- normalizeNotification — the mapping, including the per-wire value reconciliation.
- parseNotificationFrame — produces the variant for each protocol.