Skip to main content

Module pnl_attribution

Module pnl_attribution 

Source
Expand description

PnL attribution engine.

Replays fills to track per-symbol positions and computes attributed PnL at any point in time given mark prices. Used for:

  • Live attribution in the snapshot job going forward

Modules§

position_tracker 🔒
Position tracker that replays fills and computes per-symbol PnL attribution.
serde_codec 🔒
Msgpack encoding/decoding for PnL attribution data.

Structs§

Attribution
Full attribution snapshot for a wallet.
Fill
A fill event to replay.
PositionTracker
Tracks positions for a single wallet across all symbols.
SymbolAttribution
Per-symbol PnL attribution at a point in time.

Enums§

Side

Functions§

decode_attribution
Decode msgpack bytes back to an Attribution.
encode_attribution
Encode an Attribution to msgpack bytes.