Skip to content

docs(trade): add multi-leg option order docs - #1212

Merged
sunli829 merged 1 commit into
longbridge:mainfrom
liuyuhou-code:feature/multileg-docs
Aug 17, 2026
Merged

docs(trade): add multi-leg option order docs#1212
sunli829 merged 1 commit into
longbridge:mainfrom
liuyuhou-code:feature/multileg-docs

Conversation

@liuyuhou-code

Copy link
Copy Markdown
Contributor

1.新增多腿期权下单接口,订单查询/详情与 WebSocket 推送补充 multi_leg 字段。

1.新增多腿期权下单接口,订单查询/详情与 WebSocket 推送补充 multi_leg 字段。
@sunli829
sunli829 merged commit 070ca18 into longbridge:main Aug 17, 2026
2 checks passed
sunli829 added a commit to longbridge/openapi that referenced this pull request Aug 18, 2026
Add `TradeContext.submit_multileg` (POST /v1/trade/order/multileg) for
submitting multi-leg option combination orders (vertical spreads,
straddles, strangles, collars, etc.), where all legs are placed together
as a single strategy order.

Expose multi-leg strategy information on order queries and the order
push: `Order`, `OrderDetail`, and `PushOrderChanged` gain an optional
`multi_leg` field (`MultiLegInfo`), present only for multi-leg option
combination orders. Adds the `MultiLegStrategy`, `MultiLegPosition`, and
`ContractDirection` enums.

Implemented across all SDK layers: Rust core, C, C++, Java, Node.js, and
Python (incl. the openapi.pyi stub).

Also document in CLAUDE.md the full list of SDK layers that must be kept
in sync when adding an API or type.

Ref: longbridge/developers#1212
sunli829 added a commit to longbridge/openapi that referenced this pull request Aug 25, 2026
@
## Summary

Implements the multi-leg option order feature from
[longbridge/developers#1212](longbridge/developers#1212)
across **all six SDK layers** (Rust core, C, C++, Java, Node.js,
Python).

### New API

- **`TradeContext.submit_multileg`** → `POST /v1/trade/order/multileg` —
submit a multi-leg option combination order (vertical spreads,
straddles, strangles, collars, etc.) whose legs are placed together as a
single strategy order. Takes `side`, `order_type`, `submitted_quantity`,
`strategy` (`MultiLegStrategy`), a list of legs (`symbol` +
`ratio_quantity`), and optional `submitted_price` / `remark` /
`client_request_id`; returns the existing `SubmitOrderResponse`.

### New response field

- `Order` (`today_orders` / `history_orders`), `OrderDetail`
(`order_detail`), and the `PushOrderChanged` order-changed event gain an
optional **`multi_leg`** field (`MultiLegInfo`), present only for
multi-leg option combination orders — carrying `strategy`,
`strategy_name`, `multileg_id`, `code`, and the combination `legs` (each
with `symbol`, `side`, `position`, `ratio_quantity`, `strike_price`,
`expire_date`, `contract_direction`, `contract_size`).
- New enums: `MultiLegStrategy`, `MultiLegPosition`,
`ContractDirection`.

## Layers & verification

| Layer | Verification |
| --- | --- |
| Rust core | `cargo check` / `clippy --all --all-features` clean;
`cargo +nightly fmt` |
| C | `cargo build -p longbridge-c` (regenerates `longbridge.h`) |
| C++ | `g++ -std=c++17 -fsyntax-only` against regenerated header |
| Java | `cargo build -p longbridge-java` + full `javac` compile |
| Node.js | `npm run build:debug` (regenerates `index.d.ts` /
`index.js`) |
| Python | `cargo check`; `openapi.pyi` stub updated by hand |

## Notes

- Also documents in `CLAUDE.md` the full list of SDK layers that must be
kept in sync when adding an API or type (previously missing C++ and
Java).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sunli829 <20092316+sunli829@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants