Skip to content

Live Option Chain for Equity Derivatives using Finvasia Shoonya APIs and Next.js

License

Notifications You must be signed in to change notification settings

anurag-roy/shoonya-option-chain

Repository files navigation

Option Chain

Live Option Chain for Equity Derivatives using Finvasia (Shoonya) APIs and Next.js

option-chain

Features

  • Grouped stocks for easily monitoring relevant stocks
  • Connect from multiple tabs to monitor different groups of stocks
  • Vertically resizable and scrollable tables to adjust views when needed
  • Prices displayed - First Bid and First Ask for options and LTP for equities along with change from previous day's close
  • Options displayed
    • CE: Only Call options with strikes lesser than the LTP
    • PE: Only Put options with strikes greater than the LTP
    • A percentage of options close to the LTP on both sides are ignored. See DIFF_PERCENT
  • Place Sell orders directly from the UI

Screenshots

initial-view

all-view

group-view

order-with-cash

order-with-shortfall

Setup

Install dependencies. (npm or yarn is recommended)1

npm install

Setup environment secrets in an env.json file by copying the example.env.json file. For further customisation, see configuration.

cd src
cp example.env.json env.json
# Populate env.json secrets

Populate the SQLite DB with instrument data.

npm run data:prepare

Usage

Start in development mode

npm run dev

Build and start production server.

npm run build
npm start

Configuration

Port

The default port is 3000. To change it, update the dev and start scripts in package.json.

config.ts

Edit src/config.ts to:

  • GROUPS - Update stock dropdown options and relevant grouping
  • EXPIRY_OPTION_LENGTH - Expiry dropdown options
  • DIFF_PERCENT - Control the range of strikes to ignore (depending on the LTP of the equity instrument).

Related

Contact

License

MIT © 2023 Anurag Roy

Footnotes

  1. The app uses this Next.js plugin to maintain a WebSocket Server, which patches some files in node_modules. I have tried using pnpm but it does not work reliably. See other caveats here.

About

Live Option Chain for Equity Derivatives using Finvasia Shoonya APIs and Next.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages