The table told a reader to add chain 96370 at api.testnet.lux.network and
to browse testnet.explorer.lux.network. All three values were wrong:
testnet is 96368 (api.lux-test.network answers 0x17870), and neither
hostname resolves at all. This is the page that tells users what to paste
into a wallet, so a wrong chain ID here sends funds to a chain that does
not exist.
Verified live: mainnet 0x17871 (96369), testnet 0x17870 (96368);
explore.lux-test.network and explorer.lux.network both 200.
Co-authored-by: Hanzo Dev <[email protected]>
luxd serves exactly one HTTP prefix. server/http/server.go:33 sets
baseURL = "/v1"; addRoute and AddAliases derive every path from it and
router.go mounts chains at baseURL+"/bc/C/rpc". /ext/* 404s everywhere.
The pkg/dchain package comments were the load-bearing part: ingest.go,
read.go, vm.go, read_test.go, ingest_test.go and zapingest.go all told
the reader that luxd mounts the DEX handlers at /ext/bc/<chainID>/dex/<m>.
That is the URL an integrator would build, and it 404s. The handlers are
at /v1/bc/<chainID>/dex/<m>.
zapingest.go said "/ext/bc route" with no trailing slash, so it does not
match an /ext/bc/ search -- searching for the whole prefix found it.
Also covers /ext/info, /ext/health and /ext/admin in the two local-network
scripts and in docs/source/node.mdx: baseURL applies to those routes too,
so swapping only the /bc/ ones would leave the scripts half broken.
Measured, positive and negative control on one host:
api.lux.network/v1/bc/C/rpc -> 200 {"result":"0x17871"} /ext -> 404
api.lux.network/v1/info -> 200 {"networkID":"1"} /ext -> 404
api.lux.network/v1/health -> 405 (exists, GET-only) /ext -> 404
go build + go vet clean on pkg/dchain, pkg/price, internal/standalone.
go test ./pkg/dchain/... ok 5.855s; go test ./pkg/price -run QChain ok 1.950s.
bash -n clean on both scripts. The repo-wide `go build ./...` was already
failing before this change on cgo packages that need luxcpp and libresolv.
Co-authored-by: Hanzo Dev <[email protected]>
The docs job died at INSTALL, before any of the rest was visible:
postinstall: hanzo-mdx
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@hanzo/docs-core'
This package was mid-migration to the @hanzo toolchain and several pieces were
simply never finished. Each one only became visible once the one before it was
fixed, so they are listed in the order they surfaced:
1. @hanzo/docs-core undeclared — @hanzo/mdx imports it, so postinstall crashed.
2. `hanzo-mdx` with NO ARGUMENTS reports "generated files" and writes nothing.
It needs `source.config.ts .source`, the form luxfi/consensus uses. Both the
build and postinstall scripts were bare.
3. zod ^3 — @hanzo/mdx 14.2.x calls `z.looseObject`, which is zod 4:
`TypeError: z.looseObject is not a function`. Nothing in docs/ imports zod
directly (0 files), so it exists only for this toolchain; moved to ^4.2.1,
matching mpc which runs the same generator.
4. `import { docs } from "@/.source"` is a DIRECTORY import and the generator
emits no index — it writes browser/dynamic/server.ts. Now "@/.source/server".
5. @hanzo/docs undeclared — next.config.mjs imports @hanzo/docs/mdx/next.
6. app/global.css imported `fumadocs-ui/style.css`, an upstream package that is
not a dependency here. Now @hanzo/docs-ui/style.css, as consensus has it.
7. RootProvider, DocsLayout, DocsPage and defaultMdxComponents were imported
from `@hanzo/ui`, which exports NONE of them — checked at runtime, all five
names including `loader` come back undefined. That is the
"Element type is invalid … got: undefined" build failure. They live in
@hanzo/docs-ui, where consensus already gets them.
8. docs.toFumadocsSource() does not exist on the @hanzo runtime; loader now
comes from @hanzo/docs/core/source with toSource().
9. react-day-picker, react-resizable-panels and flexsearch were undeclared
peers. PINNED to what @hanzo/ui asks for (^9, ^2) — installing latest gives
react-resizable-panels 4, where `PanelGroup` no longer exists.
Verified as a fresh checkout would run it, with node_modules and .source deleted:
pnpm install --frozen-lockfile OK (was ERR_MODULE_NOT_FOUND)
.source after install generated by postinstall
pnpm build OK
Co-authored-by: Hanzo Dev <[email protected]>
The matching engine (pkg/lx, 45.5K LOC incl. tests) and the deterministic
core layered on it (pkg/dex) are one matcher spread across two packages
(dex imported lx in 12 files; lx imported neither). Fold lx into dex and
drop the "lx" name entirely — pkg/dex is now the single matcher package.
Pure rename/fold, ZERO logic change. Behavior proven identical: the merged
pkg/dex runs 457 top-level tests (431 former-lx + 26 former-dex) and 489
test funcs (468 + 21), all green — matching, batch (BatchMatchEqualsSequential,
run-to-run determinism, tile boundary), GPU/CPU parity, truncation, and CL
swap math all pass unchanged.
What moved:
- git mv all 101 pkg/lx/*.go + 1 .c into pkg/dex/ (package lx -> package dex).
- lx's swap_test.go -> swap_math_test.go (only filename collision with dex's
existing swap_test.go).
- Rewrote imports repo-wide: 54 pkg/lx import lines removed; 42 external
importers (api, client, consensus, dchain, dpdk, lxgpu, marketdata, test/,
tests/) repointed to pkg/dex with lx.X -> dex.X; the 12 in-package dex files
had lx.X -> bare X. 717 selector lines rewritten. Stale pkg/lx comment refs
updated (pkg/lxgpu left intact).
Collisions resolved (2, both package-level vars):
- ErrNoLiquidity: lx's pool-level error (dexError, used only in swap.go, never
referenced via qualifier) renamed ErrPoolNoLiquidity to match the existing
ErrPool* convention; dex's router-level ErrNoLiquidity (public, has errors.Is
tests) kept.
- priceMultiplierBig: identical after fold (both big.NewInt(PriceMultiplier));
deduped by deleting dex's copy.
Not folded — pkg/orderbook: it is NOT the GPU seam (that is orderbook_gpu.go,
which lives in the engine and folded in here). pkg/orderbook is a zero-importer,
placeholder-cgo island whose 13 core domain identifiers (Order, OrderBook, Trade,
OrderType, OrderStatus, PriceLevel, Buy, Sell, Market, Limit, Filled,
PartiallyFilled, NewOrderBook) collide incompatibly with the engine's. Folding
it verbatim breaks the build; folding via rename reintroduces the exact parallel
duplication this fold removes. Left for owner decision (recommend deletion as
dead code) — see refactor notes.
Follow-on (separate repos, not touched): 19 files under luxfi/dex import
pkg/lx externally — lux/precompile/dex, lux/precompile-dex/dex,
lux/consensus/examples/01-simple-bridge, lux/_consensus-v12537/examples,
lux/cex/pkg/engine — repoint to pkg/dex after this lands.
Verified: CGO_ENABLED=0 GOWORK=off go build ./... clean; go vet ./... clean;
go test ./... -count=1 all green (22 ok / 0 fail).
Co-authored-by: Hanzo Dev <[email protected]>
Decentralized exchange; the engine acts like an order book but is decentralized,
so 'Central Limit Order Book' is a misnomer. Branded/service surface → DEX
(RegisterDEX, DEXMethod*, dex_* wire). Matching engine + GPU → OrderBook
(OrderBookMatch/Source/Arena, source_orderbook.go), preserving the AMM-vs-orderbook
distinction. C-ABI → dex_orderbook_* (matches luxcpp). SDKs/clients/docs aligned.
CGO=0 + cgo builds clean; full suite 23 pkgs green (dchain/dex/lx/fix/gateway/zapwire).
Legit financial-term 'Central Limit Order Book' retained in hummingbot taxonomy.
Reword comparison docs, comments, and design prose to Lux's own terms
(native DEX core, EVM adapter / 0x9999 V4 PoolManager, native HFT surface,
one consensus-finalized C+D transition). Rename the test broker-venue label
and oracle source weight to neutral names. Behavior-preserving: no logic,
ABI, or wire format changes.
SubmitMarketable and MatchOrders derived their returned fills by re-slicing
the shared trade log (ob.Trades[startOffset:]) with an offset captured BEFORE
matching. ob.Trades self-truncates at 100k entries (keeps the last 50k), so a
match that crosses that boundary mid-match trims the log and leaves the
pre-match offset pointing past the end -> panic 'slice bounds out of range'.
The log feeds settlement, so fills had to stay exact.
tryMatchImmediateLocked / MatchOrders now capture each fill as it is produced,
independent of ob.Trades, and return that slice. Decomplects 'this match's
fills' (a value the caller needs) from 'the trade log' (a bounded-retention
buffer): correct across the truncation boundary by construction, deterministic
across validators.
Adds orderbook_truncation_test.go: three regression cases that cross the
boundary through the production match path (single submits, one sweeping
submit, legacy MatchOrders) with exact-fill and value-conservation asserts.
They panic on the old code, pass on the fixed code. No sleeps, no stubs.
Also: 0x9999 D-matches/C-settles docs (LLM.md, README, ARCHITECTURE),
venue-canonical naming, fourpath-live proof tool, drop dead snowman-api key
from run-lux-testnet.sh.
Follow-up to 09c17ec which deleted the orphaned C++ trees.
Workflows + docs + sdk/Makefile still referenced them.
.github/workflows/sdk-ci.yml delete test-cpp job + drop from integration-check.needs
.github/workflows/sdk-release.yml delete build-cpp job + drop from generate-checksums.needs
sdk/Makefile delete build-cpp + test-cpp targets, clean ref
sdk/README.md repoint cpp row to ~/work/luxcpp/dex/sdk/trading-cpp/
docs/content/docs/sdk/cpp/ delete (sdk source moved; doc to be re-authored from luxcpp)
Also fixes the stale amm_gpu.go docstring (kernel moved to
~/work/luxcpp/metal/src/shaders/dex/, driver stays in dex/gpu/metal/).
Comprehensive documentation covering US (SEC), UK (FCA), and Singapore
(MAS) regulatory frameworks with code examples for eligibility checking,
settlement handling, and transfer restrictions.
- Update mdx-components to import from @hanzo/ui/content (general)
- Keep TypeTable import from @hanzo/ui/docs/components (docs-specific)
- Update @hanzo/ui to ^5.3.26
Consolidate to single @hanzo/docs package with subpath exports:
- @hanzo/docs/core/* for core functionality
- @hanzo/docs/ui/* for UI components
- @hanzo/docs/mdx/* for MDX processing
Uses hanzo-docs CLI instead of fumadocs-mdx for build commands.
Use Hanzo's own documentation framework fork for better integration
with existing @hanzo/ui components and consistent theming.
- Replace fumadocs-core with @hanzo/docs-core
- Replace fumadocs-ui with @hanzo/docs-ui
- Replace fumadocs-mdx with @hanzo/docs-mdx
- Add releases section with v1.2.1 link
- Update installation to use GitHub (not yet on npm/PyPI/crates)
- Add full Rust, C++, and C SDK documentation
- Include code examples for all 7 languages
- Add linking instructions for C/C++ (CMake, pkg-config)
- Update all SDK examples to use `import { DEX } from '@luxfi/trading'`
- Replace LXDexClient with Client, jsonRpcUrl with rpcUrl throughout
- Rename architecture/sidecar.mdx to l2-chain.mdx
- Describe LX as a dedicated Lux L2 chain that shares consensus/finality
- Document validator staking requirements for DEX node operators
- Clarify relationship to Lux L1, B-Chain bridge, and C-Chain settlement
- Update 31 documentation files with consistent patterns
- Add simple factory functions DEX() and AMM() for single-venue clients
- Update TypeScript SDK docs to use cleaner imports
- Update trading docs examples to use @luxfi/trading package
- Align all documentation with actual SDK exports
The new exports provide a simpler API:
import { DEX, AMM } from '@luxfi/trading'
const dex = await DEX({ rpcUrl: '...' })
- Add fees.mdx with complete fee schedule, tiers, and discounts
- Add limits.mdx with position, rate, and withdrawal limits
- Add margin.mdx with leverage and margin mode documentation
- Add perpetuals.mdx with comprehensive perp trading guide
- Fix broken options link in trading index
- Update meta.json with new navigation items
Apply consistent naming conventions throughout:
- Standardize product name to "LX" in documentation
- Update README files and API documentation
- Apply linter fixes to all source files
- Update Hummingbot connector documentation
Add official Hummingbot Gateway connector enabling algorithmic trading on
LX DEX. The connector supports all four trading schemas:
- Router: DEX aggregation with optimal swap routing
- AMM: Traditional xy=k liquidity pool operations
- CLMM: Concentrated liquidity market maker positions
- CLOB: Central limit order book trading
Includes:
- Full connector implementation with WebSocket support
- Fastify route handlers for all endpoints
- Plugin package for easy Gateway integration
- Comprehensive API documentation
- Quick start and strategy guides
- Jest test suite
- Remove duplicate orderbook from Core Concepts (engine/ folder covers it)
- Single API Reference entry instead of folder expansion
- SDK Guide shows each language as separate entry
- Escape < characters followed by numbers (e.g., <100ns becomes <100ns)
- Convert Tabs/Tab JSX components to markdown headers for compatibility
- Convert Cards/Card JSX components to markdown links
- Update mdx-components.tsx to include all fumadocs-ui components
- These fixes resolve MDX build errors in GitHub Actions
Clean architecture following Go principles:
- factory.go: Pure Go implementation (default, no CGO)
- factory_cgo.go: C++ optimized version when CGO=1
- orderbook.go: Standalone Go orderbook implementation
- cpp_orderbook.go: C++ bindings for high performance
Also includes:
- Vault execution integration with orderbook
- dex-api-server command for REST/WebSocket API
- E2E test scripts for API validation
- Documentation site scaffolding
- Created detailed DEVELOPMENT.md guide for contributors
- Added complete ARCHITECTURE.md with system design
- Documented data flow, performance optimizations, and scalability
- Added debugging, profiling, and monitoring guides
- Included deployment strategies and troubleshooting
- All documentation complete with examples and diagrams
- Added Dockerfile and docker-compose.yml for containerization
- Created comprehensive API documentation
- Added integration test suite
- Set up performance benchmarking workflow
- Added security scanning workflow
- Configured code coverage reporting with Codecov
- Updated README with current metrics
- All CI/CD pipelines configured and passing