Skip to content

feat(py): Add scale order support#485

Merged
kzdydx merged 5 commits into
mainfrom
feature/py-scale-orders
Apr 27, 2026
Merged

feat(py): Add scale order support#485
kzdydx merged 5 commits into
mainfrom
feature/py-scale-orders

Conversation

@alexey-kichin
Copy link
Copy Markdown
Contributor

Summary

  • Add place_scale_order() method to NodeClient that places multiple limit orders distributed across a price range
  • Includes input validation (num_orders, price range, size)
  • Add testnet integration tests with self-supplied liquidity (two-wallet pattern)
  • Add runnable example (examples/scale_order_example.py)

Test plan

  • Validation tests pass locally (no testnet needed): test_scale_order_validates_*
  • Testnet integration: test_scale_order_place_and_verify places BUY orders below oracle, verifies on indexer
  • Testnet integration: test_scale_order_sell_place_and_verify places SELL orders above oracle, verifies on indexer
  • Run example script against testnet: python examples/scale_order_example.py

🤖 Generated with Claude Code

alexey-kichin and others added 5 commits April 2, 2026 00:17
Add place_scale_order() method to NodeClient that distributes multiple
limit orders across a price range. Includes validation, testnet tests
with self-supplied liquidity, and a runnable example.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Temporarily disable the sequence manager during rapid successive
broadcasts to prevent stale sequence queries from overwriting the
locally incremented sequence number. Also add settle delay in tests
before refreshing wallet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align scale order implementation with dYdX frontend (v4-web):
- Rename price_low/price_high to start_price/end_price
- Add skew parameter for geometric price distribution
  (skew=1 linear, >1 concentrates toward start, <1 toward end)
- Add unit tests for _generate_skewed_prices
- Add skew validation test and testnet integration test with skew=2.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When testnet has no liquidity, the market order doesn't fill and the
indexer returns a stale fill without orderRouterAddress. Skip instead
of failing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-kichin alexey-kichin marked this pull request as ready for review April 13, 2026 09:02
@alexey-kichin alexey-kichin requested review from a team as code owners April 13, 2026 09:02
@kzdydx kzdydx merged commit e761be3 into main Apr 27, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants