Data to 20 November 2026
About

Methods

Leverage and positioning: methods

Code: pipeline/tipsheet/compute/leverage.py, publish/leverage.py, step steps/data_leverage.py. Bundles: leverage/*.

Sources

All are NSE public archives, ingested with contracts and audits:

DatasetWhat it holdsFrom
nse_mtf_2004_2012, nse_mtf_2013_2022, nse_mtfDaily margin trading (MTF) summary, plus each security’s funded quantity and amount2004-04-13
nse_participant_oiOpen interest by Client, DII, FII and Pro, split into futures, options, index and stock, long and short2012-01-02
nse_fii_derivativesFII buy and sell values and open interest by product2014-12-01

Definitions

Checks

Caveats

F&O bhavcopy analytics

Bundles: leverage/fo/* and leverage/stats/{nifty_pcr_oi,sensex_pcr_oi,nifty_basis_ann,stocks_rollover}. Code: compute/fo_analytics.py and publish/fo_analytics.py; step fo_analytics.

Source: the NSE F&O bhavcopy, one row per contract per day, from 2020-01-01 (eras nse_fo_bhavcopy_2020h1 onward). Two layouts:

BSE (bse_derivatives_bhavcopy, from 2024-01-01): the same panels for the Sensex and Bankex (leverage/fo/index_sensex_daily, index_bankex_daily), BSE’s index futures and options OI and premium as bse_* columns of leverage/fo/market_daily, and BSE and combined expiry-day shares. BSE prints lot size, the underlying price and option premium itself. The 2023 files print no lot size or price, so they are not used (BSE’s derivatives were dormant until the Sensex relaunch on 15 May 2023; 15 sessions from 3 Apr to 4 May 2023 have no file at all, a reviewed source gap in the archive). Check (bse_vs_bse_statistics): on all 699 common days from 2024 to 26 Oct 2026, the bhavcopy’s contracts, premium and notional turnover equal BSE’s published daily statistics (largest gaps 0, 2×10⁻⁵ and 2×10⁻⁷), and open interest (on BSE’s basis, below) is within 0.2%. BSE’s file for a session can land a day after NSE’s; that day’s BSE columns are blank, not zero.

Identities

Measures

All of this is descriptive (see the null results above).

Where the borrowed money sits

Bundle leverage/channels/monthly; code compute/leverage_channels.py, step leverage_channels (needs leverage, credit, pledges). Page: /leverage/#brokers-banks.

Expiry study

Bundles fo/expiry/{worthless_monthly,maxpain_nifty,maxpain_banknifty}; code compute/fo_expiry.py, run inside step fo_analytics on the same contract table. Page: /fo/premium/#worthless and #max-pain. Pre-registered as C120–C121 in docs/research/site_calculations_spec.md, with results logged there.

This note is the repository file docs/methods/leverage.md, rendered as-is.