Skip to content

Orders place: dry run accepts orders that are incomplete as written #9

Closed

Description

@azeeb

Summary

kite orders place prints a dry run and exits 0 for orders that cannot be placed as written, such as an SL order with no trigger price. The TUI order ticket refuses the same inputs. A script or agent that relies on the dry run as its check gets a pass for an order that cannot succeed.

Steps to reproduce

No login is needed. On main at ee3bf08 (v0.2.2):

kite orders place --exchange NFO --tradingsymbol NIFTY26NOVFUT \
  --transaction-type BUY --product NRML --order-type SL --quantity 75

Expected

The command fails before the dry run with a clear error and a non-zero exit code, as the TUI ticket does ("trigger price must be a positive number").

Actual

Exit code 0, and no price or trigger_price in the request:

DRY RUN  nothing was sent to Kite
BUY 75 NFO:NIFTY26NOVFUT  SL  NRML

POST /orders/regular
exchange          NFO
tradingsymbol     NIFTY26NOVFUT
transaction_type  BUY
order_type        SL
quantity          75
product           NRML
hint: add --confirm to place the order

The same happens for:

  • LIMIT with no --price
  • --quantity 0 and --quantity=-75
  • --variety iceberg with no --iceberg-legs
  • --validity TTL with no --validity-ttl

Cause

order_place_params in src/util.rs (line 153) copies each flag into the request without checking the flags against each other. The TUI ticket does check them in src/tui/ticket.rs: regular_prices (line 1444), parse_qty (line 970) and the iceberg leg rule (line 1405).

Notes

I have not confirmed how the Kite API responds to these orders, and no live order was placed. Fix proposed in #8.

Activity

  1. changed the title [-]orders place: dry run accepts orders that are incomplete as written[/-] [+]Orders place: dry run accepts orders that are incomplete as written[/+] on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions