1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// -------------------------------------------------------------------------------------------------
// Copyright (C) 2015-2026 Nautech Systems Pty Ltd. All rights reserved.
// https://nautechsystems.io
//
// Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -------------------------------------------------------------------------------------------------
//! Position types the [`ExecutionEngine`](super::ExecutionEngine) publishes or carries between
//! the stages of a fill correction.
use Rc;
use CacheSnapshotRef;
use UnixNanos;
use ;
/// Position state snapshot published to the `snapshots.position.{position_id}` topic.
/// Callback that anchors cache snapshot metadata in an external store.
pub type SnapshotAnchorer = ;
/// A position rebuilt by a fill void, with the quantity that correction removed.
///
/// `absorbed_prior_cycles` is set when the voided fill sits outside the position's current
/// NETTING cycle, so the rebuild spans earlier cycles and the archive frames describing them no
/// longer match the corrected history. `closed_cycles_pnl` then holds the realized PnL of
/// whatever cycles the corrected history does close before the current one, which settles those
/// frames. It is `None` when the corrected history never goes flat, leaving no archived cycle.
///
/// Known limitation: the flag is decided from quantities, so a second correction to the same
/// trade that revises only the voided commission leaves it unset, and the settled frame keeps
/// the realized PnL banked by the first. No in-tree emitter produces that shape, since
/// reconciliation always advances the quantity and the adapters void a fill once.
pub