npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@its_seraj/trade

v1.0.7

Published

Kotak Neo option trading bot with order book price difference logic

Readme

Kotak Neo Trader

Polls the Kotak Neo API for one or more option/futures symbols and automatically places or modifies limit orders when the current price diverges from the order-book price by more than a configurable threshold.

Setup

cd kotak-neo-trader
npm install
cp .env.example .env
# fill in .env with your credentials and symbol details
node index.js

.env fields

| Variable | Description | Example | |---|---|---| | CONSUMER_KEY | App consumer key | abc123 | | CONSUMER_SECRET | App consumer secret | xyz789 | | MOBILE_NUMBER | Registered mobile (with country code) | +919999999999 | | PASSWORD | Trading password | mypassword | | ENVIRONMENT | prod or uat | prod | | SYMBOL | Trading symbol(s), comma-separated | CRUDEOIL26MAYFUT | | INSTRUMENT_TOKEN | Instrument wToken(s), comma-separated | 12345 | | EXCHANGE_SEGMENT | Exchange segment(s), comma-separated | mcx_fo | | PRODUCT | Product type | NRML | | ORDER_TYPE | L, MKT, SL, SL-M | L | | TRANSACTION_TYPE | B (Buy) or S (Sell) | B | | QUANTITY | Lot size | 1 | | PRICE_DIFF_THRESHOLD | Points diff to trigger action | 200 | | POLL_INTERVAL_MS | How often to check (ms) | 5000 | | SESSION_TOKEN | (Optional) Skip OTP re-login | — | | SID | (Optional) Session ID | — | | SERVER_ID | (Optional) Server ID | — |

Multiple symbols

Comma-separate all symbol-related fields in the same order:

SYMBOL=CRUDEOIL26MAYFUT,NATURALGAS26MAYFUT
INSTRUMENT_TOKEN=12345,67890
EXCHANGE_SEGMENT=mcx_fo,mcx_fo

Logic flow

Every POLL_INTERVAL_MS:
  For each symbol:
    1. Fetch LTP (current price)
    2. Fetch market depth (best bid / best ask)
    3. If |LTP - bestBid| > threshold  OR  |LTP - bestAsk| > threshold:
       a. Check order report for this symbol
       b. Filled/open position exists?  → log, skip
       c. Pending order exists?
            price drifted > threshold?  → modify order to new price
            else                        → log, skip
       d. No orders?                    → place new order
    4. Else: log diff, no action