Skip to content

feat(amm): headless amm_module core Logos module; flip UI to consume it#232

Draft
0x-r4bbit wants to merge 12 commits into
mainfrom
feat/amm-logos-module
Draft

feat(amm): headless amm_module core Logos module; flip UI to consume it#232
0x-r4bbit wants to merge 12 commits into
mainfrom
feat/amm-logos-module

Conversation

@0x-r4bbit

Copy link
Copy Markdown
Collaborator

Introduce modules/amm — the AMM business logic (resolvePool, swapExactInput, tokenList) as a universal core Logos module that wraps amm_client_ffi and depends on the logos_execution_zone wallet module. The same surface is now consumed by the QML UI (via modules().amm_module) and headlessly (logoscore call amm_module ...).

  • apps/amm: drop the direct amm_client_ffi link; depend on and delegate to amm_module (metadata dependencies, CMakeLists, AmmUiBackend). Wallet-session UI logic stays in the backend.
  • flake.nix: build amm_module via mkLogosModule and inject it into the UI builder's flakeInputs so the dependency resolves.
  • amounts/deadline declared nlohmann::json so the generated dispatch accepts a JSON number (bare small ints on the CLI) or a string (exact u128 from the UI, or a quote-wrapped big value on the CLI); JSON floats are rejected rather than submit a silently-rounded amount.
  • AMM_DEBUG-gated tracing for the swap path.
  • modules/amm/README.md: headless prerequisites + full logoscore recipe.

gravityblast and others added 12 commits July 16, 2026 14:14
Introduce modules/amm — the AMM business logic (resolvePool, swapExactInput,
tokenList) as a universal core Logos module that wraps amm_client_ffi and
depends on the logos_execution_zone wallet module. The same surface is now
consumed by the QML UI (via modules().amm_module) and headlessly
(logoscore call amm_module ...).

- apps/amm: drop the direct amm_client_ffi link; depend on and delegate to
  amm_module (metadata dependencies, CMakeLists, AmmUiBackend). Wallet-session
  UI logic stays in the backend.
- flake.nix: build amm_module via mkLogosModule and inject it into the UI
  builder's flakeInputs so the dependency resolves.
- amounts/deadline declared nlohmann::json so the generated dispatch accepts a
  JSON number (bare small ints on the CLI) or a string (exact u128 from the UI,
  or a quote-wrapped big value on the CLI); JSON floats are rejected rather than
  submit a silently-rounded amount.
- AMM_DEBUG-gated tracing for the swap path.
- modules/amm/README.md: headless prerequisites + full logoscore recipe.
@0x-r4bbit
0x-r4bbit requested a review from gravityblast July 22, 2026 11:57
@0x-r4bbit
0x-r4bbit force-pushed the feat/amm-swap-onchain branch from 1fd73f8 to 7f17e06 Compare July 23, 2026 11:32
@0x-r4bbit
0x-r4bbit changed the base branch from feat/amm-swap-onchain to main July 23, 2026 17:55
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