India postings — worked examples
Every posting rule wired on the India book, with concrete debit/credit
examples. All amounts USD (the India entity is USD-only). (cust-x) means
"scoped to that customer".
1. Cash flows
wire_in — USD $10,000 wire to ViewTrade
DR 1100 Omnibus Cash @ ViewTrade $10,000 (cust-x)
CR 2010 Customer Cash Wallet USD $10,000 (cust-x)
The deposit is posted once — on the ViewTrade side. GlomoPay's paid
event contributes only the FX-spread accrual (§ 8) and the compliance audit
row on lrs_remittances — never the deposit cash.
wire_out — USD $5,000 withdrawal
DR 2010 Customer Cash Wallet USD $5,000 (cust-x)
CR 1100 Omnibus Cash @ ViewTrade $5,000 (cust-x)
opening_balance — historical seed for an existing customer
Same shape as wire_in, used when a customer arrives with a pre-existing
USD balance:
DR 1100 Omnibus Cash @ ViewTrade $25,000 (cust-x)
CR 2010 Customer Cash Wallet USD $25,000 (cust-x)
2. Write-path cash lifecycle (two-step)
Optional. Wallet reflects a pending balance immediately; the omnibus updates on broker confirmation. On failure, only the in-transit leg is reversed.
deposit_in_transit — $10,000 pending
DR 1500 Cash in Transit (LRS) $10,000 (cust-x)
CR 2010 Customer Cash Wallet USD $10,000 (cust-x)
deposit_settle — same $10,000 confirmed at ViewTrade
DR 1100 Omnibus Cash @ ViewTrade $10,000 (cust-x)
CR 1500 Cash in Transit (LRS) $10,000 (cust-x)
Net of the two = one wire_in.
withdrawal_in_transit — $5,000 pending
DR 2010 Customer Cash Wallet USD $5,000 (cust-x)
CR 1500 Cash in Transit (LRS) $5,000 (cust-x)
withdrawal_settle — same $5,000 confirmed
DR 1500 Cash in Transit (LRS) $5,000 (cust-x)
CR 1100 Omnibus Cash @ ViewTrade $5,000 (cust-x)
3. Security trades
buy_security — 10 AAPL, all-in $1002.20 (bundled 22-bps brokerage)
Ingest posts placeholder legs; the recost job replaces the revenue leg with the 22 / 4 / 18 bps split (§ 4).
DR 1200 Omnibus Custody @ ViewTrade $1000.00 (cust-x) # principal
DR 2010 Customer Cash Wallet USD $2.20 (cust-x) # placeholder brokerage
CR 2100 Customer Sec Liab Equity $1000.00 (cust-x)
CR 2010 Customer Cash Wallet USD $1002.20 (cust-x) # all-in charge
CR 4000 Brokerage Revenue $2.20 (cust-x) # placeholder
sell_security — 10 AAPL @ $110 (mirror of buy)
CR 1200 Omnibus Custody @ ViewTrade $1000.00 (cust-x)
DR 2010 Customer Cash Wallet USD $1100.00 (cust-x) # all-in proceeds
DR 2100 Customer Sec Liab Equity $1000.00 (cust-x)
CR 2010 Customer Cash Wallet USD $2.42 (cust-x) # placeholder brokerage
DR 1100 Omnibus Cash @ ViewTrade $1100.00 (cust-x)
DR 4000 Brokerage Revenue $2.42 (cust-x) # placeholder
Realized gain ($100 in this example) lives in the customer's cash wallet. The Capital Gains sub-ledger computes STCG/LTCG on top of these postings — no new GL lines.
custody_adjustment — India-only true-up to ViewTrade holdings
When the share-count reconciliation surfaces drift (e.g. ledger has 1.00
shares of CELH but ViewTrade holds 0.93), a custody_adjustment corrects
the ledger to match reality — same 4-leg shape as a trade, so the book
stays balanced, but capital-gains ignores it (this isn't a real disposal).
Reduce over-booked holding (mirror of a sell):
CR 1200 Omnibus Custody @ ViewTrade $6.50 (cust-x) # 0.07 CELH at cost
DR 2010 Customer Cash Wallet USD $6.50 (cust-x)
DR 2100 Customer Sec Liab Equity $6.50 (cust-x)
DR 1100 Omnibus Cash @ ViewTrade $6.50 (cust-x)
Increase under-booked holding (mirror of a buy):
DR 1200 Omnibus Custody @ ViewTrade $x (cust-x)
CR 2010 Customer Cash Wallet USD $x (cust-x)
CR 2100 Customer Sec Liab Equity $x (cust-x)
CR 1100 Omnibus Cash @ ViewTrade $x (cust-x)
4. Recost (splits the placeholder revenue)
Every trade/brokerage/custody-fee posting leaves a placeholder revenue leg that the recost replaces with the actual broker/Valura split.
ViewTrade recost — the $2.20 placeholder above
(remove placeholder CR 4000 $2.20)
DR 5000 Brokerage Cost $0.40 (cust-x) # ViewTrade's 4 bps
CR 2340 ViewTrade Payable $0.40 (cust-x)
DR 5099 Valura Earnings Share $1.80 (cust-x) # 18-bps residual
CR 2330 Valura Payable $1.80 (cust-x)
Cross-check on this drift lives in the Broker-fee recon — modelled cost vs configured expected vs actual from the ViewTrade Daily Ledger.
5. Standalone fees (each with a placeholder recost path)
brokerage — standalone (rare on India; usually bundled into trades)
DR 2010 Customer Wallet USD $2.20 (cust-x)
DR 5000 Brokerage Cost $2.20 (cust-x) # placeholder
CR 4000 Brokerage Revenue $2.20 (cust-x) # placeholder
CR 1100 Omnibus Cash @ ViewTrade $2.20 (cust-x) # placeholder offset
Then recost splits into 2340 + 2330 (§ 4).
trade_fees — same 4-leg shape as brokerage (alternate label)
Same posting.
custody_fee — recurring custody fee (currently dormant)
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
taf_sec_fee — $0.02 US SEC / TAF fee on a trade
DR 2010 Customer Cash Wallet USD $0.02 (cust-x)
CR 2220 Regulatory Fee Payable $0.02 (cust-x)
wht_tax — $2.50 NRA withholding on a $10 US dividend (DTAA-claimable)
DR 2010 Customer Cash Wallet USD $2.50 (cust-x)
CR 2200 Withholding Tax Payable $2.50 (cust-x)
2200 is claimable by the customer as a DTAA foreign-tax-credit on their
Indian ITR (Schedule TR). Every event is also recorded in the
dividend_events sub-ledger.
vat_tax — not used on India
India uses TCS collected by the AD bank on the LRS quote (see LRS + TCS), not VAT. The posting rule exists but no India event type maps to it.
7. Income events
dividend — $10 gross US-equity dividend
DR 1100 Omnibus Cash @ ViewTrade $10.00 (cust-x)
CR 2010 Customer Cash Wallet USD $10.00 (cust-x)
Ingested from the ViewTrade Daily Ledger's DIV row. The paired DIVNRA row
fires a separate wht_tax posting (§ 6). Net effect on the customer =
+$7.50.
coupon — bond coupon (dormant on India for now)
Same shape as dividend if it ever fires:
DR 1100 Omnibus Cash @ ViewTrade $100.00 (cust-x)
CR 2010 Customer Cash Wallet USD $100.00 (cust-x)
interest — upstream-blocked (no event source from ViewTrade)
The posting rule exists but the ledger has no upstream feed for interest
events on the India book yet. Same 2-leg shape as dividend when wired.
corp_action — bidirectional (follows broker DR/CR)
Credit direction (money in — e.g. a spinoff cash distribution):
DR 1100 Omnibus Cash @ ViewTrade $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 @ ViewTrade $50.00 (cust-x)
8. India-specific FX-spread lifecycle
Valura's INR→USD margin. Accrues on GlomoPay paid, clears when the
merchant batch settles. Dormant when GLOMOPAY_FX_SPREAD_BPS = 0.
fx_spread — accrue $50 on a $10,000 remittance @ 50 bps
DR 1300 GlomoPay FX Receivable $50.00 (cust-x)
CR 4030 FX Spread Revenue $50.00 (cust-x)
No cash impact — the ViewTrade wire_in already booked the $10,000
deposit. This entry just recognises Valura's margin on the conversion.
fx_spread_settle — clear the receivable when the merchant batch pays out
DR 1010 Bank Operating - USD $50.00 (cust-x)
CR 1300 GlomoPay FX Receivable $50.00 (cust-x)
Net of the accrual + settle = revenue earned and cash collected, receivable cleared.
9. fx_in / fx_out — not used on India
Same posting rules as UAE, but the India book is USD-only. Present in the dispatcher for API symmetry; no India event type maps to them.
10. 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 @ ViewTrade $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 @ ViewTrade $x (cust-x)
Also available:
- Manual reversal —
POST /v1/transactions/{id}/reversemirrors the ACTUAL posted lines of a specific transaction, correct even for recosted fees. - Refund-reversal sweep — job that walks cancelled/failed/expired GlomoPay orders and reverses their FX-spread accrual (and settle leg if any). See Refund / cancellation reversal.
The invariant
Across every customer, every transaction, every account: debits equal credits, in USD, always. Under Valura's omnibus custody model, the tax-side reports (capital gains, dividends, Schedule FA) are reporting layers on top of these balanced postings — they never introduce new debits or credits that could break the invariant.