Repository navigation
feat(forex): add ForexContext for the currency-exchange channel (all layers) - #602
Open
hogan-yuan wants to merge 10 commits into
Open
hogan-yuan wants to merge 10 commits into
hogan-yuan wants to merge 10 commits into
Conversation
This was referenced Oct 8, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New
ForexContextfor the currency-exchange (forex) channel — 3 endpoints(quote / submit / query) — across all six SDK layers: Rust core (async +
blocking), C, C++, Java, Node.js, Python. Mirrors RFC-2026-0012 Appendix A.
Flow is three-step and asynchronous:
quote(POST /v1/forex/quote) →rate+quote_idsubmit_order(POST /v1/forex/order) → accepted only (returns nothing)order(GET /v1/forex/order) → poll byclient_order_idto a terminal stateDesign notes
ForexOrderStatusis an integer-coded enum (Processing=0/Success=1/Failed=2), following the repo's existingnum_enum+ manual Serialize/Deserializepattern; unknown values default to
Processing.Decimal(matching the trade channel). The query response'srate/from_amount/to_amountare nullable — they arrive as emptystrings until the order is filled, decoded via the existing
serde_utils::decimal_opt_empty_is_nonehelper.rateconvention: standard currency pair (1 BASE = rate QUOTE), independentof the request's from/to direction;
ccy_pairnames the pair,expire_atis Unix ms.submit_orderreturns()— acceptance ≠ settlement; the idempotency contract(reuse same
client_order_idon retry; eachquote_idusable once →603006) isdocumented on the method.
OpenApiError),consistent with the rest of the repo.
async napi/PyO3 can't take a
Decimalinput directly; Python'sfromarg isfrom_.Related (follow-ups, separate repos)
CLI / MCP / Docs are tracked separately, as with FundContext (#598).