← Overview Step 2 of 6 — Account Reconciliation
Tribulnation Portfolio/Litmus Briefing

Merging duplicate observations within one account

Within one account, a trade fill and its fee often arrive as separate observations. Reconciliation determines when two observations describe the same event.

Input
Observation[] per source.
Goal
Deduplicate observations into canonical events.
Output
Tree of grouped observations.

For example, Binance exports include these two files:

binance-trade-history.csv
rowtypebasequotesizepricefee
1spot_tradeBTCUSDT0.01100000−1 USDT
2spot_tradeETHUSDT0.002500000−0.5 USDT
binance-statement.csv
rowtypeassetamount
1trade_legBTC+0.01
2trade_legETH+0.002
3feeUSDT−1
4trade_legUSDT−1000
5trade_legUSDT−1000
6feeUSDT−0.5
Reconciliation
SpotNode 1 (BTC)
├─ trade: row 1 (history)
├─ base:  row 1 (statement)
├─ quote: row 5 (statement)
└─ fee:   row 3 (statement)
SpotNode 2 (ETH)
├─ trade: row 2 (history)
├─ base:  row 2 (statement)
├─ quote: row 4 (statement)
└─ fee:   row 6 (statement)

Click a table, the arrow, or a result for details.

← Ingestion