Skip to content

Commit 2b78a19

Browse files
byshingclaude
andcommitted
docs: address Copilot review comments on tick/lot size guidance
- Fix variable extraction: assign tickSize/lotSize to shell vars before using in rounding snippets (CONTEXT.md, AGENTS.md, CLAUDE.md) - Correct --validate description: local JSON preview only, no exchange-side price/qty validation (CONTEXT.md, AGENTS.md) - Add --yes to live order example and note it's required for agent use (AGENTS.md, CLAUDE.md) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent b33015e commit 2b78a19

3 files changed

Lines changed: 17 additions & 11 deletions

File tree

AGENTS.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ Every instrument enforces a minimum price increment (`tickSize`) and minimum qua
280280
Fetch constraints before placing:
281281

282282
```bash
283-
bitmex market instrument --symbol XBTUSD -o json | jq '.[0] | {tickSize, lotSize}'
283+
constraints=$(bitmex market instrument --symbol XBTUSD -o json | jq '.[0] | {tickSize, lotSize}')
284+
tick_size=$(echo "$constraints" | jq -r '.tickSize')
285+
lot_size=$(echo "$constraints" | jq -r '.lotSize')
284286
```
285287

286288
Round before submitting:
@@ -295,13 +297,13 @@ qty=$(echo "$raw_qty $lot_size" | awk '{printf "%g", int($1/$2)*$2}')
295297
### Safe order placement workflow
296298

297299
```bash
298-
# 1. Fetch tick/lot constraints
299-
bitmex market instrument --symbol XBTUSD -o json | jq '.[0] | {tickSize, lotSize}'
300+
# 1. Fetch tick/lot constraints and align price/qty before submitting
301+
constraints=$(bitmex market instrument --symbol XBTUSD -o json | jq '.[0] | {tickSize, lotSize}')
300302

301-
# 2. Validate (catches price/qty alignment errors before submission)
303+
# 2. Preview the constructed request body (local only — does not validate against exchange)
302304
bitmex order buy XBTUSD 100 --price 50000 --validate -o json
303305

304-
# 3. Confirm with user, then execute
306+
# 3. Confirm with user, then execute (--yes skips interactive prompt for agent use)
305307
bitmex order buy XBTUSD 100 --price 50000 --yes -o json
306308
```
307309

CLAUDE.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,15 @@ Prices must be multiples of `tickSize`; quantities must be multiples of `lotSize
9595

9696
```bash
9797
# Fetch constraints
98-
bitmex market instrument --symbol XBTUSD -o json | jq '.[0] | {tickSize, lotSize}'
98+
constraints=$(bitmex market instrument --symbol XBTUSD -o json | jq '.[0] | {tickSize, lotSize}')
99+
tick_size=$(echo "$constraints" | jq -r '.tickSize')
100+
lot_size=$(echo "$constraints" | jq -r '.lotSize')
99101

100-
# Validate first
102+
# Preview request body (local dry-run only — no exchange-side validation)
101103
bitmex order buy XBTUSD 100 --price 50000 --validate -o json
102104

103-
# Then execute (requires user confirmation)
104-
bitmex order buy XBTUSD 100 --price 50000 -o json
105+
# Execute (--yes required for non-interactive/agent use)
106+
bitmex order buy XBTUSD 100 --price 50000 --yes -o json
105107
```
106108

107109
### Testnet

CONTEXT.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ bitmex ws --auth position order execution
200200
Before placing an order, fetch the instrument's constraints:
201201

202202
```bash
203-
bitmex market instrument --symbol XBTUSD -o json | jq '.[0] | {tickSize, lotSize}'
203+
constraints=$(bitmex market instrument --symbol XBTUSD -o json | jq '.[0] | {tickSize, lotSize}')
204+
tick_size=$(echo "$constraints" | jq -r '.tickSize')
205+
lot_size=$(echo "$constraints" | jq -r '.lotSize')
204206
```
205207

206208
| Field | Meaning | Violation error |
@@ -217,7 +219,7 @@ price=$(echo "$raw_price $tick_size" | awk '{printf "%g", int($1/$2+0.5)*$2}')
217219
qty=$(echo "$raw_qty $lot_size" | awk '{printf "%g", int($1/$2)*$2}')
218220
```
219221

220-
`--validate` catches these errors before the order reaches the exchange.
222+
`--validate` is a local dry-run that prints the constructed order JSON without submitting to the exchange. It does not perform server-side price/qty validation — alignment must be correct before live submission.
221223

222224
## MCP Server
223225

0 commit comments

Comments
 (0)