Skip to content

feat: Create Pool view#210

Open
0x-r4bbit wants to merge 19 commits into
mainfrom
feat/amm-pool-creation
Open

feat: Create Pool view#210
0x-r4bbit wants to merge 19 commits into
mainfrom
feat/amm-pool-creation

Conversation

@0x-r4bbit

Copy link
Copy Markdown
Collaborator

This is a Work in progress

Addresses #30

3esmit
3esmit previously requested changes Jun 30, 2026
Comment thread apps/amm/result Outdated
Comment thread apps/amm/src/AmmUiBackend.cpp Outdated
Comment thread apps/amm/qml/components/wallet/CreateWalletDialog.qml Outdated
Comment thread apps/amm/qml/components/wallet/AccountControl.qml Outdated
@3esmit

3esmit commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Still work in progress, although a lot of progress have been made. Expect things to still be buggy and the code to have architectural smells.

For this to properly be implemented and run smoothly may require some changes in LEZ, SPEL and integration with ATA.
Specifically:

  • LEZ support of read Vec(Account), instead of polling several accounts - this happens because for every poll added, or token owned, several reads are necessary, as the state as a whole is scattered over several accounts. It's not huge data, but batching the RPC reads will make it less slow, submitted PR here feat: add bulk public account reads logos-execution-zone#619.
  • SPEL: The library does not have a API that allows the encoding of transactions, instead it have a program specific ABI builder from IDLs, which seems fine, but it does not seem ideal to have a tool generating an automated wrapper about IDL, instead I submitted Runtime idl transaction wrapper api logos-co/spel#249 as a option that allows SPEL to encode transactions directly.
  • ATA support is a shortcut to identify user owned tokens.

Also, I am still maturing the code itself. As the Create Pool view comes with a lot of details itself, the implementation have a lot of code, specifically on protocol.rs. This file is responsible for the business logic, while the API is responsible just to present information in a user-friendly manner.

Something I took freedom to explore and implement was the automatic decimals of tokens - as the token program didnt had decimals, at least not in the direct code itself (might be in metadata once we standarize it), I analyzed the common decimals used by tokens overall the crypto world versus their total supply. This works only in QML, it's not part of business logic, and the definition is that the higher the total supply available of a token, the more decimals they have - I found this to be a fair way of demonstrating to the end-user how valuable their balance is, compared to the total supply.

Currently the PR include a testnet configuration with a bunch of tokens I deployed in order to test the application, this tokens have several different configurations and name sizes - the configuration only contains the AccountId of the TokenDefinition, the rest is read from LEZ, and statically determined as the normalized PDA pool address.
It also supports devnet with a custom configuration file as envoirment variable.

Additionally, would be very useful to have another issue/pr implementing a TokenProgram UI. I plan on extracting part of this implementation (such as chain detection, wallet and transaction) to a separate PR as a library, however we might want to decide that lez-programs is not the correct place to implement them, instead a proper implementation living on semantically correct actual code owner repository of that APIs.

@3esmit
3esmit dismissed their stale review July 15, 2026 17:11

Implemented

@3esmit
3esmit force-pushed the feat/amm-pool-creation branch 2 times, most recently from 38a86de to ca0b67d Compare July 15, 2026 18:10
3esmit and others added 7 commits July 16, 2026 14:08
Add program-neutral wallet access, a stable account model, reusable QML controls, transaction confirmation, submitted-transaction presentation, and isolated contract tests.\n\nRefs #227
Replace AMM-local wallet access, account state, controls, and confirmation-dialog mechanics with the reusable wallet targets. Keep AMM-specific transaction summaries and actions in the AMM UI.\n\nRefs #227
Move wallet lifecycle, account-model synchronization, settings, and reachability behind a composition-based WalletController. Keep AmmUiBackend as the QtRO forwarding adapter while retaining direct WalletProvider ownership for program-specific reads and transaction submission.

Adopt the thin-consumer direction demonstrated by PR #230 without coupling the shared module to generated QtRO base classes.

Refs #227

Refs #230
The Logos.Wallet QML plugin was installed with an ELF "$ORIGIN" rpath.
macOS dyld does not expand "$ORIGIN", so loading the plugin failed with

  Cannot load library liblogos_wallet_qmlplugin.dylib:
  Library not loaded: @rpath/liblogos_wallet_qml.dylib

even though liblogos_wallet_qml.dylib sits in the same directory. Select
the rpath per platform: @loader_path on Apple, $ORIGIN elsewhere, so
@rpath/liblogos_wallet_qml.dylib resolves to the sibling library.
3esmit added 11 commits July 16, 2026 15:16
Replace prototype data and floating-point quotes with live wallet and
chain reads, exact Rust quote planning, and optimistic external-wallet
submission.

Add canonical display-order mapping, responsive QML states,
network-scoped program configuration, and packaged Rust client support.
Implement one create-pool and add-liquidity workflow. Add searchable token resolution, direct opening-price and deposit editing, optimistic pool activation, and base58 transaction IDs.

Isolate network, wallet, AMM client, and runtime boundaries. Stabilize quote, submission, refresh, and pool-probe state while consolidating liquidity tests and removing obsolete liquidity paths.
Expose typed Rust request contracts and transport-independent operations for application clients. Keep the existing C ABI as a thin adapter so the AMM UI continues to use the same symbols.
Add responsive step navigation and a wider deposit workspace while preserving the shared create-pool and add-liquidity flow.
Keep token balances and amounts in raw integer units until the decimal display model receives dedicated UX analysis.
Keep wallet assets as token choices without automatically selecting a pair. Keep pool-probe amounts internal so active-pool quotes do not populate the form before user input.
@0x-r4bbit
0x-r4bbit force-pushed the feat/amm-pool-creation branch from 57855e6 to 0605477 Compare July 16, 2026 13:54
@3esmit
3esmit force-pushed the feat/amm-pool-creation branch from 5731c0d to 2538f0c Compare July 16, 2026 14:42
@3esmit
3esmit force-pushed the feat/amm-pool-creation branch from 2dc502a to 1692581 Compare July 17, 2026 12:26
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