<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shubham Taywade on Medium]]></title>
        <description><![CDATA[Stories by Shubham Taywade on Medium]]></description>
        <link>https://medium.com/@shubhamtaywade82?source=rss-30626c49bba6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GjbFmHBtcnjW_4UtuT3CfQ.jpeg</url>
            <title>Stories by Shubham Taywade on Medium</title>
            <link>https://medium.com/@shubhamtaywade82?source=rss-30626c49bba6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 09:50:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shubhamtaywade82/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Beyond Chatbots: Building Nexum, an Open-Source Runtime for AI Agents]]></title>
            <link>https://medium.com/@shubhamtaywade82/beyond-chatbots-building-nexum-an-open-source-runtime-for-ai-agents-d88d61980392?source=rss-30626c49bba6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d88d61980392</guid>
            <category><![CDATA[ai-harness]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Shubham Taywade]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 02:28:13 GMT</pubDate>
            <atom:updated>2026-11-10T02:28:13.579Z</atom:updated>
            <content:encoded><![CDATA[<p>Beyond Chatbots: Building Nexum, an Open-Source Runtime for AI Agents</p><p>Why agentic systems need runtime infrastructure, not just prompts and tool-calling loops.</p><p>Introduction</p><p>The AI ecosystem has moved quickly from traditional chat interfaces to tool-using assistants, autonomous workflows, multi-agent systems, and increasingly sophisticated AI engineering environments.</p><p>Building a prototype agent is relatively easy.</p><p>Building an agent system that can execute reliably, interact with external tools, enforce policies, recover from failures, and improve through evaluation is a different engineering problem.</p><p>A prompt and an LLM are not an architecture.</p><p>A tool-calling loop is not a complete runtime.</p><p>And an agent that works in a demonstration is not necessarily an agent that can be trusted in a real application.</p><p>This is the engineering problem behind Nexum.</p><p>Nexum is an open-source TypeScript project exploring the runtime infrastructure required to build, execute, orchestrate, and evolve AI agents.</p><p>GitHub: https://github.com/shubhamtaywade82/nexum</p><p>1. The problem with building agents from scratch</p><p>Most initial agent implementations follow a familiar pattern:</p><p>Send a prompt to an LLM.</p><p>Receive a response.</p><p>Determine whether the model requested a tool.</p><p>Execute the tool.</p><p>Return the result to the model.</p><p>Repeat until the task is complete.</p><p>This is a useful starting point.</p><p>However, complexity increases rapidly when the system needs to support:</p><p>Multiple model providers.</p><p>Multiple agent execution strategies.</p><p>Tool permissions and execution policies.</p><p>Persistent state and memory.</p><p>Long-running workflows.</p><p>Subagents and delegation.</p><p>MCP-based integrations.</p><p>Execution tracing and observability.</p><p>Automated evaluation.</p><p>Recovery and retry mechanisms.</p><p>Controlled evolution of agent behavior.</p><p>Without clear boundaries, these capabilities become tightly coupled.</p><p>The result is often an application where the agent loop, provider integration, tool execution, state management, and business logic are difficult to test independently.</p><p>Nexum approaches this as a runtime engineering problem.</p><p>2. What is Nexum?</p><p>Nexum is an open-source agent runtime built with TypeScript.</p><p>Its objective is to provide modular infrastructure for agentic applications rather than forcing developers to implement every execution mechanism themselves.</p><p>The project explores two complementary adoption paths:</p><p>CLI experience</p><p>A developer-facing interface for working with agent projects and executing workflows.</p><p>Runtime SDK</p><p>A programmable foundation for integrating agent execution into applications and services.</p><p>The distinction matters.</p><p>An agent framework should not force application developers to adopt a particular CLI workflow. Likewise, a CLI should not become the only way to access the underlying runtime.</p><p>Separating these interfaces creates room for independent evolution.</p><p>3. Architecture and core capabilities</p><p>Nexum is organized around distinct runtime responsibilities.</p><p>Agent Runtime</p><p>The runtime manages agent execution and lifecycle concerns.</p><p>It provides the foundation on which different agent strategies can operate without duplicating the underlying infrastructure.</p><p>Orchestration</p><p>Different tasks require different execution strategies.</p><p>Nexum explores multiple orchestration approaches:</p><p>ReAct — iterative reasoning and tool execution.</p><p>Plan-and-Execute — separating planning from task execution.</p><p>Graph-based execution — representing workflows through structured nodes and transitions.</p><p>The important architectural decision is to keep orchestration separate from model-provider and tool-execution implementations.</p><p>Model Gateway</p><p>Model integrations should not dictate the architecture of the entire application.</p><p>A model gateway provides an abstraction boundary between the runtime and model providers.</p><p>This makes it easier to introduce additional providers, change models, and control model-specific behavior without rewriting agent orchestration.</p><p>Tool Gateway</p><p>Tools are where agents interact with the outside world.</p><p>That interaction introduces operational and security risks.</p><p>A dedicated tool gateway creates a boundary for:</p><p>Tool registration and discovery.</p><p>Input validation.</p><p>Execution dispatch.</p><p>Result handling.</p><p>Policy enforcement.</p><p>Error handling.</p><p>Tool execution should be treated as a controlled runtime operation, not an unrestricted function call.</p><p>MCP Integration</p><p>The Model Context Protocol provides a standardized way to connect AI applications with external tools and resources.</p><p>Nexum&#39;s MCP integration is intended to make external capabilities accessible through a consistent integration boundary.</p><p>Policy Engine</p><p>An agent should not automatically receive unrestricted access to every capability available to the application.</p><p>A policy engine provides a foundation for controlling which operations can execute and under what conditions.</p><p>This is particularly important when agents can access files, execute commands, interact with APIs, or modify external systems.</p><p>Evaluation</p><p>An agent that produces a plausible answer is not necessarily performing correctly.</p><p>Evaluation needs to consider more than response quality.</p><p>Important dimensions include:</p><p>Task completion.</p><p>Tool selection and execution.</p><p>Policy compliance.</p><p>Failure handling.</p><p>Output correctness.</p><p>Execution efficiency.</p><p>Reproducibility.</p><p>Evaluation should become part of the engineering lifecycle rather than an activity performed only after development.</p><p>Evolution</p><p>One of the longer-term directions behind Nexum is systematic agent improvement.</p><p>The objective is to explore a closed-loop process:</p><p>Identify an agent capability or performance gap.</p><p>Propose a candidate improvement.</p><p>Implement the change.</p><p>Evaluate it against defined criteria.</p><p>Compare the candidate with the baseline.</p><p>Accept or reject the change based on evidence.</p><p>The critical principle is that an agent should not be considered improved merely because it generated a better-looking response.</p><p>Improvements need measurable evidence.</p><p>4. Engineering principles</p><p>Nexum is being developed around several principles.</p><p>Modularity over monolithic abstractions</p><p>Runtime, orchestration, providers, tools, evaluation, and evolution should have clear boundaries.</p><p>Explicit execution over hidden behavior</p><p>Agent execution should be inspectable and controllable.</p><p>Testability over demonstrations</p><p>Core runtime behavior needs automated tests, including failure paths and edge cases.</p><p>Policy enforcement over unrestricted autonomy</p><p>Agents should operate within explicitly defined permissions.</p><p>Evaluation over assumptions</p><p>Changes to agent behavior should be validated against measurable outcomes.</p><p>Provider independence</p><p>The architecture should avoid unnecessary dependence on one model provider.</p><p>These principles are especially important as agent systems move from experimentation into application infrastructure.</p><p>5. Why TypeScript?</p><p>TypeScript offers a practical foundation for building developer-facing agent infrastructure.</p><p>Its type system supports explicit contracts between runtime components, provider adapters, tools, and application code.</p><p>It also provides access to a mature ecosystem for:</p><p>API integrations.</p><p>MCP implementations.</p><p>Asynchronous execution.</p><p>CLI development.</p><p>Testing and automation.</p><p>Package distribution.</p><p>For an SDK-oriented project, clear public interfaces and predictable package behavior are just as important as internal implementation quality.</p><p>6. What Nexum is not</p><p>It is important to set realistic expectations.</p><p>Nexum is not being presented as a finished, production-certified autonomous agent platform.</p><p>It is a developer-preview project, and several areas require continued implementation, validation, and hardening.</p><p>Security boundaries, platform compatibility, API stability, evaluation quality, and operational reliability must be demonstrated through engineering work.</p><p>A growing feature list is not evidence of production readiness.</p><p>The goal is to build the foundation correctly and improve it incrementally.</p><p>7. What&#39;s next?</p><p>The direction for Nexum includes continued work on:</p><p>Runtime reliability and execution lifecycle.</p><p>Agent orchestration and delegation.</p><p>Tool security and policy enforcement.</p><p>Model-provider integrations.</p><p>MCP capabilities.</p><p>Persistent state and memory.</p><p>Evaluation and benchmarking.</p><p>Observability and execution tracing.</p><p>Controlled agent evolution.</p><p>Developer experience and documentation.</p><p>The long-term objective is to make agent infrastructure easier to integrate, test, operate, and extend.</p><p>8. Explore the project</p><p>Nexum is open source, and feedback from developers working on agentic systems is valuable.</p><p>Explore the repository:</p><p>GitHub: https://github.com/shubhamtaywade82/nexum</p><p>If you&#39;re building AI agents, model integrations, developer tools, or autonomous workflows, I&#39;d be interested in your perspective.</p><p>The next phase of AI engineering will require more than better models.</p><p>It will require better infrastructure around those models.</p><p>That&#39;s what I&#39;m exploring with Nexum.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d88d61980392" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[# Introducing DhanHQ TS: A Production-Grade TypeScript SDK for DhanHQ API v2]]></title>
            <link>https://medium.com/@shubhamtaywade82/introducing-dhanhq-ts-a-production-grade-typescript-sdk-for-dhanhq-api-v2-04f84170fc27?source=rss-30626c49bba6------2</link>
            <guid isPermaLink="false">https://medium.com/p/04f84170fc27</guid>
            <category><![CDATA[options-trading]]></category>
            <category><![CDATA[algorithmic-trading]]></category>
            <category><![CDATA[libraries]]></category>
            <category><![CDATA[trading]]></category>
            <dc:creator><![CDATA[Shubham Taywade]]></dc:creator>
            <pubDate>Sun, 02 Aug 2026 03:34:11 GMT</pubDate>
            <atom:updated>2026-08-02T03:34:11.733Z</atom:updated>
            <content:encoded><![CDATA[<p>**A batteries-included TypeScript trading SDK with binary WebSocket market data, option analytics, technical indicators, a pre-trade risk pipeline, and an MCP server for AI trading agents.**</p><p>— -</p><p>## The Problem</p><p>If you trade on NSE or BSE through [Dhan](<a href="https://dhan.co/">https://dhan.co</a>) and you build in TypeScript or Node.js, your options have been limited. Dhan publishes an official Python SDK (`dhanhq`) and a lightweight JavaScript client (`dhanhq-ts`), but neither gives you what a production trading system actually needs:</p><p>- End-to-end type safety from API request to WebSocket tick<br>- A binary WebSocket parser that doesn’t make you reverse-engineer byte offsets<br>- Option Greeks, implied volatility, and max pain computed locally<br>- Technical indicators that don’t require a separate `ta-lib` dependency<br>- Pre-trade risk checks that encode actual NSE/BSE rules<br>- A way to expose your trading infrastructure to an LLM agent safely</p><p>You end up stitching together five libraries, writing your own WebSocket parser, and hoping your risk checks don’t have a gap at 3:29 PM on expiry day.</p><p>[DhanHQ TS](<a href="https://github.com/shubhamtaywade82/dhanhq-ts">https://github.com/shubhamtaywade82/dhanhq-ts</a>) is my attempt to close that gap. It’s a single, typed, production-grade SDK that covers the full lifecycle: authentication, order placement, real-time data, analytics, risk management, and AI agent integration.</p><p>```bash<br>npm install <a href="http://twitter.com/shubhamtaywade82/dhanhq-ts">@shubhamtaywade82/dhanhq-ts</a><br>```</p><p>**Links:**<br>- GitHub: [github.com/shubhamtaywade82/dhanhq-ts](<a href="https://github.com/shubhamtaywade82/dhanhq-ts">https://github.com/shubhamtaywade82/dhanhq-ts</a>)<br>- npm: [npmjs.com/package/@shubhamtaywade82/dhanhq-ts](<a href="https://www.npmjs.com/package/@shubhamtaywade82/dhanhq-ts">https://www.npmjs.com/package/@shubhamtaywade82/dhanhq-ts</a>)<br>- Documentation: [shubhamtaywade82.github.io/dhanhq-ts](<a href="https://shubhamtaywade82.github.io/dhanhq-ts/">https://shubhamtaywade82.github.io/dhanhq-ts/</a>)</p><p>— -</p><p>## What’s Inside</p><p>The SDK is organized around a single `DhanClient` instance that exposes typed resource clients:</p><p>```typescript<br>import { DhanClient } from “<a href="http://twitter.com/shubhamtaywade82/dhanhq-ts">@shubhamtaywade82/dhanhq-ts</a>”;</p><p>const client = new DhanClient({<br> token: process.env.DHAN_TOKEN!,<br> clientId: process.env.DHAN_CLIENT_ID!,<br>});<br>```</p><p>From that one object, you get:</p><p>| Namespace | What it does |<br>| — -| — -|<br>| `client.orders` | Place, modify, cancel, track orders |<br>| `client.portfolio` | Holdings, positions, DP holdings |<br>| `client.funds` | Margin, limits, charges |<br>| `client.marketData` | LTP, quotes, OHLC, option chain |<br>| `client.charts` | Intraday and historical candles |<br>| `client.ws` | WebSocket market feed + order updates |<br>| `client.ws.depth` | 20-level market depth |<br>| `client.globalStocks` | US equities (fractional shares, USD) |<br>| `client.traderControls` | Kill switch, P&amp;L auto-exit |<br>| `client.auth` | Token generation, auto-renewal |</p><p>Every method returns typed responses generated from DhanHQ’s OpenAPI specification. No `any`. No guessing field names. Your IDE autocompletes the entire API surface.</p><p>— -</p><p>## Authentication: Five Methods, One Interface</p><p>Trading systems have different secret-management requirements. A weekend backtester wants a static token in `.env`. A production bot wants vault-backed rotation. An autonomous agent wants auto-generated tokens from a TOTP secret.</p><p>The SDK supports all five:</p><p>```typescript<br>// 1. Static token<br>const client = new DhanClient({ token, clientId });</p><p>// 2. Provider callback (vault, AWS Secrets Manager, etc.)<br>const client = new DhanClient({<br> clientId,<br> tokenProvider: () =&gt; vault.read(“dhan/token”),<br>});</p><p>// 3. Auto token management (generates from PIN + TOTP)<br>const client = new DhanClient({ clientId });<br>client.auth.enableAutoTokenManagement({<br> clientId,<br> pin: “1234”,<br> totpSecret: “JBSWY3DPEHPK3PXP”,<br>});</p><p>// 4. Environment variables (DHAN_CLIENT_ID, DHAN_ACCESS_TOKEN)<br>const client = DhanClient.fromEnv();</p><p>// 5. Token endpoint (your own auth microservice)<br>const client = await DhanClient.fromTokenEndpoint({<br> endpointBaseUrl: “<a href="https://auth.internal.example.com/">https://auth.internal.example.com</a>&quot;,<br> bearerToken: “service-token”,<br>});<br>```</p><p>Two implementation details that matter in production:</p><p>- **Concurrent callers share one login.** Parallel token generation can invalidate the previous session. The SDK serializes this internally.<br>- **Offset-less expiry timestamps are read as IST.** Dhan returns expiry times without timezone offsets. On a UTC server, naive parsing introduces a 5.5-hour drift that can cause premature token refresh or, worse, expired-token errors mid-trade. The SDK handles this correctly.</p><p>Full details in the [authentication docs](<a href="https://shubhamtaywade82.github.io/dhanhq-ts/getting-started/authentication">https://shubhamtaywade82.github.io/dhanhq-ts/getting-started/authentication</a>).</p><p>— -</p><p>## WebSocket: Binary Protocol, Parsed for You</p><p>This is where the SDK earns its “production-grade” label.</p><p>DhanHQ’s market feed uses a compact binary WebSocket protocol. The official JavaScript client gives you raw buffers. DhanHQ TS gives you typed tick objects:</p><p>```typescript<br>await client.ws.connect();</p><p>client.ws.market.subscribe([<br> { exchangeSegment: “NSE_FNO”, securityId: “44321” },<br> { exchangeSegment: “NSE_EQ”, securityId: “1333” },<br>]);</p><p>client.ws.market.on(“tick”, (tick) =&gt; {<br> console.log(tick.ltp); // Last traded price<br> console.log(tick.volumeTradedToday); // Cumulative volume<br> console.log(tick.openInterest); // OI for F&amp;O<br>});<br>```</p><p>For order execution feedback:</p><p>```typescript<br>client.ws.orders.on(“order”, (update) =&gt; {<br> console.log(update.Status); // “TRADED”, “PENDING”, etc.<br> console.log(update.AvgTradedPrice);<br> console.log(update.CumulativeQty);<br>});<br>```</p><p>For 20-level depth (five bids + five asks, with quantities at each level):</p><p>```typescript<br>client.ws.enableDepth(“twenty”);<br>await client.ws.connect();</p><p>client.ws.depth?.subscribe([<br> { exchangeSegment: “NSE_EQ”, securityId: “1333” },<br>]);</p><p>client.ws.depth?.on(“depth”, (event) =&gt; {<br> // event.levels: { bids: […], asks: […] }<br>});<br>```</p><p>The binary parser handles all the byte-level work: field extraction, endianness, variable-length encoding. You never touch a `Buffer` directly.</p><p>The design principle: **the WebSocket is the real-time truth source.** Use it for LTP, exit logic, and execution-time state. Use REST for placement, reconciliation, and history. The SDK makes both paths equally ergonomic.</p><p>— -</p><p>## Technical Analysis: No External Dependencies</p><p>The SDK includes a pure-function technical analysis module. No `ta-lib` bindings. No Python subprocess. No WASM. Just TypeScript functions over number arrays:</p><p>```typescript<br>import {<br> sma, ema, rsi, macd, bollingerBands,<br> atr, adx, stochastic, supertrend, vwap, obv,<br> latest,<br>} from “<a href="http://twitter.com/shubhamtaywade82/dhanhq-ts">@shubhamtaywade82/dhanhq-ts</a>”;</p><p>const closes = [/* your OHLC close array */];</p><p>const rsiValues = rsi(closes, 14);<br>const currentRsi = latest(rsiValues); // last non-null value</p><p>const { macdLine, signalLine, histogram } = macd(closes, 12, 26, 9);</p><p>const { upper, middle, lower } = bollingerBands(closes, 20, 2);<br>```</p><p>Every indicator returns an array the same length as its input, with `null` where there isn’t enough lookback data. This makes it trivial to align with your candle arrays.</p><p>### Multi-Timeframe Bias Engine</p><p>This is the feature I use most in my own systems. It computes indicators across multiple intervals and produces a blended directional bias:</p><p>```typescript<br>import { TechnicalAnalysis, analyzeMultiTimeframe } from “<a href="http://twitter.com/shubhamtaywade82/dhanhq-ts">@shubhamtaywade82/dhanhq-ts</a>”;</p><p>const ta = new TechnicalAnalysis(client.charts);</p><p>const result = await ta.compute({<br> securityId: “13”,<br> exchangeSegment: “IDX_I”,<br> instrument: “INDEX”,<br> intervals: [5, 15, 60], // 5m, 15m, 1h<br>});</p><p>const bias = analyzeMultiTimeframe(result);<br>console.log(bias.summary);<br>// {<br>// bias: “bullish”,<br>// setup: “buy_on_dip”,<br>// confidence: 0.81,<br>// signals: { “5”: “neutral”, “15”: “bullish”, “60”: “bullish” }<br>// }<br>```</p><p>Higher timeframes are weighted more heavily. A 60-minute bullish signal outweighs a 5-minute bearish one. The confidence score reflects agreement across timeframes.</p><p>— -</p><p>## Option Analytics: Greeks, IV, Max Pain, PCR</p><p>For options traders, the SDK computes everything locally from the option chain data:</p><p>```typescript<br>import {<br> blackScholes, greeks, impliedVolatility,<br> maxPain, putCallRatio, openInterestFromChain,<br>} from “<a href="http://twitter.com/shubhamtaywade82/dhanhq-ts">@shubhamtaywade82/dhanhq-ts</a>”;</p><p>// Fetch the chain from DhanHQ<br>const chain = await client.optionChain.fetchNormalized({<br> underlyingScrip: 13,<br> underlyingSeg: “IDX_I”,<br> expiry: “2026–08–28”,<br>});</p><p>// Compute analytics<br>const oiData = openInterestFromChain(chain);<br>const pain = maxPain(oiData); // Strike with least total OI pain<br>const pcr = putCallRatio(oiData); // Put OI / Call OI</p><p>// Price a specific option<br>const price = blackScholes({<br> spot: 24_000,<br> strike: 24_200,<br> timeToExpiry: 10 / 365,<br> riskFreeRate: 0.065,<br> volatility: 0.15,<br> optionType: “call”,<br>});</p><p>// Get all Greeks<br>const g = greeks({<br> spot: 24_000,<br> strike: 24_200,<br> timeToExpiry: 10 / 365,<br> riskFreeRate: 0.065,<br> volatility: 0.15,<br> optionType: “call”,<br>});<br>// g.delta, g.gamma, g.theta, g.vega, g.rho</p><p>// Back out IV from market price<br>const iv = impliedVolatility({<br> marketPrice: 185.50,<br> spot: 24_000,<br> strike: 24_200,<br> timeToExpiry: 10 / 365,<br> riskFreeRate: 0.065,<br> optionType: “call”,<br>});<br>```</p><p>This means you can build an options dashboard, a volatility scanner, or a max-pain-based expiry strategy without leaving the TypeScript runtime.</p><p>— -</p><p>## Risk Pipeline: Pre-Trade Safety Rails</p><p>This is the part most SDKs skip entirely. DhanHQ TS includes a configurable pre-trade risk pipeline that runs before every order hits the exchange:</p><p>```typescript<br>import { Pipeline, riskProviderFor } from “<a href="http://twitter.com/shubhamtaywade82/dhanhq-ts">@shubhamtaywade82/dhanhq-ts</a>”;</p><p>const pipeline = new Pipeline({<br> provider: riskProviderFor(client),<br> limits: {<br> maxQuantity: 50,<br> dailyMaxLoss: 25_000,<br> maxPositions: 10,<br> maxConcentrationPct: 30,<br> },<br>});</p><p>// Throws RiskViolationError on first failure<br>await pipeline.run({ args: order, instrument });</p><p>// Or collect all violations for a preview/report<br>const { passed, violations } = await pipeline.report({ args: order, instrument });<br>```</p><p>The checks encode actual exchange rules:</p><p>- **Market hours** — rejects orders outside NSE/BSE sessions<br>- **ASM/GSM surveillance** — flags restricted securities<br>- **Concentration** — prevents single-symbol overexposure<br>- **Daily loss** — halts trading after your max loss threshold<br>- **Position limits** — caps total open positions<br>- **Options rules** — validates strike/expiry combinations<br>- **Product/exchange compatibility** — catches invalid segment+product combos</p><p>For account-level controls:</p><p>```typescript<br>// P&amp;L auto-exit (Dhan’s built-in feature, configured via API)<br>await client.traderControls.setPnlExit({<br> profitValue: 5_000,<br> lossValue: 2_500,<br> enableKillSwitch: true,<br> productType: [“INTRADAY”],<br>});</p><p>// Emergency kill switch<br>await client.traderControls.setKillSwitch(“ACTIVATE”);<br>```</p><p>— -</p><p>## MCP Server: Your Trading SDK as AI Agent Tools</p><p>This is the feature that makes DhanHQ TS different from every other broker SDK I’ve seen.</p><p>The package ships a [Model Context Protocol](<a href="https://modelcontextprotocol.io/">https://modelcontextprotocol.io/</a>) server that exposes the entire SDK as tools consumable by Claude, GPT, or any MCP-compatible LLM client:</p><p>```bash<br>DHAN_CLIENT_ID=… DHAN_ACCESS_TOKEN=… npx dhanhq-mcp<br>```</p><p>Claude Desktop configuration:</p><p>```json<br>{<br> “mcpServers”: {<br> “dhanhq”: {<br> “command”: “npx”,<br> “args”: [“-y”, “<a href="http://twitter.com/shubhamtaywade82/dhanhq-ts">@shubhamtaywade82/dhanhq-ts</a>”, “dhanhq-mcp”],<br> “env”: {<br> “DHAN_CLIENT_ID”: “your-client-id”,<br> “DHAN_ACCESS_TOKEN”: “your-token”,<br> “DHANHQ_AGENT_SCOPES”: “portfolio:read,market:read,orders:read”<br> }<br> }<br> }<br>}<br>```</p><p>The security model has two independent gates:</p><p>1. **Scope gate** — the policy must hold the required scope (`orders:write`, `risk:write`)<br>2. **Environment gate** — both `DHANHQ_MCP_ENABLE_WRITES=true` AND `LIVE_TRADING=true` must be explicitly set</p><p>An agent with `orders:write` scope still cannot place a trade unless you’ve explicitly opted into live trading via environment variables. And it can never touch the kill switch or P&amp;L controls — those require a separate `risk:write` scope.</p><p>Available tools include instrument search, LTP snapshots, option chains, order preview (validates + risk-checks without placing), order placement, holdings, funds, and emergency controls.</p><p>This means you can say to Claude: *”Check my NIFTY positions, compute the current P&amp;L, and if I’m down more than ₹5,000, show me the order I’d need to place to flatten.”* The agent uses the SDK tools, hits the risk pipeline, and shows you the preview — but cannot execute without your explicit environment configuration.</p><p>— -</p><p>## Architecture Decisions</p><p>A few choices worth calling out:</p><p>**Generated from OpenAPI.** The REST types are generated from DhanHQ’s published OpenAPI spec (`openapi.json` in the repo). When Dhan updates their API, regenerating types is a script run, not a manual audit.</p><p>**Dual ESM/CJS output.** Built with `tsup`. Works with `import` and `require`. Per-format `.d.ts` and `.d.mts` declarations. No `”type”: “module”` headaches.</p><p>**Rate limiting built in.** Uses `bottleneck` internally. You won’t accidentally hammer Dhan’s rate limits during a burst of order modifications.</p><p>**Zero runtime dependencies beyond essentials.** `axios`, `ws`, `zod`, `bottleneck`, `events`, `form-data`. No 200-package dependency tree.</p><p>**Composable trading skills.** Eleven pre-built strategy primitives (momentum entry, mean reversion, breakout, etc.) that compose with the risk pipeline and order tracker.</p><p>— -</p><p>## What It’s Not</p><p>Let me be direct about boundaries:</p><p>- **Not affiliated with Dhan.** This is an independent community project. Dhan publishes its own official clients.<br>- **Not a backtesting framework.** It’s an execution and data SDK. Bring your own backtester.<br>- **Not financial advice.** The analytics compute numbers. What you do with them is your responsibility.<br>- **Not battle-tested at institutional scale.** It’s production-grade in the sense that it handles errors, retries, rate limits, and edge cases correctly. It’s not been running a ₹100 crore book for three years.</p><p>— -</p><p>## Getting Started</p><p>```bash<br>npm install <a href="http://twitter.com/shubhamtaywade82/dhanhq-ts">@shubhamtaywade82/dhanhq-ts</a><br>```</p><p>```typescript<br>import { DhanClient } from “<a href="http://twitter.com/shubhamtaywade82/dhanhq-ts">@shubhamtaywade82/dhanhq-ts</a>”;</p><p>const client = new DhanClient({<br> token: process.env.DHAN_TOKEN!,<br> clientId: process.env.DHAN_CLIENT_ID!,<br>});</p><p>// Place an order<br>await client.orders.place({<br> dhanClientId: process.env.DHAN_CLIENT_ID!,<br> transactionType: “BUY”,<br> exchangeSegment: “NSE_FNO”,<br> productType: “INTRADAY”,<br> orderType: “MARKET”,<br> validity: “DAY”,<br> securityId: “44321”,<br> quantity: 15,<br> correlationId: “my-strategy-001”,<br>});</p><p>// Stream real-time data<br>await client.ws.connect();<br>client.ws.market.subscribe([<br> { exchangeSegment: “NSE_FNO”, securityId: “44321” },<br>]);<br>client.ws.market.on(“tick”, (t) =&gt; console.log(t.ltp));<br>```</p><p>Full documentation with guides for every module: [shubhamtaywade82.github.io/dhanhq-ts](<a href="https://shubhamtaywade82.github.io/dhanhq-ts/">https://shubhamtaywade82.github.io/dhanhq-ts/</a>)</p><p>— -</p><p>## Links</p><p>- **GitHub:** [github.com/shubhamtaywade82/dhanhq-ts](<a href="https://github.com/shubhamtaywade82/dhanhq-ts">https://github.com/shubhamtaywade82/dhanhq-ts</a>)<br>- **npm:** [npmjs.com/package/@shubhamtaywade82/dhanhq-ts](<a href="https://www.npmjs.com/package/@shubhamtaywade82/dhanhq-ts">https://www.npmjs.com/package/@shubhamtaywade82/dhanhq-ts</a>)<br>- **Documentation:** [shubhamtaywade82.github.io/dhanhq-ts](<a href="https://shubhamtaywade82.github.io/dhanhq-ts/">https://shubhamtaywade82.github.io/dhanhq-ts/</a>)<br>- **DhanHQ Official API Docs:** [dhanhq.co/docs/v2](<a href="https://dhanhq.co/docs/v2/">https://dhanhq.co/docs/v2/</a>)<br>- **DhanHQ API Community:** [community.dhanhq.co](<a href="https://community.dhanhq.co/">https://community.dhanhq.co/</a>)</p><p>— -</p><p>## What’s Next</p><p>The current version is **0.3.1**. The roadmap includes:</p><p>- Expanded global stocks coverage (US options)<br>- WebSocket reconnection with exponential backoff and state recovery<br>- Additional trading skills (pairs trading, volatility arbitrage)<br>- A React hooks package for dashboard builders<br>- OpenTelemetry instrumentation for order latency tracking</p><p>If you build algo trading systems in TypeScript and use Dhan as your broker, I’d genuinely appreciate a star on the [GitHub repo](<a href="https://github.com/shubhamtaywade82/dhanhq-ts">https://github.com/shubhamtaywade82/dhanhq-ts</a>), an install from [npm](<a href="https://www.npmjs.com/package/@shubhamtaywade82/dhanhq-ts">https://www.npmjs.com/package/@shubhamtaywade82/dhanhq-ts</a>), or a question in the issues. The SDK improves fastest when real trading systems stress-test its edges.</p><p>— -</p><p>*Shubham Taywade builds trading infrastructure in TypeScript and Ruby. He maintains the [DhanHQ TypeScript SDK](<a href="https://github.com/shubhamtaywade82/dhanhq-ts">https://github.com/shubhamtaywade82/dhanhq-ts</a>) and the [DhanHQ Ruby SDK](<a href="https://github.com/shubhamtaywade82/dhanhq-client).*">https://github.com/shubhamtaywade82/dhanhq-client).*</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04f84170fc27" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Introducing the DhanHQ Client Gem — A Complete Ruby SDK for Dhan’s Trading APIs]]></title>
            <link>https://medium.com/@shubhamtaywade82/introducing-the-dhanhq-client-gem-a-complete-ruby-sdk-for-dhans-trading-apis-00f055819071?source=rss-30626c49bba6------2</link>
            <guid isPermaLink="false">https://medium.com/p/00f055819071</guid>
            <dc:creator><![CDATA[Shubham Taywade]]></dc:creator>
            <pubDate>Sat, 11 Oct 2025 06:15:40 GMT</pubDate>
            <atom:updated>2025-10-11T06:15:40.105Z</atom:updated>
            <content:encoded><![CDATA[<p>🚀 Introducing the DhanHQ Client Gem — A Complete Ruby SDK for Dhan’s Trading APIs</p><p>&gt; Build trading, analysis, and automation systems with ease using Ruby &amp; Rails.</p><p>---</p><p>💡 Overview</p><p>Dhan provides powerful REST &amp; WebSocket APIs for Indian markets.<br>Ruby devs no longer need ad-hoc scripts—the DhanHQ gem delivers a clean, production-grade SDK with:</p><p>ORM-like models (Order, Position, Holding, etc.)</p><p>ActiveModel-style validations &amp; error exposure</p><p>REST coverage: Orders, Super/Forever Orders, Trades, Positions, Holdings, Funds/Margin, HistoricalData, OptionChain, MarketFeed</p><p>WebSockets: real-time market feed (:ticker, :quote, :full) and Order Update stream</p><p>Auto-reconnect, 429 cool-off, idempotent subscriptions, normalized ticks</p><p>Rails-ready services, workers, ActionCable wiring</p><p>Built-in TA (RSI/MACD/ADX/ATR) &amp; multi-timeframe analysis + CLI advisor</p><p>---</p><p>🧱 Features at a Glance</p><p>✅ ActiveRecord-style models: find, all, where, save, update, cancel<br>✅ Validations &amp; errors via ActiveModel-like interfaces<br>✅ Faraday HTTP + centralized error handler + rate limiter<br>✅ WebSocket market feed: subscribe/unsubscribe dynamically, auto-reconnect with backoff, 429 cool-off, binary header+payload parsing, normalized ticks<br>✅ Order Update WebSocket (SELF / PARTNER modes)<br>✅ Rails integration patterns (initializers, services, workers, ActionCable)<br>✅ TA &amp; Options Advisor CLIs</p><p>---</p><p>🧩 Installation</p><p>Gemfile (preferred during development):</p><p>gem &#39;DhanHQ&#39;, git: &#39;https://github.com/shubhamtaywade82/dhanhq-client.git&#39;, branch: &#39;main&#39;</p><p>Then:</p><p>bundle install</p><p>Or install globally:</p><p>gem install DhanHQ</p><p>---</p><p>⚙️ Basic Setup</p><p>require &#39;DhanHQ&#39;</p><p>DhanHQ.configure_with_env<br>DhanHQ.logger.level = (ENV[&#39;DHAN_LOG_LEVEL&#39;] || &#39;INFO&#39;).upcase.then { |lvl| Logger.const_get(lvl) }</p><p>Required ENV:</p><p>CLIENT_ID — Your Dhan trading client id</p><p>ACCESS_TOKEN — API access token</p><p>Optional overrides (set before configure_with_env):</p><p>DHAN_LOG_LEVEL, DHAN_BASE_URL, DHAN_WS_VERSION</p><p>DHAN_WS_ORDER_URL, DHAN_WS_USER_TYPE (SELF/PARTNER)</p><p>DHAN_PARTNER_ID, DHAN_PARTNER_SECRET (for PARTNER)</p><p>&gt; configure_with_env raises if required keys are missing.</p><p>---</p><p>📦 Example: Place / Modify / Cancel an Order</p><p>order = DhanHQ::Models::Order.new(<br> transaction_type: &quot;BUY&quot;,<br> exchange_segment: &quot;NSE_FNO&quot;,<br> product_type: &quot;MARGIN&quot;,<br> order_type: &quot;LIMIT&quot;,<br> validity: &quot;DAY&quot;,<br> security_id: &quot;43492&quot;,<br> quantity: 50,<br> price: 100.0<br>)<br>order.save # place</p><p>order.modify(price: 101.5) # modify<br>order.cancel # cancel</p><p>Other common calls:</p><p>orders = DhanHQ::Models::Order.all<br>positions = DhanHQ::Models::Position.all<br>holdings = DhanHQ::Models::Holding.all</p><p>---</p><p>🧮 Historical Data &amp; Option Chain</p><p>Intraday OHLC (5m, Index):</p><p>bars = DhanHQ::Models::HistoricalData.intraday(<br> security_id: &quot;13&quot;, # NIFTY index value<br> exchange_segment: &quot;IDX_I&quot;,<br> instrument: &quot;INDEX&quot;,<br> interval: &quot;5&quot;,<br> from_date: &quot;2025-08-14&quot;,<br> to_date: &quot;2025-08-18&quot;<br>)</p><p>Option Chain (nearest expiry):</p><p>chain = DhanHQ::Models::OptionChain.fetch(<br> underlying_scrip: 1333,<br> underlying_seg: &quot;NSE_FNO&quot;,<br> expiry: &quot;2025-08-21&quot;<br>)</p><p>---</p><p>📊 Market Feed (WebSocket)</p><p>Modes:</p><p>:ticker → LTP + LTT</p><p>:quote → OHLCV + totals (recommended default)</p><p>:full → Quote + OI + best-5 depth</p><p>Start, subscribe, stop:</p><p>require &#39;DhanHQ&#39;</p><p>DhanHQ.configure_with_env<br>ws = DhanHQ::WS::Client.new(mode: :quote).start</p><p>ws.on(:tick) do |t|<br> puts &quot;[#{t[:segment]}:#{t[:security_id]}] LTP=#{t[:ltp]} kind=#{t[:kind]}&quot;<br>end</p><p># ≤ 100 instruments per frame; client auto-chunks if needed<br>ws.subscribe_one(segment: &quot;IDX_I&quot;, security_id: &quot;13&quot;) # NIFTY index value<br>ws.subscribe_one(segment: &quot;IDX_I&quot;, security_id: &quot;25&quot;) # BANKNIFTY index value<br>ws.subscribe_one(segment: &quot;NSE_FNO&quot;, security_id: &quot;12345&quot;) # an option</p><p>ws.unsubscribe_one(segment: &quot;NSE_FNO&quot;, security_id: &quot;12345&quot;)</p><p>ws.disconnect! # graceful; no reconnect<br># ws.stop # hard stop<br># DhanHQ::WS.disconnect_all_local! # kill all local sockets</p><p>Normalized tick payload:</p><p>{<br> kind: :quote, # :ticker | :quote | :full | :oi | :prev_close | :misc<br> segment: &quot;NSE_FNO&quot;,<br> security_id: &quot;12345&quot;,<br> ltp: 101.5,<br> ts: 1723791300, # when present<br> vol: 123456, atp: 100.9, day_open: 100.1, day_high: 102.4, day_low: 99.5,<br> oi: 987654, bid: 101.45, ask: 101.55<br>}</p><p>Under the hood (per Dhan docs):</p><p>Subscribe codes: 15 (ticker), 17 (quote), 21 (full)</p><p>Unsubscribe: 16, 18, 22 | Disconnect: 12</p><p>Up to 5 WS connections per user</p><p>Exponential backoff + 60s cool-off on 429</p><p>Resubscribe snapshot after reconnect (idempotent)</p><p>---</p><p>🔔 Order Updates (WebSocket)</p><p>Receive live order lifecycle events (placed → traded → cancelled, etc.).</p><p>require &#39;DhanHQ&#39;</p><p>DhanHQ.configure_with_env<br>ou = DhanHQ::WS::Orders::Client.new.start</p><p>ou.on(:update) do |payload|<br> data = payload[:Data] || {}<br> puts &quot;ORDER #{data[:OrderNo]} #{data[:Status]} traded=#{data[:TradedQty]} avg=#{data[:AvgTradedPrice]}&quot;<br>end</p><p># Keep process alive (e.g., worker)<br># sleep<br># ou.stop</p><p>Or a quick one-liner:</p><p>DhanHQ::WS::Orders.connect { |payload| /* handle :update */ }</p><p>---</p><p>🧪 Example Integration in Rails</p><p>Initializer — config/initializers/dhanhq.rb:</p><p>require &#39;DhanHQ&#39;</p><p>if (c = Rails.application.credentials.dig(:dhanhq))<br> ENV[&#39;CLIENT_ID&#39;] ||= c[:client_id]<br> ENV[&#39;ACCESS_TOKEN&#39;] ||= c[:access_token]<br> ENV[&#39;DHAN_LOG_LEVEL&#39;] ||= c[:log_level]&amp;.upcase<br> ENV[&#39;DHAN_BASE_URL&#39;] ||= c[:base_url]<br> ENV[&#39;DHAN_WS_ORDER_URL&#39;] ||= c[:ws_order_url]<br> ENV[&#39;DHAN_WS_USER_TYPE&#39;] ||= c[:ws_user_type]<br> ENV[&#39;DHAN_PARTNER_ID&#39;] ||= c[:partner_id]<br> ENV[&#39;DHAN_PARTNER_SECRET&#39;] ||= c[:partner_secret]<br>end</p><p>DhanHQ.configure_with_env<br>DhanHQ.logger.level = Logger.const_get((ENV[&#39;DHAN_LOG_LEVEL&#39;] || &#39;INFO&#39;).upcase)</p><p>Service — app/services/dhan/orders/place_order.rb:</p><p>module Dhan<br> module Orders<br> class PlaceOrder<br> def initialize(params) = @params = params<br> def call<br> order = DhanHQ::Models::Order.new(@params)<br> order.save<br> rescue DhanHQ::Error =&gt; e<br> Rails.logger.error(&quot;Dhan order failed: #{e.message}&quot;)<br> raise<br> end<br> end<br> end<br>end</p><p>Market feed worker (Sidekiq) → ActionCable:</p><p>class Dhan::MarketFeedWorker<br> include Sidekiq::Worker<br> def perform(mode = :quote)<br> ws = DhanHQ::WS::Client.new(mode: mode.to_sym).start<br> ws.on(:tick) { |t| ActionCable.server.broadcast(&#39;market_feed&#39;, t) }<br> ws.wait! # block the worker thread while EM runs<br> end<br>end</p><p>Order update worker:</p><p>class Dhan::OrderUpdatesWorker<br> include Sidekiq::Worker<br> def perform<br> client = DhanHQ::WS::Orders::Client.new.start<br> client.on(:update) { |payload| OrderStatusUpdater.call(payload) }<br> client.wait!<br> end<br>end</p><p>Channel — app/channels/market_feed_channel.rb:</p><p>class MarketFeedChannel &lt; ApplicationCable::Channel<br> def subscribed<br> stream_from &#39;market_feed&#39;<br> end<br>end</p><p>Indices bootstrap + trailing guard (example):</p><p>INDICES = [<br> { segment: &quot;IDX_I&quot;, security_id: &quot;13&quot; }, # NIFTY<br> { segment: &quot;IDX_I&quot;, security_id: &quot;25&quot; } # BANKNIFTY<br>]</p><p>Rails.application.config.to_prepare do<br> $WS = DhanHQ::WS::Client.new(mode: :quote).start<br> $WS.on(:tick) do |t|<br> TickCache.put(t)<br> Execution::PositionGuard.instance.on_tick(t)<br> end<br> INDICES.each { |i| $WS.subscribe_one(**i) }<br>end</p><p>at_exit { DhanHQ::WS.disconnect_all_local! }</p><p>---</p><p>🧠 Option Chain + Market Feed (Live)</p><p># Fetch option chain (nearest expiry)<br>oc = DhanHQ::Models::OptionChain.fetch(<br> underlying_scrip: 1333, underlying_seg: &quot;NSE_FNO&quot;<br>)</p><p># Subscribe to your shortlist<br>strike_ids = oc[:options].first(5).map { |opt| opt[:security_id] }<br>ws.subscribe_one(segment: &quot;NSE_FNO&quot;, security_id: strike_ids.first)</p><p>Perfect for: scalpers, option-chain analyzers, live dashboards, trailing exits.</p><p>---</p><p>📎 Super Orders &amp; Forever Orders (GTT)</p><p>Super Order (example intent):</p><p>intent = {<br> exchange_segment: &quot;NSE_FNO&quot;,<br> security_id: &quot;12345&quot;, # option<br> transaction_type: &quot;BUY&quot;,<br> quantity: 50,<br> take_profit: 0.35, # 35% target<br> stop_loss: 0.18, # 18% SL<br> trailing_sl: 0.12 # 12% trail<br>}<br>DhanHQ::Models::SuperOrder.create(intent)</p><p>Forever Order (GTT):</p><p>DhanHQ::Models::ForeverOrder.create(<br> dhanClientId: &quot;123456&quot;,<br> transactionType:&quot;SELL&quot;,<br> exchangeSegment:&quot;NSE_EQ&quot;,<br> productType: &quot;CNC&quot;,<br> orderType: &quot;LIMIT&quot;,<br> validity: &quot;DAY&quot;,<br> securityId: &quot;1333&quot;,<br> price: 200.0,<br> triggerPrice: 198.0<br>)</p><p>---</p><p>📈 Technical Analysis &amp; Options Advisor (CLI)</p><p>Compute indicators across timeframes:</p><p>require &quot;ta&quot;<br>DhanHQ.configure_with_env</p><p>ta = TA::TechnicalAnalysis.new(throttle_seconds: 2.5, max_retries: 3)<br>indicators = ta.compute(<br> exchange_segment: &quot;NSE_EQ&quot;,<br> instrument: &quot;EQUITY&quot;,<br> security_id: &quot;1333&quot;,<br> intervals: [1, 5, 15, 25, 60]<br>)</p><p>Summarize multi-TF bias:</p><p>analyzer = DhanHQ::Analysis::MultiTimeframeAnalyzer.new(data: indicators)<br>summary = analyzer.call<br># =&gt; { summary: { bias: :bullish|:bearish|:neutral, setup: :buy_on_dip, confidence: 0.78, ... } }</p><p>CLI: Options Buying Advisor</p><p># Auto-fetch spot via MarketFeed + nearest-expiry chain<br>./bin/options_advisor.rb --segment IDX_I --instrument INDEX --security-id 13 --symbol NIFTY --debug</p><p>---</p><p>🧩 Error Handling (Granular)</p><p>All broker codes map to specific Ruby exceptions (e.g., InvalidAuthenticationError, RateLimitError, OrderError).</p><p>begin<br> order = DhanHQ::Models::Order.place(payload)<br> puts &quot;Order status: #{order.order_status}&quot;<br>rescue DhanHQ::InvalidAuthenticationError =&gt; e<br> warn &quot;Auth failed: #{e.message}&quot;<br>rescue DhanHQ::OrderError =&gt; e<br> warn &quot;Order rejected: #{e.message}&quot;<br>rescue DhanHQ::RateLimitError =&gt; e<br> warn &quot;Slow down: #{e.message}&quot;<br>end</p><p>---</p><p>⚡ Architecture Highlights</p><p>DhanHQ/<br>│── lib/<br>│ ├── DhanHQ.rb<br>│ ├── version.rb<br>│ ├── core/ # base_api, base_model, base_resource, error_handler<br>│ ├── models/ # order, position, holding, funds, ...<br>│ ├── resources/ # orders, portfolio, funds, market_feed, ...<br>│ ├── contracts/ # Dry::Validation contracts<br>│ ├── ws/ # WS::Client, WS::Orders<br>│ ├── analysis/ # TA, MultiTimeframeAnalyzer, advisor helpers<br>│ ├── helpers/ # api/attr/response/request helpers<br>│ └── errors/ # custom error classes</p><p>---</p><p>✅ Best Practices</p><p>Validate payloads locally (DhanHQ::Contracts::*) before batch calls</p><p>Use correlation_id for idempotent order placement</p><p>Keep WS on(:tick) non-blocking; push work to queue/worker</p><p>Prefer mode: :quote; use :full only when depth/OI is essential</p><p>≤ 100 instruments per SUB frame (client auto-chunks)</p><p>Use DhanHQ::WS.disconnect_all_local! before process exit</p><p>Respect rate limits; backoff on 429 (the client already cools off)</p><p>---</p><p>📜 Documentation &amp; Source</p><p>GUIDE: deep-dive API &amp; models mapping</p><p>Rails integration: initializers, workers, ActionCable, testing</p><p>Technical analysis: indicators, MTF analyzer, CLI advisor</p><p>GitHub: https://github.com/shubhamtaywade82/dhanhq-client</p><p>---</p><p>💬 Contributing</p><p>PRs welcome! Please include tests for new packet decoders and WS behaviors (chunking, reconnect, cool-off).</p><p>---</p><p>🙌 Acknowledgements</p><p>Thanks to DhanHQ API Team and the Ruby community for the docs and design patterns that inspired this SDK.</p><p>---</p><p>✍️ Author</p><p>Shubham Taywade — Full-Stack Developer &amp; Algo Trading Engineer<br>🔗 GitHub: https://github.com/shubhamtaywade82<br>🧠 Medium: @shubhamtaywade82</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=00f055819071" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>