Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add dhan-oss/dhanhq-skills --skill dhanhqgit clone --depth 1 https://github.com/dhan-oss/dhanhq-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/dhan-oss/dhanhq-skills/dhanhq)<a href="https://agentmods.dev/skills/dhan-oss/dhanhq-skills/dhanhq"><img src="https://agentmods.dev/badge/skills/dhan-oss/dhanhq-skills/dhanhq/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/dhan-oss/dhanhq-skills/dhanhq"><img src="https://agentmods.dev/badge/skills/dhan-oss/dhanhq-skills/dhanhq.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk warn
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00124 | $0.03020 |
| Opus 5 | $0.00062 | $0.01510 |
| Sonnet 5 | $0.00025 | $0.00604 |
| Haiku 4.5 | $0.00012 | $0.00302 |
Grade A, and why
dhanhq scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 320 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DhanHQ — Indian Market Trading Skill
Setup
Stable install:
pip install dhanhq
Use the current SDK branch when you need newer v2 capabilities such as 200-level depth or the latest helper coverage:
pip install --upgrade dhanhq
Minimal initialization:
from dhanhq import DhanContext, dhanhq
dhan_context = DhanContext("YOUR_CLIENT_ID", "YOUR_ACCESS_TOKEN")
dhan = dhanhq(dhan_context)
Environment-variable setup:
import os
from dhanhq import DhanContext, dhanhq
dhan_context = DhanContext(
os.environ["DHAN_CLIENT_ID"],
os.environ["DHAN_ACCESS_TOKEN"],
)
dhan = dhanhq(dhan_context)
If generating scripts for this repo, prefer:
from scripts.dhan_helpers import get_client
dhan, dhan_context = get_client()
Safety Rules — Always Enforce
- Confirm before placing live orders.
- Show a readable order preview before execution.
- Default to
LIMITorders unless the user explicitly wantsMARKET. - Warn when notional exceeds
Rs. 50,000. - For F&O, validate lot size before placement.
- Never use
CNCorMTFfor F&O, commodity, or currency segments. - Never hardcode credentials in generated code.
- Ask for confirmation before
modify_order,cancel_order,kill_switch, or any multi-leg live execution.
Access Checks Before Live Use
Before using the account for live work, verify:
- Access token is valid.
dhan_login.user_profile(...)orGET /profileshows the needed account setup.dataPlanis active for quote/history/feed/option-chain use.- Static IP is configured for order placement, order modification, order cancellation, super orders, and forever orders.
Useful profile fields:
tokenValidityactiveSegmentddpimtfdataPlandataValidity
Current SDK Constants
| Category | Constant | Value |
|---|---|---|
| Exchange | dhanhq.NSE |
NSE_EQ |
dhanhq.BSE |
BSE_EQ |
|
dhanhq.NSE_FNO |
NSE_FNO |
|
dhanhq.BSE_FNO |
BSE_FNO |
|
dhanhq.MCX |
MCX_COMM |
|
dhanhq.CUR |
NSE_CURRENCY |
|
dhanhq.INDEX |
IDX_I |
|
| Transaction | dhanhq.BUY |
BUY |
dhanhq.SELL |
SELL |
|
| Order Type | dhanhq.LIMIT |
LIMIT |
dhanhq.MARKET |
MARKET |
|
dhanhq.SL |
STOP_LOSS |
|
dhanhq.SLM |
STOP_LOSS_MARKET |
|
| Product | dhanhq.CNC |
CNC |
dhanhq.INTRA |
INTRADAY |
|
dhanhq.MARGIN |
MARGIN |
|
dhanhq.MTF |
MTF |
|
| Validity | dhanhq.DAY |
DAY |
dhanhq.IOC |
IOC |
What ships with it
27 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/fetch_option_chain.py 803 B runs code
- examples/gtt_forever_order.py 2.3 KB runs code
- examples/historical_data_analysis.py 1.7 KB runs code
- examples/iron_condor.py 3.5 KB runs code
- examples/live_feed_setup.py 1.2 KB runs code
- examples/margin_check.py 1.1 KB runs code
- examples/order_management.py 3.3 KB runs code
- examples/place_equity_order.py 875 B runs code
- examples/place_fno_order.py 1.8 KB runs code
- examples/portfolio_summary.py 2.0 KB runs code
- examples/super_order_with_sl.py 1.5 KB runs code
- references/backtesting-with-dhan.md 2.2 KB
- references/common-workflows.md 2.9 KB
- references/error-codes.md 3.8 KB
- references/funds.md 3.2 KB
- references/instruments.md 3.6 KB
- references/live-feed.md 4.5 KB
- references/market-data.md 5.3 KB
- references/option-chain.md 3.8 KB
- references/options-analysis-patterns.md 2.1 KB
- references/orders.md 5.9 KB
- references/portfolio.md 3.5 KB
- references/scanx-data.md 3.7 KB
- scripts/dhan_helpers.py 12 KB runs code
- scripts/resolve_security.py 5.2 KB runs code
- scripts/trade_logger.py 4.3 KB runs code
- scripts/validate_order.py 7.1 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 320 lines · 124 tokens per session scan A 4c495f6868c3
dhanhq is a skill published in the GitHub repository dhan-oss/dhanhq-skills (31 stars, last pushed 2mo ago), licensed MIT. It adds 124 tokens to every session and 3,020 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
sector-rotation
An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
chenhao-limit-up
A framework for judging Chinese A-share stocks that have reached the daily price-rise limit, using market mood, sector leadership, and trading momentum.
furusato
A Japanese hometown-tax donation manager for furusato nozei, a system where donations to municipalities can qualify for an income-tax or local-tax deduction. It reads donation receipts, stores donation records, and calculates deduction limits.
reading-receipt
An image-reading workflow for extracting structured information from receipts, invoices, and hometown-tax donation certificates. It can first extract text from PDFs and otherwise read their images.