Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

### Changed

- **Breaking:** `trade.FundPosition` — the fund identifier field is renamed from `Symbol` (which carried the ISIN) to `CounterID`, matching the Rust core and the fund channel. It now holds the full fund `counter_id` (e.g. `UT/FD/HK0000384492`); the ISIN is the last `/`-separated segment. The wire type reads the new `counter_id` key and still accepts the legacy `symbol` key during the transition.

## [v0.28.0] - 2026-09-28

### Breaking changes
Expand All @@ -20,6 +24,12 @@

### Added

- **Fund (mutual fund)** — new `fund.FundContext` for the fund channel (ports longbridge/openapi), mirroring the Rust core field-for-field across 28 methods:
- Catalog / market data: `HotFunds` (`GET /v1/fund/hot-funds`), `Funds` (`POST /v1/fund/funds`), `Filters` (`GET /v1/fund/filters`), `Detail` (`GET /v1/fund/funds/detail`), `Analysis` / `AnalysisDetail` / `Trend` / `PerformanceComparison` (`.../analysis`, `.../analysis/detail`, `.../trend`, `.../performance/comparison`), `AnnualReturns` / `QuarterlyReturns` (`.../returns/annual`, `.../returns/quarterly`), `Performance` (`.../performance`), `Nav` / `NavHistory` / `NavRange` (`.../nav`, `.../nav-history`, `.../nav-range`), `Holdings` (`.../holdings`) and `StockHoldings` (`.../stock-holdings`, reverse lookup)
- User positions: `Positions` (`GET /v1/asset/funds`), `Position` (`.../detail`), `PositionPerformance` / `PositionProfits` / `PositionNav` / `PositionDividends` (`.../performance`, `/profits`, `/nav-history`, `/dividends`)
- Orders & trading: `Orders` (`GET /v1/fund/orders`), `Order` (`GET /v1/fund/orders/{id}`), `Transactions` (`GET /v1/fund/transactions`), `ValidateOrder` (`POST /v1/fund/orders/validate`), `SubmitOrder` (`POST /v1/fund/orders`) and `CancelOrder` (`POST /v1/fund/orders/{id}/cancel`)
- The fund channel is the deliberate **exception** to the release-wide symbol migration above: funds are identified by `counter_id` (e.g. `UT/FD/HK0000384492`), which cannot be converted to a user symbol. Because it contains `/` it cannot sit in the URL path, so single-fund endpoints take it as a `counter_id` query parameter (fixed sub-paths like `/v1/fund/funds/detail`) rather than a path segment; the order request filter carries repeated `counter_id` query params. Three batch-backed endpoints — `Performance`, `Nav` and `PositionPerformance` — instead send the identifier as a one-element JSON array in a `counter_ids` query parameter, matching their backend contract
- Numeric `int64` fields use the string-tolerant `jsontypes.Int64` type (the backend may send them as a JSON number or a quoted string; empty / `null` become `0`); unix-second timestamps are `int64`; nested response objects the backend may return as `null` (`FundDetail.AssetAllocation`, `FundTrend.ContrastPerformances`, `FundPositionDetail.DetailValues`, `FundOrderDetail.Order`) are modeled as pointers so those responses deserialize instead of erroring on `null`; server-defined "any" structures (fund filters, analysis ability/cost blocks, trend / comparison performance series) are preserved as `json.RawMessage`
- **Grid trading** — new `grid.GridContext` for grid-order management: `Submit` / `Replace` / `Cancel` / `Suspend` / `Restart` grid orders, `List` (paged) and `ListByIds`, `Detail` and `TriggerHistory`, `SubmitStrategyQuestionnaire` (strategy risk-disclosure), and `SymbolInfo` (returns `GridSymbolInfo`: name, last price, lot sizes, price-step rules, channel/authorization) — the security info needed to build a grid order
- **Multi-leg option orders** (ports longbridge/openapi #575, #589, #590) — new `TradeContext.SubmitMultiLeg` (`POST /v1/trade/order/multileg`) submits a multi-leg option combination order (vertical spreads, straddles, strangles, collars, calendar spreads, etc.) whose legs are placed together as a single strategy order. Takes `Side`, `OrderType`, `SubmittedQuantity`, `Strategy` (`MultiLegStrategy`), a list of `SubmitMultiLegOrderLeg` (`Symbol` + `RatioQuantity`), and optional `SubmittedPrice` / `Remark` / `ClientRequestId`; returns the order ID like `SubmitOrder`. `Order`, `OrderDetail`, and the `PushOrderChanged` order-changed push gain an optional `MultiLeg *MultiLegInfo` field — present only for multi-leg orders — carrying `Strategy`, `StrategyName`, `MultilegId`, `Code`, and the combination `Legs` (each with `Symbol`, `Side`, `Position`, `RatioQuantity`, `StrikePrice`, `ExpireDate`, `ContractDirection`). New enums `MultiLegStrategy` (`CoveredCall` … `Strangle`, plus `CalendarCallSpread` / `CalendarPutSpread`), `MultiLegPosition` (`LONG` / `SHORT`), and `ContractDirection` (`C` / `P`)

Expand Down
Loading