49 return left.value == right.value;
52 return !(left == right);
55 return left.value < right.value;
102using SizeBasis = std::variant<CashValue, EquityFraction>;
215using ReductionSize = std::variant<ExplicitUnits, OwnerOpenedUnits, ScopeFraction>;
229using OrderIntent = std::variant<Flatten, Reduce, Transact, ReverseTo, HostSized, Sized>;
269 std::optional<TrailTicks>
ticks = std::nullopt;
271using Trigger = std::variant<Market, Limit, Stop, StopLimit, Trail>;
331using Capacity = std::variant<ImmediateRemaining, PointBudget>;
413using Owner = std::variant<Independent, WaitForApplied, BindOpening, BindOpenings, BindCohort>;
422using Group = std::variant<NoGroup, Member>;
444 if (std::holds_alternative<execution::Flatten>(action))
return Flatten{};
445 if (
const auto* transact = std::get_if<order_action::Transact>(&action)) {
446 return Transact{transact->signed_units};
448 const auto& reduce = std::get<order_action::Reduce>(action);
453 std::string label = {},
454 std::string comment = {}) {
459 return std::holds_alternative<Market>(request.trigger)
460 && std::holds_alternative<ImmediateRemaining>(request.capacity)
461 && std::holds_alternative<Independent>(request.owner)
462 && std::holds_alternative<NoGroup>(request.group)
463 && std::holds_alternative<Absolute>(request.anchor);
472 return a.
ordinal == b.ordinal && a.
run == b.run;
482 return a.point.ordinal == b.point.ordinal && a.t == b.t
483 && a.point.interval_index == b.point.interval_index
484 && a.point.effective_time_ms == b.point.effective_time_ms
485 && a.point.provenance == b.point.provenance
486 && a.point.path_phase == b.point.path_phase;
491 return static_cast<std::uint8_t
>(cursor.point.path_phase);
551using Enrollment = std::variant<EnrollmentFromCommand, EnrollmentFromApplied>;
583using ExecutionScope = std::variant<execution::Book, execution::OpeningExposure, SelectedExposure>;
688 const std::optional<RequestHandle>&
predecessor() const noexcept {
700 uint64_t point_ordinal,
701 int64_t effective_time_ms)
noexcept {
702 return point_eligible(live.birth(), point_ordinal, effective_time_ms);
709 if (!std::isfinite(q) || !std::isfinite(step) || step <= 0.0)
return false;
710 const double abs_q = std::abs(q);
711 const double r = abs_q / step;
712 if (!std::isfinite(r))
return false;
713 const double n = std::round(r);
714 if (!std::isfinite(n) || n < 1.0 || n > 0x1p53)
return false;
715 const double g = n * step;
716 if (!std::isfinite(g))
return false;
717 const double err = std::abs(abs_q - g);
718 const double span = std::max(abs_q, std::abs(g));
719 const double ulp = std::nextafter(span, std::numeric_limits<double>::infinity()) - span;
720 const double ulp_bound = 4.0 * ulp;
721 const double half_step = step / 2.0;
722 if (!std::isfinite(err) || !std::isfinite(ulp_bound) || !std::isfinite(half_step))
724 return err <= ulp_bound && err < half_step;
759 std::optional<RequestRejectReason>
reason;
766 std::optional<RequestRejectReason>
reason;
824 return std::visit([](
const auto& alternative) ->
ExecutionPlan {
1055 return cursor.point.last_traded_close_ms;
1059 return static_cast<std::uint8_t
>(
cursor.point.provenance);
1196 for (std::size_t i = 0; i < size_ && i < inline_.size(); ++i) {
1197 inline_[i] = std::move(other.inline_[i]);
1199 overflow_ = std::move(other.overflow_);
1203 if (
this != &other) {
1205 size_ = other.size_;
1206 for (std::size_t i = 0; i < size_ && i < inline_.size(); ++i) {
1207 inline_[i] = std::move(other.inline_[i]);
1209 overflow_ = std::move(other.overflow_);
1215 for (std::size_t i = 0; i < size_ && i < inline_.size(); ++i) {
1216 inline_[i] = other.inline_[i];
1218 overflow_ = other.overflow_;
1221 if (
this != &other) {
1223 size_ = other.size_;
1224 for (std::size_t i = 0; i < size_ && i < inline_.size(); ++i) {
1225 inline_[i] = other.inline_[i];
1227 overflow_ = other.overflow_;
1232 std::size_t
size() const noexcept {
return size_; }
1233 bool empty() const noexcept {
return size_ == 0; }
1235 template<
class Event>
1241 if (overflow_.empty() && size_ < inline_.size()) {
1242 inline_[size_++].emplace(std::move(event));
1245 if (overflow_.empty()) {
1246 overflow_.reserve(inline_.size() * 2U);
1247 for (std::size_t i = 0; i < size_; ++i) {
1248 overflow_.push_back(std::move(*inline_[i]));
1252 overflow_.push_back(std::move(event));
1257 for (std::size_t i = 0; i < size_ && i < inline_.size(); ++i) {
1267 return overflow_.empty() ? *inline_[index] : overflow_[index];
1270 return overflow_.empty() ? *inline_[index] : overflow_[index];
1274 std::array<std::optional<CommandEvent>, 2> inline_{};
1275 std::vector<CommandEvent> overflow_{};
1276 std::size_t size_ = 0;
1343 double offset,
double kernel_level)>;
1524 const std::vector<LiveRequest>&
live() const noexcept {
return live_; }
1525 const std::vector<CommandEvent>&
history() const noexcept {
return history_; }
1526 const std::vector<CohortRoster>&
cohorts() const noexcept {
return cohorts_; }
1528 return cohort_receipts_;
1543 int64_t decision_time_ms,
1544 uint64_t& next_order_incarnation,
1545 uint64_t& next_timeline_ordinal,
1546 std::optional<double> quantity_grid = std::nullopt);
1550 int64_t decision_time_ms,
1551 uint64_t& next_order_incarnation,
1552 uint64_t& next_timeline_ordinal,
1553 std::optional<double> quantity_grid = std::nullopt,
1564 uint64_t& next_order_incarnation,
1565 uint64_t& next_timeline_ordinal,
1570 uint64_t& next_order_incarnation,
1571 uint64_t& next_timeline_ordinal,
1585 uint64_t& next_timeline_ordinal);
1591 uint64_t& next_timeline_ordinal,
1592 std::optional<Side> cohort_side = std::nullopt,
1598 uint64_t& next_timeline_ordinal);
1603 uint64_t& next_timeline_ordinal);
1607 uint64_t& next_timeline_ordinal);
1612 std::optional<ExecutionTerms> attempted_terms,
1613 uint64_t& next_timeline_ordinal);
1617 uint64_t& next_timeline_ordinal);
1623 uint64_t& next_timeline_ordinal);
1630 uint64_t& next_timeline_ordinal);
1647 double resolved_units,
1650 bool* exhausted)
noexcept;
1660 uint64_t& next_timeline_ordinal);
1668 const std::optional<OpeningObservation>& observation,
1669 uint64_t& next_timeline_ordinal,
1674 uint64_t& next_timeline_ordinal);
1677 uint64_t& next_timeline_ordinal);
1686 bool existing_matching_bit)
const noexcept;
1688 std::optional<Side> cohort_side = std::nullopt)
const noexcept;
1691 enum class TargetKind { Live, NotWorking, InvalidHandle };
1699 static void require_grid(std::optional<double> quantity_grid);
1700 static void require_distinct_counters(uint64_t& next_order_incarnation,
1701 uint64_t& next_timeline_ordinal);
1702 std::optional<RequestRejectReason> validate_request(
1705 const std::optional<RequestHandle>& replace_target)
const;
1709 static std::optional<RequestRejectReason> resolve_tick_spellings(
1714 enum class ReceiptLookup : std::uint8_t { Absent = 0, Present = 1, Conflict = 2 };
1717 std::vector<EventId>* ids,
1718 double* total)
const;
1723 bool trail_level_ok(
double best,
double offset,
bool is_buy,
double* stop)
const noexcept;
1725 std::optional<RequestHandle> canonical_cohort_origin(
const RequestHandle& origin)
const;
1726 std::size_t cohort_index(
CohortHandle cohort)
const noexcept;
1728 uint64_t usable_ordinal(uint64_t next)
const;
1729 uint64_t usable_incarnation(uint64_t next)
const;
1730 TargetKind classify(
const RequestHandle& handle, std::size_t* live_index)
const;
1731 bool bump_epoch() noexcept;
1732 void require_epoch_room() const;
1733 void clear_unbound() noexcept;
1735 struct InstanceBinding {
1736 uint64_t generation = 1;
1737 bool expired =
false;
1739 struct MutationPlan {
1740 std::weak_ptr<InstanceBinding> instance;
1741 uint64_t generation = 0;
1744 std::size_t history_size = 0;
1745 uint64_t last_ordinal = 0;
1746 bool consumed =
false;
1748 std::uint8_t live_change = 0;
1749 std::size_t live_index = 0;
1751 bool consume_incarnation =
false;
1752 uint64_t incarnation_used = 0;
1753 bool add_receipt =
false;
1754 EventId receipt_cause{};
1755 RequestHandle receipt_recipient{};
1757 uint64_t receipt_outcome = 0;
1759 std::optional<InstallError> validate_plan(
const MutationPlan& plan)
const noexcept;
1761 MutationPlan begin_plan()
const;
1762 void reserve_plan(
const MutationPlan& plan);
1763 void bind_plan(MutationPlan& plan)
const;
1764 void seal_plan(MutationPlan& plan);
1767 RunIdentity identity_;
1768 std::shared_ptr<InstanceBinding> instance_;
1769 std::vector<LiveRequest> live_;
1770 std::vector<CommandEvent> history_;
1771 uint64_t last_ordinal_ = 0;
1772 uint64_t last_incarnation_ = 0;
1773 uint64_t epoch_ = 0;
1774 std::vector<std::pair<uint64_t, std::size_t>> ordinal_index_;
1777 RequestHandle recipient;
1779 uint64_t outcome_ordinal = 0;
1781 std::vector<ReceiptKey> receipts_;
1782 std::uint64_t next_cohort_handle_ = 1;
1783 std::vector<CohortRoster> cohorts_;
1784 std::vector<CohortReceipt> cohort_receipts_;
1795 explicit operator
bool() const noexcept;
1802 std::unique_ptr<Impl> impl_;
1814 explicit operator
bool() const noexcept;
1821 std::unique_ptr<Impl> impl_;
1833 explicit operator
bool() const noexcept;
1840 std::unique_ptr<Impl> impl_;
1852 explicit operator
bool() const noexcept;
1857 std::unique_ptr<Impl> impl_;
1869 explicit operator
bool() const noexcept;
1874 std::unique_ptr<Impl> impl_;
1878static_assert(
std::is_nothrow_move_constructible_v<
Request>);
1879static_assert(
std::is_nothrow_move_assignable_v<
Request>);
1910 return static_cast<std::size_t
>(value.value ^ (value.value >> 32));
Almost every prepared command yields one history event.
const CommandEvent & operator[](std::size_t index) const noexcept
InlineCommandEvents & operator=(InlineCommandEvents &&other) noexcept
bool empty() const noexcept
InlineCommandEvents & operator=(const InlineCommandEvents &other)
std::size_t size() const noexcept
void emplace_back(Event &&event)
CommandEvent & operator[](std::size_t index) noexcept
InlineCommandEvents(InlineCommandEvents &&other) noexcept
InlineCommandEvents()=default
CommandEvent & front() noexcept
const CommandEvent & front() const noexcept
void push_back(CommandEvent event)
InlineCommandEvents(const InlineCommandEvents &other)
EventId predicted_event_id() const
const CancelResult & predicted() const
friend class WorkingRequestCore
PreparedCancel() noexcept
PreparedExecution() noexcept
friend class WorkingRequestCore
PreparedMutation() noexcept
friend class WorkingRequestCore
PreparedReplace() noexcept
EventId predicted_event_id() const
const ReplaceResult & predicted() const
friend class WorkingRequestCore
const SubmitResult & predicted() const
PreparedSubmit() noexcept
friend class WorkingRequestCore
EventId predicted_event_id() const
std::vector< RequestHandle > bound_close_handles() const
PreparedCancel prepare_cancel(const RequestHandle &target, uint64_t &next_timeline_ordinal, CancelReason reason=CancelReason::User)
reason lets the kernel withdraw its own request under the durable Superseded receipt.
EligibilityFacts eligibility_facts(const LiveRequest &live, const EvaluationContext &context) const noexcept
SubmitResult submit(const Request &request, int64_t decision_time_ms, uint64_t &next_order_incarnation, uint64_t &next_timeline_ordinal, std::optional< double > quantity_grid=std::nullopt)
R1 producer convenience: prepare then install one command.
WorkingRequestCore & operator=(WorkingRequestCore &&other) noexcept
static bool effective_host_units(const PendingAdjustments &pending, double resolved_units, double *deduction, double *after, bool *exhausted) noexcept
Pure arithmetic over the cached pending total.
InstallResult install_mutation(PreparedMutation &&prepared) noexcept
std::vector< RequestHandle > waiting_children(const RequestHandle &parent) const
InstalledCommand< ReplaceResult > install_replace(PreparedReplace &&prepared) noexcept
Preparation< PreparedMutation > prepare_bound_expiry(const EventId &physical_cause, const RequestHandle &child, const TargetObservation &observation, uint64_t &next_timeline_ordinal)
friend class PreparedReplace
const std::vector< CommandEvent > & history() const noexcept
Preparation< PreparedMutation > prepare_evaluation(const RequestHandle &target, const EvaluationContext &context, const TargetObservation &observation, uint64_t &next_timeline_ordinal)
friend class PreparedExecution
Preparation< PreparedMutation > prepare_no_effect(const RequestHandle &target, const EvaluationContext &context, uint64_t &next_timeline_ordinal)
bool evaluation_eligible(const LiveRequest &live, const EvaluationContext &context) const noexcept
bool cohort_contains(CohortHandle cohort, const RequestHandle &opening) const
Preparation< PreparedExecution > prepare_execution(const RequestHandle &target, const ExecutionProposal &proposal, uint64_t &next_timeline_ordinal)
InstallResult install_execution(PreparedExecution &&prepared, const CommittedExecutionFacts &facts) noexcept
std::vector< RequestHandle > group_recipients(const EventId &applied) const
void reset(RunIdentity identity)
friend class PreparedCancel
friend class PreparedMutation
void refresh_point_allowances(uint64_t point, const PositionIdentity &position) noexcept
Consumer-only no-event form of the ordinary allowance refresh.
CohortHandle cohort_open()
Command-boundary roster maintenance.
WorkingRequestCore(RunIdentity identity)
void cohort_remove(CohortHandle cohort, RequestHandle origin)
void reserve(std::size_t expected_events)
bool has_waiting_children(const RequestHandle &parent) const noexcept
WorkingRequestCore(WorkingRequestCore &&other) noexcept
Move transfers the complete run.
InstalledCommand< CancelResult > install_cancel(PreparedCancel &&prepared) noexcept
bool refresh_allowance(const RequestHandle &target, const EvaluationContext &context, const TargetObservation &observation)
const CommandEvent * event_at(const EventId &id) const
Preparation< PreparedMutation > prepare_parent_terminal(const EventId &terminal_or_replaced, const RequestHandle &child, uint64_t &next_timeline_ordinal)
PreparedReplace prepare_replace(const RequestHandle &target, const Request &request, const CommandContext &context, uint64_t &next_order_incarnation, uint64_t &next_timeline_ordinal, ReplaceOptions options={})
const RunIdentity & identity() const noexcept
Preparation< PreparedMutation > prepare_trigger(const RequestHandle &target, const TriggerTransition &transition, DriverEligibilityClass driver_class, uint64_t &next_timeline_ordinal, std::optional< Side > cohort_side=std::nullopt, const ActivationGrid &grid={})
grid carries the run's activation grid (ActivationGrid); the default is the raw rule,...
bool working_is_buy(const LiveRequest &live, std::optional< Side > cohort_side=std::nullopt) const noexcept
Preparation< PreparedMutation > prepare_terms(const RequestHandle &target, const EvaluationContext &context, const TermsResolvedInput &input, uint64_t &next_timeline_ordinal)
CancelResult cancel(const RequestHandle &target, uint64_t &next_timeline_ordinal)
const std::vector< LiveRequest > & live() const noexcept
WorkingRequestCore(const WorkingRequestCore &)=delete
friend class PreparedSubmit
const std::vector< CohortRoster > & cohorts() const noexcept
Preparation< PreparedMutation > prepare_match_rejected(const RequestHandle &target, const EvaluationContext &context, MatchRejectReason reason, std::optional< ExecutionTerms > attempted_terms, uint64_t &next_timeline_ordinal)
const LiveRequest * find_live(const RequestHandle &handle) const
bool refresh_cohort_allowance(const RequestHandle &target, const EvaluationContext &context, const TargetObservation &observation)
Preparation< PreparedMutation > prepare_margin_call(const MarginCallEvent &event, uint64_t &next_timeline_ordinal)
Append one MarginCallEvent to the immutable history.
Preparation< PreparedMutation > prepare_match_rejected(const RequestHandle &target, const EvaluationContext &context, MatchRejectReason reason, uint64_t &next_timeline_ordinal)
bool trigger_permits_driver(const Trigger &trigger, const TriggerState &state, DriverEligibilityClass driver_class, bool existing_matching_bit) const noexcept
const std::vector< CohortReceipt > & cohort_receipts() const noexcept
ReplaceResult replace(const RequestHandle &target, const Request &request, int64_t decision_time_ms, uint64_t &next_order_incarnation, uint64_t &next_timeline_ordinal, std::optional< double > quantity_grid=std::nullopt, ReplaceOptions options={})
Preparation< PreparedMutation > prepare_risk_event(const NativeRiskEvent &event, uint64_t &next_timeline_ordinal)
Append one NativeRiskEvent to the immutable history.
Preparation< PreparedMutation > prepare_group_effect(const EventId &applied, const RequestHandle &recipient, uint64_t &next_timeline_ordinal)
void cohort_add(CohortHandle cohort, RequestHandle origin)
static Allowance evaluated_allowance(const LiveRequest &live, uint64_t point) noexcept
The allowance that prepare_evaluation would install for this point.
WorkingRequestCore & operator=(const WorkingRequestCore &)=delete
Preparation< PreparedMutation > prepare_owner_applied(const EventId &applied, const RequestHandle &child, const std::optional< OpeningObservation > &observation, uint64_t &next_timeline_ordinal, const ArmContext &arm={})
arm carries the materialization facts of an anchored leg (the price tick a rounded anchor snaps to,...
InstalledCommand< SubmitResult > install_submit(PreparedSubmit &&prepared) noexcept
PreparedSubmit prepare_submit(const Request &request, const CommandContext &context, uint64_t &next_order_incarnation, uint64_t &next_timeline_ordinal, RequestOrigin origin=RequestOrigin::Host)
Consumer-only typed prepare/install.
std::variant< Flatten, order_action::Reduce, order_action::Transact > Action
std::variant< AllowanceUnset, AllowanceUnits, AllowanceAllScope, AllowanceDeferred > Allowance
NativeArmScope
What an armed CLOSING request (Reduce, Flatten, a HostSized close) closes.
std::variant< T, NoChange, PreparationError > Preparation
bool operator==(CohortHandle left, CohortHandle right) noexcept
MatchRejectReason
Why a CANDIDATE was refused — a decision taken at a matching point, with the request still live unles...
@ RiskLimit
An opening refused while the run spec's generic risk limits are blocking (L9).
std::variant< ImmediateRemaining, PointBudget > Capacity
ExecutionPlan to_execution_plan(const execution::Action &action)
NativeArmFirstMatch
When an armed request may first match.
RequestOrigin
Who authored a request.
std::variant< CommandInstalled< R >, InstallError > InstalledCommand
RiskLimitKind
Which generic risk limit of NativeRunSpec::risk a NativeRiskEvent reports.
std::variant< Market, Limit, Stop, StopLimit, Trail > Trigger
CancelReason
Why a request left the book.
@ Superseded
A kernel-originated request the kernel itself withdrew: the liquidation level or its units moved,...
ScopeBasis
Which measurement of the bound scope the fraction is taken of.
bool quantity_on_grid(double q, double step) noexcept
v2 exact binary64 grid: r=abs(q)/s, n=round(r) half away from zero, g=n*s.
std::variant< Absolute, FromOwnerFill > TriggerAnchor
std::variant< Installed, InstallError > InstallResult
@ ConfirmedAfterCalculationClose
NativeCandidatePriceKind
Which price a candidate is being offered at: the point's own price, or the request's trigger level (a...
std::variant< NoGroup, Member > Group
execution::Flatten Flatten
std::variant< ExplicitUnits, OwnerOpenedUnits, ScopeFraction > ReductionSize
How much a Reduce takes: literal units, the owner's own opening, or a fraction of the bound scope.
std::variant< BookTransaction, Wait, ArmedTransaction, UnboundBookClose, BookClose, OpeningClose, OpeningsClose, CohortClose > Authority
std::variant< EnrollmentFromCommand, EnrollmentFromApplied > Enrollment
SizePrice
WHICH price the basis is converted at.
std::uint8_t display_waypoint(const MatchCursor &cursor) noexcept
std::variant< AcceptedEvent, RejectedEvent, ReplacedEvent, ReplaceRejectedEvent, CancelledEvent, NotWorkingEvent, InvalidHandleEvent, NoEffectEvent, MatchRejectedEvent, ExecutionAppliedEvent, CloseBoundEvent, ActivatedEvent, ReservationReducedEvent, DeferredGroupAdjustmentEvent, QuantityBoundEvent, ArmedEvent, TermsResolvedEvent, MarginCallEvent, NativeRiskEvent > CommandEvent
Every alternative of one request's history, as one value.
std::variant< MarketReady, LimitReady, StopIdle, StopActive, StopLimitPending, StopLimitLive, TrailWaitArm, TrailTrack, TrailActive > TriggerState
std::variant< CashValue, EquityFraction > SizeBasis
The two bases a Sized intent may name.
ExecutionGridPolicy
Resolved host sizing normally remains subject to the run's quantity grid.
std::variant< RemainingUnbound, RemainingFlattenAll, RemainingUnits, RemainingDeferred, NoTarget > Remaining
std::variant< Independent, WaitForApplied, BindOpening, BindOpenings, BindCohort > Owner
OrderIntent intent_from_physical(const execution::Action &action)
bool operator<(CohortHandle left, CohortHandle right) noexcept
std::variant< execution::Flatten, order_action::Reduce, order_action::Transact, execution::ReverseTo > ExecutionPlan
The settlement shape one execution takes.
Request market_request(execution::Action action, std::string label={}, std::string comment={})
std::shared_ptr< const RequestDefinition > DefinitionRef
NativeArmVisibility
Whether an owner-related request that arms is a working order before its arm.
std::variant< PositionFlat, PositionNonflat > PositionIdentity
std::variant< RemainingProjectionUnbound, RemainingProjectionFlattenAll, RemainingProjectionUnits, RemainingProjectionDeferred, RemainingProjectionNoTarget > RemainingProjection
bool has_market_defaults(const Request &request) noexcept
ScopeClaim
Gross claims the whole bound scope; NetOfSiblings first subtracts the units already claimed by the li...
order_action::Transact Transact
A signed book transaction: finite nonzero units on the side their sign names.
std::variant< PendingNone, PendingDeferred > PendingAdjustments
std::function< std::optional< double >( const LiveRequest &leg, const ExecutionAppliedEvent &owner_fill, Side leg_side, double offset, double kernel_level)> AnchoredLevelResolver
The one policy point of an anchored materialization.
std::variant< Flatten, Reduce, Transact, ReverseTo, HostSized, Sized > OrderIntent
What a request does.
SizeTime
AtMatch resolves the basis at the matching candidate; AtAcceptance freezes the resolved units when th...
NativeAnchorRounding
How a materialized anchored level is snapped onto the run's price tick ladder (NativeRunSpec::price_t...
bool point_eligible(const LiveRequest &live, uint64_t point_ordinal, int64_t effective_time_ms) noexcept
Whether a request may be considered at this driver point: the point's ordinal must be strictly past t...
std::variant< BeginTrailTracking, ObserveTrailExtremum, ActivateStop, ActivateStopLimit, ActivateTrail > TriggerTransition
std::variant< execution::Book, execution::OpeningExposure, SelectedExposure > ExecutionScope
What one execution acted on: the whole book, one opening's exposure, or a bound selection.
bool operator!=(CohortHandle left, CohortHandle right) noexcept
@ NonrepresentableQuantity
@ UnrepresentableReservation
RequestRejectReason
Why an acceptance was refused, on a Rejected SubmitResult.
@ PlacementAdmission
A Sized{SizeTime::AtAcceptance} whose acceptance-resolved quantity does not pass the run's opening ad...
Everything the kernel knows about WHERE a point is, as one owning value: its event ordinal,...
Where a request's trigger level comes from.
One request was accepted: the definition, and the timeline ordinal it was accepted at.
const Request & request() const noexcept
const Birth & birth() const noexcept
const RequestHandle & handle() const noexcept
What the consumer hands to prepare_trigger under an opted-in price grid (NativeRunSpec::price_grid ==...
What the consumer hands to prepare_owner_applied for an anchored leg's materialization,...
std::optional< double > price_tick
AnchoredLevelResolver resolve_level
An anchored leg was materialized, exactly once: fill + offset, then the rounding, then resolve_anchor...
std::optional< EventId > quantity_resolution
Bind to a host-built roster (cohort_open / cohort_add / cohort_remove), read at the match rather than...
Bind to ONE already-live opening, by its handle and the positive cycle it is live in.
Bind to a fixed cohort of already-live openings.
std::vector< RequestHandle > openings
The authority an armed leg acquires under NativeArmScope::Book: the whole position its owner's fill l...
MatchCursor binding_cursor
Authority prior_authority
const Request & request() const noexcept
RemainingProjection unexecuted
std::optional< EventId > cause
PendingAdjustments pending
const RequestHandle & handle() const noexcept
Native sizing bases (L3).
A host-maintained, run-scoped roster identity.
CohortReceiptStatus status
CohortReceiptOperation operation
std::vector< RequestHandle > origins
Canonical origin handles, ordered by origin incarnation rather than by host insertion order.
What acceptance needs from the run to judge a command: the point's ordinal and coordinate,...
std::optional< OpeningObservation > opening
std::vector< OpeningObservation > openings
std::optional< double > sizing_scope
Placement-time sizing measurements the execution consumer owns, supplied only for the intent that ask...
std::optional< double > sizing_units
Kernel-resolved acceptance-time units for a Sized{AtAcceptance} request.
std::optional< double > sizing_price
std::optional< double > price_tick
The run's price tick, needed only to resolve a tick-spelled trail offset or trigger anchor.
std::optional< double > quantity_grid
ExecutionPlan committed_action
TargetObservation post_target
PendingAdjustments pending_before
std::optional< EventId > previous_pending_receipt
PendingDeferred pending_after
const Allowance * allowance
const Remaining * remaining
const TriggerState * trigger_state
const Authority * authority
A fraction in (0, 1] of MARKED equity at the sizing point.
DriverEligibilityClass driver_class
bool pre_open_birth_eligible
Generic current-point delivery.
std::optional< Side > cohort_side
Set only while resolving a CohortClose candidate.
bool existing_matching_bit
One committed execution: the definition, the cursor, the resolved price and units,...
const RequestHandle & handle() const noexcept
RemainingProjection remaining_after
std::optional< AppliedTerminalReason > terminal_reason
std::size_t closed_trade_count
const Birth & birth() const noexcept
RemainingProjection remaining_before
uint64_t opened_lot_incarnation
int64_t interval_last_traded_close_ms() const noexcept
const Request & request() const noexcept
int64_t effective_time_ms() const noexcept
int interval_index() const noexcept
Allowance allowance_after
Allowance allowance_before
int64_t interval_open_ms() const noexcept
std::uint8_t provenance() const noexcept
std::size_t first_trade_index
double inspected_opened_units
TargetObservation pre_target
ExecutionPlan physical_action
bool pre_open_birth_eligible
Carries the generic pre-open delivery authorization from the matching evaluation through the synchron...
PositionIdentity pre_fill
double inspected_closed_units
double inspected_current_ticket
std::optional< double > units
ExecutionGridPolicy grid_policy
A reduction of exactly these units, finite and positive.
Defer a level to the owner's fill: at the arm the level becomes fill + offset, with offset signed (ad...
NativeAnchorRounding rounding
An opening or a closing whose quantity the HOST resolves, in NativeStrategyHost::resolve_execution_te...
std::optional< Side > side
Take whatever the point allows, with no per-point cap.
No owner: the request stands on its own book authority.
std::optional< Request > attempted
fill_through makes the limit a touch trigger (market-if-touched): the level still gates when the requ...
PendingAdjustments pending
const RequestHandle & handle() const noexcept
const Birth & birth() const noexcept
const Request & request() const noexcept
const std::optional< RequestHandle > & predecessor() const noexcept
TriggerState trigger_state
std::optional< double > sizing_scope
std::optional< double > sizing_units
Placement-time sizing measurements frozen from the accepting command context.
std::optional< double > sizing_price
A kernel-issued liquidation that actually filled.
const Request & request() const noexcept
const RequestHandle & handle() const noexcept
Match at the next eligible matching point, with no level to reach.
A candidate the run refused, with its MatchRejectReason and the cursor it was refused at.
const Request & request() const noexcept
RemainingProjection remaining
const Birth & birth() const noexcept
std::optional< ExecutionTerms > attempted_terms
const RequestHandle & handle() const noexcept
One generic risk limit breaching (L9).
A reduction or a flatten that had nothing to close: terminal, with no execution identity,...
const Request & request() const noexcept
RemainingProjection remaining
const Birth & birth() const noexcept
const RequestHandle & handle() const noexcept
A dynamic cohort has no currently live member.
std::optional< Request > attempted
bool has_live_matching_lot
RequestHandle queried_opening
PositionIdentity current_position
std::vector< RequestHandle > openings
A reduction of exactly what the owner's fill opened, bound at the arm and reported by a QuantityBound...
Cap what this request may execute at ONE matching point at units.
A working-request preparation that could not produce a representable instruction — a nonrepresentable...
A Reduce{OwnerOpenedUnits} was bound, at its owner's fill, to what that fill opened.
double effective_deduction
RemainingProjection remaining
std::vector< EventId > prior_adjustment_ids
RequestRejectReason reason
A resolved remaining quantity, in units.
Replacement behaviour that is not expressible in the successor request.
bool retain_trigger_state
RequestRejectReason reason
const RequestHandle & target() const noexcept
DefinitionRef live_definition
const Request & live_request() const noexcept
std::optional< RequestRejectReason > reason
std::optional< RequestHandle > successor
const Request & predecessor_request() const noexcept
const Birth & successor_birth() const noexcept
DefinitionRef successor_definition
const RequestHandle & successor() const noexcept
DefinitionRef predecessor_definition
const RequestHandle & predecessor() const noexcept
const Request & successor_request() const noexcept
The immutable accepted form of one request: its handle, the request value as accepted,...
RequestOrigin origin
Appended last so every existing aggregate initializer keeps its meaning.
std::optional< RequestHandle > predecessor
Aggregate field order keeps market construction: Request{Transact{1.0}, "buy", "comment"}...
RemainingProjection after
Exact target exposure for an explicit reversal request.
A fraction in (0, 1] of the bound scope, resolved at the matching candidate.
ScopeBasis basis
Appended last so every existing aggregate initializer keeps its meaning.
Native authorization receipt, converted to a call-local financial SelectedOpeningSet only at the cons...
std::vector< uint64_t > incarnations
SizePrice price
Which price the basis converts at; see SizePrice.
bool reserve_percent_fee
Divide the sizing cash by (1 + fee) when the run's fee kind is NativeFeeKind::Percent.
ExecutionGridPolicy grid_policy
SnapToGrid floors the resolved units onto the run's quantity grid.
A stop that, once reached, becomes a limit at limit.
A stop trigger: the modeled path has to reach price from the adverse side.
std::optional< RequestRejectReason > reason
std::optional< RequestHandle > handle
PositionIdentity current_position
std::vector< OpeningObservation > openings
std::optional< OpeningObservation > opening
const Request & request() const noexcept
RemainingProjection remaining_before
std::vector< EventId > prior_adjustment_ids
double effective_deduction
Allowance allowance_after
const Birth & birth() const noexcept
RemainingProjection remaining_after
const RequestHandle & handle() const noexcept
Trail offset spelled in price ticks instead of a price distance.
offset is a price distance: the stop rides offset behind the running best.
std::optional< double > arm_price
std::optional< TrailTicks > ticks
The one owner relation that arms (the ArmedEvent).
NativeArmVisibility visibility
NativeArmFirstMatch first_match
The authority an unarmed WaitForApplied child holds: accepted and live, but never a matching candidat...
std::size_t operator()(pineforge::native_order::CohortHandle value) const noexcept