pub struct DemandRecord<DateTime, BidderId: Eq + Hash, DemandId: Eq + Hash, PortfolioId: Eq + Hash, AppData> {
pub id: DemandId,
pub as_of: DateTime,
pub bidder_id: BidderId,
pub app_data: AppData,
pub curve_data: Option<DemandCurve>,
pub portfolio_group: Map<PortfolioId, f64>,
}Expand description
Represents a demand entity in the flow trading system.
A demand captures a bidder’s interest in acquiring products through the system. Each demand is owned by a single bidder and can optionally include:
- A demand curve that defines pricing preferences
- A portfolio group that links this demand to one or more portfolios
Fields§
§id: DemandIdUnique identifier for this demand instance. Generated by the application when creating a new demand.
as_of: DateTimeTimestamp when this version of the demand was created or last updated. Used for temporal queries and history tracking.
bidder_id: BidderIdThe bidder who owns this demand.
app_data: AppDataApplication-specific data attached to this demand. This field allows extending the demand with custom data without modifying the core schema.
curve_data: Option<DemandCurve>Optional demand curve defining the bidder’s pricing preferences.
When present, this curve is used by the solver to determine optimal
allocations. Setting this to None effectively deletes the demand
from active consideration while preserving its history.
portfolio_group: Map<PortfolioId, f64>Map of portfolios associated with this demand and their weights.
The map keys are portfolio IDs and values are weights that determine how this demand is distributed across portfolios. An empty map means the demand is not yet associated with any portfolios.