Skip to main content

India postings — worked examples

Concrete debit/credit for each India txn_type. All amounts USD.

Wire in — USD $10,000 deposit at 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 — from the ViewTrade side. GlomoPay contributes only the FX-spread and the audit row on lrs_remittances.

GlomoPay LRS remittance — FX-spread accrual (when bps > 0)

If GLOMOPAY_FX_SPREAD_BPS = 50 and the customer remits $10,000:

DR 1300 GlomoPay FX Receivable     $50.00    (cust-x)
CR 4030 FX Spread Revenue $50.00 (cust-x)

Idempotent on the GlomoPay order_id. No cash impact — the ViewTrade wire_in already booked the $10,000 deposit.

GlomoPay settlement batch — FX-spread clearing

DR 1010 Bank Operating - USD       $50.00    (cust-x)
CR 1300 GlomoPay FX Receivable $50.00 (cust-x)

Idempotent on {order_id}:fxsettle. Together with the accrual, this moves the earned margin from the receivable to actual bank cash.

Buy security — 10 AAPL @ execPx=$100.22 (bundled brokerage)

The 22 bps customer charge is baked into the price. Ingest posts placeholder:

DR 1200 Omnibus Custody @ ViewTrade      $1000.00  (cust-x)
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)
CR 4000 Brokerage Revenue $2.20 (cust-x) # placeholder

Recost splits the customer charge:

(delete CR 4000)
DR 5000 Brokerage Cost $0.40 (cust-x) # ViewTrade cost (4 bps)
CR 2340 ViewTrade Payable $0.40 (cust-x)
DR 5099 Valura Earnings Share $1.80 (cust-x) # residual (18 bps)
CR 2330 Valura Payable $1.80 (cust-x)

Net: customer wallet -$1002.20 all-in, custody +$1000, sec liab +$1000, ViewTrade payable +$0.40, Valura payable +$1.80.

Sell security

Similar shape, opposite direction. See Capital gains for the sub-ledger that computes STCG/LTCG from the buy/sell pair.

Dividend — $10 gross with 25% NRA WHT

From the ViewTrade Daily Ledger DIV row:

DR 1100 Omnibus Cash @ ViewTrade   $10.00    (cust-x)
CR 2010 Customer Cash Wallet USD $10.00 (cust-x)

From the paired DIVNRA row:

DR 2010 Customer Cash Wallet USD   $2.50     (cust-x)
CR 2200 Withholding Tax Payable $2.50 (cust-x) # DTAA-claimable

Also upserts a dividend_events sub-ledger row (div_txn_no, symbol, pay_date, gross, wht, net, per_share, wht_rate_pct, tax_code, fy).

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)

Reversal (refund / cancellation)

If a GlomoPay order flips cancelled after Valura posted the FX-spread accrual:

POST /v1/jobs/refund-reversal-india

Posts a reversing entry for both the accrual and (if present) the settle leg. Idempotent — re-runs post nothing new.

Trial balance invariant

Same as UAE. Every posting rule returns lines where ΣDR = ΣCR. The Category-A check enforces it.