Skip to content

Integration DAG: EOD & settlement

Why this page is structured this way: EOD is two phases stitched together — the broker-side reconciliation/reporting (15:40–19:00) and the settlement-side actions (19:00 through next-morning payin). Two DAGs cover each block. Settlement has the most external dependencies (clearing corp, depository, banks); EOD has the most internal dependencies (back-office → contract notes → ledger).

  • 2 ASCII DAGs covering EOD reconciliation block and overnight settlement block.
  • 32 unique integration nodes; the most-dependent phase.
  • T+1 payin obligation is the single hardest cutoff: failure to honour by 11:00 next morning triggers default-fund draw and broker suspension procedure.
  • Daily client-funds upstreaming (Jun 2023 SEBI mandate) runs overnight; broker can’t carry client funds on balance sheet beyond cutoff.

By 15:40 the day’s trading is done, but ~14 hours of work remain: reconcile every trade, compute every charge, generate every contract note, send every file to the clearing corp, receive every obligation file back, fund the payin obligation, accept the payout, upstream the funds, reconcile every bank account, push KRA / CKYC modifications, run the ledger batch. By 06:00 the next morning, BOD scripts fire again. The orchestrator’s job is to keep this 14-hour graph executing reliably; the same orchestrator that managed millisecond-scale pre-trade pipelines now manages multi-minute batch jobs.

DAG 1 — EOD reconciliation (15:40–19:00)

Section titled “DAG 1 — EOD reconciliation (15:40–19:00)”
EOD-START (15:40 IST, closing-window completed)
├──► EOD-TB-CM (trade booking from exchange CM trade file)
├──► EOD-TB-FO (F&O trade file)
├──► EOD-TB-CD (CD trade file)
├──► EOD-TB-COM (commodities trade file — MCX)
EOD-RECON (reconcile broker OMS records vs exchange trade files)
├──► EOD-CHARGE-COMPUTE (brokerage + STT + GST + exchange + SEBI + stamp)
│ │
│ ▼
│ EOD-CN-GENERATE (per-client ECN PDFs with DSC signature)
│ │
│ ▼
│ EOD-CN-DISPATCH (DLT SMS + email per template)
├──► EOD-MTM-EOD (final MTM on outstanding positions)
├──► EOD-POS-FILE (position file generation)
│ │
│ ▼
│ EOD-POS-UPLOAD (upload to clearing corp)
├──► EOD-OBLIG-FETCH (obligation file from clearing corp)
│ │
│ ▼
│ EOD-OBLIG-PROCESS (compute payin/payout amounts)
├──► EOD-PMR-FETCH (peak-margin response file from clearing)
│ │
│ ▼
│ EOD-DMF-RECONCILE (DMF rows vs PMR; flag shortfall)
└──► EOD-COMP-REPORT (CAR / DPC / member compliance submissions)
EOD-READY (all EOD reconciliation done)

DAG 2 — Overnight settlement (19:00 onwards)

Section titled “DAG 2 — Overnight settlement (19:00 onwards)”
EOD-READY (from DAG 1)
├──► SET-PAYIN-PREP (stage T+1 payin instructions to clearing bank)
├──► SET-PAYOUT-PREP (receive payout instructions from clearing)
▼ (T+1 morning, but staged tonight)
SET-PAYIN-EXECUTE (funds out: broker client-funds bank → clearing bank)
(securities out: depository pool → clearing pool)
(post-Jun-2024 direct payout: from clearing pool → client demat)
SET-PAYOUT-RECV (funds in: clearing bank → broker client-funds bank)
(securities in: directly to client demat via direct-payout)
SET-UPSTREAM (daily client funds upstreaming to clearing per Jun 2023 mandate)
├──► funds (bank-balance based)
├──► FDRs (pledged collateral)
├──► MFOS (margin funded order system instruments)
BANK-RECON (reconcile broker books vs bank confirmations vs clearing acks)
(parallel batch operations starting 19:00)
├──► KRA-DAILY (daily upload to KRA for new + modified KYC)
├──► CKYC-DAILY (CKYC upload within 7-day window)
├──► LEDGER-NIGHT (per-client ledger batch with day's trades + charges + MTM)
PREP-NEXT-BOD (log rotation, backup verify, DR replication sync)
[hands off to BOD-START at 06:00]
node_idoperationdepends_onblocksparallel_eligibleidempotentretry_policyrollbackslafailure_surfacespec_source
EOD-START15:40 EOD triggerTH-CW-FINAL_MARGINEOD-TB-*[none]yes (date-keyed)none[none]scheduledops console[industry typical]
EOD-TB-CMCM trade file from NSE/BSEEOD-STARTEOD-RECONparallel-with FO/CD/COMyes3× then alternate FTP[none]< 10mops alertNSE/BSE circulars
EOD-TB-FOF&O trade fileEOD-STARTEOD-RECONparallelyes[none]< 10mops alertNSE/BSE F&O
EOD-TB-CDCD trade fileEOD-STARTEOD-RECONparallelyes[none]< 10mops alertNSE/BSE CD
EOD-TB-COMMCX trade fileEOD-STARTEOD-RECONparallelyes[none]< 10mops alertMCX circulars
EOD-RECONReconcile broker OMS vs exchange trade filesEOD-TB-CM, EOD-TB-FO, EOD-TB-CD, EOD-TB-COMEOD-CHARGE-COMPUTE, EOD-MTM-EOD, EOD-POS-FILE, EOD-OBLIG-FETCH, EOD-PMR-FETCH, EOD-COMP-REPORT[none]yes (date-keyed)1× then manual[none]< 30mops queue / back-office console[industry typical]
EOD-CHARGE-COMPUTEBrokerage / STT / GST / exchange / SEBI / stamp dutyEOD-RECONEOD-CN-GENERATEparallel-with POS / OBLIG / PMR / COMPyes (per-trade)3× then manualreverse ledger entry if reconciled wrong< 30mback-office[industry typical]
EOD-CN-GENERATEECN PDF generation with DSC signEOD-CHARGE-COMPUTEEOD-CN-DISPATCH[none]yes (trade-id keyed)3× then manualregenerate on detected error< 60mback-office / DSC serviceInvestor servicing domain
EOD-CN-DISPATCHDLT SMS + email per templateEOD-CN-GENERATE[exit]parallel-with other EOD streamsyes (msg-id keyed)3× then DLT retry[none]< 24h cumulativeops queue / DLT rejectDLT comms compliance
EOD-MTM-EODFinal MTM on outstanding positionsEOD-RECONEOD-POS-FILEparallelyes3× then manual[none]< 15mRMS[industry typical]
EOD-POS-FILEPosition file generation per segmentEOD-MTM-EOD, EOD-RECONEOD-POS-UPLOADparallel-with charges/CNyes3× then manual[none]< 30mback-officeClearing-corp file specs
EOD-POS-UPLOADUpload position file to clearing corpEOD-POS-FILEEOD-READY[none]yes (file-id keyed)3× then ops alert[none]< 30mclearing-corp reject fileClearing-corp file specs
EOD-OBLIG-FETCHObligation file from clearingEOD-RECONEOD-OBLIG-PROCESSparallel-with POS/PMR/COMPyes3× then alternate FTP[none]clearing-side timingops alertClearing-corp file specs
EOD-OBLIG-PROCESSCompute payin/payout amountsEOD-OBLIG-FETCHSET-PAYIN-PREP, SET-PAYOUT-PREP[none]yes3× then manualrecompute on detected error< 30mback-office[industry typical]
EOD-PMR-FETCHPeak-margin response fileEOD-RECONEOD-DMF-RECONCILEparallelyes[none]clearing-sideops alertClearing-corp file specs
EOD-DMF-RECONCILEDMF rows vs peak-margin responseEOD-PMR-FETCH, TH-SNAP-DMF_ROW (all 4)EOD-READY[none]yes1× then manual queue[none]< 30mops queue / complianceMargin compliance domain
EOD-COMP-REPORTCAR / DPC / member compliance reportsEOD-RECONEOD-READYparallelyes3× then manual queue[none]by midnightops queueReporting domain
EOD-READYEOD-block complete; settlement block startsEOD-CN-DISPATCH, EOD-POS-UPLOAD, EOD-OBLIG-PROCESS, EOD-DMF-RECONCILE, EOD-COMP-REPORTSET-PAYIN-PREP, SET-PAYOUT-PREP[none]yes (local)none[none]< 100msops console[industry typical]
SET-PAYIN-PREPStage T+1 payin instructionsEOD-OBLIG-PROCESS, EOD-READYSET-PAYIN-EXECUTEparallel-with PAYOUT-PREPyes (settlement-id)3× then critical alertrelease reservation on cancellation< 30mback-officeSettlement domain
SET-PAYOUT-PREPReceive payout instructionsEOD-OBLIG-PROCESS, EOD-READYSET-PAYOUT-RECVparallelyes[none]< 30mback-officeSettlement domain
SET-PAYIN-EXECUTET+1 payin: funds + securities outSET-PAYIN-PREPSET-PAYOUT-RECV[none]no (money movement)1× then criticalcompensating transaction via clearing default fundby 11:00 next-dayclearing-corp + bankSettlement + client-funds domains
SET-PAYOUT-RECVPayout in: funds to client-funds bank, securities direct-to-dematSET-PAYIN-EXECUTESET-UPSTREAM[none]no (money movement)1× then ops alert[none]< 1h after payin windowclearing-corp + bankDirect-payout circular
SET-UPSTREAMDaily client funds upstream to clearing corpSET-PAYOUT-RECVBANK-RECONparallel-with KRA/CKYC/ledgerno (money movement)1× then criticaln/a (next-day reconciliation)overnightclearing-corp + bankSEBI/HO/MIRSD/MIRSD-PoD-1/P/CIR/2023/84
BANK-RECONReconcile broker book vs bank + clearingSET-UPSTREAMPREP-NEXT-BODparallelyes (date-keyed)1× then manual[none]< 1hops queueClient funds domain
KRA-DAILYDaily upload of new + modified KYC to KRAEOD-READYPREP-NEXT-BODparallelyes (PAN+ref-id keyed)3× then 24h queue[none]overnightKRA reject fileSEBI/HO/MIRSD/SECFATF/P/CIR/2024/79
CKYC-DAILYCKYC upload within 7-day windowEOD-READYPREP-NEXT-BODparallelyes (PAN-keyed)3× then 7d window[none]within 7 daysCERSAI rejectCKYC dual-upload circular
LEDGER-NIGHTPer-client ledger batchEOD-READY, EOD-CHARGE-COMPUTEPREP-NEXT-BODparallelyes (date+client keyed)3× then manualre-run on detected errorovernight (~3h typical)back-office console[industry typical]
PREP-NEXT-BODLog rotation, backup verify, DR syncBANK-RECON, KRA-DAILY, LEDGER-NIGHT[hands off to BOD-START 06:00][none]yes3× then CISO alert[none]by 05:30 next-dayops consoleBCP/DR + Cyber domains
  • [risk trade-off] SET-PAYIN-EXECUTE is the highest-stakes node of the day. Failure triggers clearing-corp default fund draw and member-suspension review. Most brokers maintain a 1.5× buffer of liquid funds at the client-funds bank against the highest historical payin obligation to absorb worst-case days.
  • [gotcha] Direct-payout-to-demat (post Jun 2024 SEBI circular, phased Nov-2024 / Jan-Feb-2025) changed the SET-PAYOUT-RECV node: securities flow direct from clearing pool to client demat without parking in broker pool. This required restructuring the back-office chart of accounts; brokers that handled the rollout late had reconciliation issues for weeks.
  • [industry practice] EOD-DMF-RECONCILE is where compliance teams find peak-margin shortfalls; the response file from clearing is the authoritative record. Discrepancies between the broker’s TH-SNAP-DMF_ROW outputs and the clearing-corp response are the first warning of an RMS issue.
  • [cost optimization] LEDGER-NIGHT and SET-UPSTREAM are the two longest-running nightly batches. Running them sequentially (ledger first, then upstreaming after ledger committed) is cleaner but slower; running them in parallel with read-only ledger pre-snapshots typically saves 1–2 hours of overnight wall-clock at large brokers.

2026-05-14


AI-generated and not legal, financial, or compliance advice. See the project README for full disclaimer.