UAE postings — worked examples
Every posting rule wired on the UAE book, with concrete debit/credit examples.
Notation: DR = debit, CR = credit. All amounts USD-normalized. (cust-x)
means "this line is scoped to that customer".
1. Cash flows
wire_in — USD $10,000 deposit at GTN
DR 1100 Omnibus Cash @ GTN $10,000 (cust-x)
CR 2010 Customer Cash Wallet USD $10,000 (cust-x)
wire_in — AED 36,725 deposit at ZAG (USD-equivalent $10,000 at the peg)
DR 1115 Omnibus Cash @ ZAG (AED) $10,000 (cust-x)
CR 2000 Customer Cash Wallet AED $10,000 (cust-x)
Native amount on the transaction is 36,725 AED; USD-normalized is 10,000.
wire_out — USD $5,000 withdrawal
DR 2010 Customer Cash Wallet USD $5,000 (cust-x)
CR 1100 Omnibus Cash @ GTN $5,000 (cust-x)
opening_balance — historical seed for an existing customer
Same journal shape as wire_in, used when a customer arrives with an
existing balance from a prior system:
DR 1100 Omnibus Cash @ GTN $25,000 (cust-x)
CR 2010 Customer Cash Wallet USD $25,000 (cust-x)
2. Write-path cash lifecycle (two-step)
Optional lifecycle. The wallet reflects a pending balance immediately; the omnibus updates on broker confirmation. On failure, only the in-transit leg is reversed (no phantom omnibus movement).
deposit_in_transit — $10,000 pending deposit
DR 1500 Cash in Transit $10,000 (cust-x)
CR 2010 Customer Cash Wallet USD $10,000 (cust-x)
deposit_settle — same $10,000 confirmed at GTN
DR 1100 Omnibus Cash @ GTN $10,000 (cust-x)
CR 1500 Cash in Transit $10,000 (cust-x)
Net of the two = one wire_in.
withdrawal_in_transit — $5,000 pending withdrawal
DR 2010 Customer Cash Wallet USD $5,000 (cust-x)
CR 1500 Cash in Transit $5,000 (cust-x)
withdrawal_settle — same $5,000 confirmed at GTN
DR 1500 Cash in Transit $5,000 (cust-x)
CR 1100 Omnibus Cash @ GTN $5,000 (cust-x)
3. Security trades
buy_security — 10 AAPL @ $100.05 (bundled brokerage, 4-leg)
Ingest posts placeholder legs; the recost job replaces the revenue leg with the real broker / Valura split (Section 4).
DR 1200 Omnibus Custody @ GTN $1000.00 (cust-x) # principal
DR 2010 Customer Wallet USD $0.50 (cust-x) # placeholder brokerage
CR 2100 Customer Sec Liab Equity $1000.00 (cust-x)
CR 2010 Customer Wallet USD $1000.50 (cust-x) # all-in charge
CR 4000 Brokerage Revenue $0.50 (cust-x) # placeholder
Net effect: customer wallet down $1000.50, custody up $1000, security liability up $1000, revenue accrued (pending recost).
sell_security — 10 AAPL @ $110 (mirror of buy)
CR 1200 Omnibus Custody @ GTN $1000.00 (cust-x)
DR 2010 Customer Wallet USD $1100.00 (cust-x) # all-in proceeds
DR 2100 Customer Sec Liab Equity $1000.00 (cust-x)
CR 2010 Customer Wallet USD $0.55 (cust-x) # placeholder brokerage
DR 1100 Omnibus Cash @ GTN $1100.00 (cust-x)
DR 4000 Brokerage Revenue $0.55 (cust-x) # placeholder
The customer's realized gain on the sale ($100 in this example) lives in their cash wallet (2010), reflected as the delta between proceeds and cost basis.
4. Recost (splits the placeholder revenue)
Runs after ingest. Replaces the placeholder revenue leg with the real broker cost + Valura residual.
GTN recost — the $0.50 placeholder above
(remove placeholder CR 4000 $0.50)
DR 5000 Brokerage Cost $0.40 (cust-x) # GTN's cost
CR 2310 GTN Payable $0.40 (cust-x)
DR 5099 Valura Earnings Share $0.10 (cust-x) # residual
CR 2330 Valura Payable $0.10 (cust-x)
ZAG / Aldar recost — for a standalone brokerage of $2.00
Aldar itemizes brokerage as its own line; ingest posts a placeholder, then recost splits it 3 ways (Aldar cost + Aldar revenue share + Valura residual):
(remove placeholder CR 4000 $2.00)
DR 5000 Brokerage Cost $1.00 (cust-x) # Aldar's cost
CR 2320 Aldar Payable $1.00 (cust-x)
DR 5090 Aldar Brokerage Share $1.00 (cust-x)
DR 5099 Valura Earnings Share $1.00 (cust-x)
CR 2330 Valura Payable $1.00 (cust-x)
5. Standalone fees (each has a placeholder recost path)
brokerage — standalone (from ZAG, itemized)
DR 2010 Customer Wallet USD $2.00 (cust-x) # customer charge
DR 5000 Brokerage Cost $2.00 (cust-x) # placeholder cost
CR 4000 Brokerage Revenue $2.00 (cust-x) # placeholder revenue
CR 1100 Omnibus Cash @ GTN $2.00 (cust-x) # placeholder offset
Then recost splits the placeholder pair.
trade_fees — same 4-leg shape as brokerage (Aldar labels some fees as trade_fees)
Same posting as brokerage.
custody_fee — $10 monthly custody fee
DR 2010 Customer Wallet USD $10.00 (cust-x)
DR 5030 Custody Cost $10.00 (cust-x) # placeholder
CR 4020 Custody Fee Revenue $10.00 (cust-x) # placeholder
CR 1100 Omnibus Cash $10.00 (cust-x) # placeholder offset
6. Pass-through taxes & fees (no recost — the whole amount is owed downstream)
vat_tax — $1.00 UAE VAT on a fee
DR 2010 Customer Wallet USD $1.00 (cust-x)
CR 2210 VAT Payable $1.00 (cust-x)
taf_sec_fee — $0.02 US regulatory fee on a trade
DR 2010 Customer Wallet USD $0.02 (cust-x)
CR 2220 Regulatory Fee Payable $0.02 (cust-x)
wht_tax — $2.50 withheld on a $10 dividend
DR 2010 Customer Wallet USD $2.50 (cust-x)
CR 2200 Withholding Tax Payable $2.50 (cust-x)
7. Income events (all follow the "gross to customer" pattern)
dividend — $10 gross US-equity dividend
DR 1100 Omnibus Cash @ GTN $10.00 (cust-x)
CR 2010 Customer Cash Wallet USD $10.00 (cust-x)
A paired wht_tax posts the withholding (Section 6). Net wallet effect =
$7.50.
coupon — bond coupon received
DR 1100 Omnibus Cash @ GTN $100.00 (cust-x)
CR 2010 Customer Cash Wallet USD $100.00 (cust-x)
Same shape as dividend, different transaction type for reporting.
interest — cash / margin interest
DR 1100 Omnibus Cash @ GTN $5.00 (cust-x)
CR 2010 Customer Cash Wallet USD $5.00 (cust-x)
corp_action — generic broker corporate action (direction from DR/CR)
Credit direction (money in, e.g. a spinoff cash distribution):
DR 1100 Omnibus Cash @ GTN $50.00 (cust-x)
CR 2010 Customer Cash Wallet USD $50.00 (cust-x)
Debit direction (money out, e.g. a fee assessment):
DR 2010 Customer Cash Wallet USD $50.00 (cust-x)
CR 1100 Omnibus Cash @ GTN $50.00 (cust-x)
8. FX movements (cross-currency, UAE has AED + USD)
fx_in — AED wallet credited from a USD source
Same shape as wire_in, tagged as an FX event for reporting.
DR 1000 Bank Operating - AED $10,000 (cust-x)
CR 2000 Customer Cash Wallet AED $10,000 (cust-x)
fx_out — AED wallet debited to fund a USD purchase
DR 2000 Customer Cash Wallet AED $10,000 (cust-x)
CR 1000 Bank Operating - AED $10,000 (cust-x)
9. Reversal (direction from DR/CR)
Broker correction — mirrors the original event to unwind it.
Credit direction (cash returned to the customer):
DR 1100 Omnibus Cash $x (cust-x)
CR 2010 Customer Cash Wallet USD $x (cust-x)
Debit direction (cash taken back):
DR 2010 Customer Cash Wallet USD $x (cust-x)
CR 1100 Omnibus Cash $x (cust-x)
Plus a manual reversal path (POST /v1/transactions/{id}/reverse) that
mirrors the ACTUAL posted lines of a specific transaction — handles the
recosted lines correctly.
The invariant
Across every customer, every transaction, every account: debits equal credits, in USD, always. The trial-balance check enforces it every hour.