You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks all remaining work for the Liquidity Routing feature in the Komodo DeFi Framework.
Background
Liquidity Routing enables users to execute swaps through intermediate token conversions using providers like 1inch. This allows trading Token A for Token D even when direct P2P orders only exist for Token B ↔ Token C.
komodo-defi-proxy#28 - Add 1inch API to komodo proxy (required for production, removes need for test-ext-api feature)
Use 1inch API call for eth_special_contract instead of const (not valid on zk chains)
Handle rate limit text body errors
Check cross_prices v2 API
6. Code Quality & Optimization
Don't repeat 1inch calls for same pair
Use hash map instead of vec for src_dst pairs
Extract only message from OneInchError instead of whole error
1inch recommendation: increase gas estimate by 25%
Lower Priority - Future Enhancements
7. Streaming & UX
Stream best quote price to GUI so user can wait for better price or refuse if price becomes unsatisfying
8. Extended Provider Support
Architecture to support multiple LR providers (1inch, Jupiter for Solana, Uniswap, etc.)
Cross-chain bridging via stablecoin swaps (e.g., WETH→USDC(ERC20)→USDC(SPL)→SOL)
Consider "native" EVM swap contracts for same-chain efficiency (related to "native" swap contracts #1287) - Both LR and native contracts aim to optimize same-chain trades; LR uses DEX aggregators for token conversion while "native" swap contracts #1287 proposes native atomic swap contracts
Liquidity Routing (LR) Feature Tracking Issue
This issue tracks all remaining work for the Liquidity Routing feature in the Komodo DeFi Framework.
Background
Liquidity Routing enables users to execute swaps through intermediate token conversions using providers like 1inch. This allows trading Token A for Token D even when direct P2P orders only exist for Token B ↔ Token C.
Related PRs
find_best_quoteRPC for ask ordersfind_best_quoteexecute_routed_tradeRPC and state machine implementationRelated Issues/PRs in Other Repos
find_best_quoteRelated Issues in This Repo
Implementation Status
✅ Implemented (in @dimxy's branch, to be merged via #2546)
find_best_quoteRPC with buy/sell actions and bid orders supportexecute_routed_tradeRPC with full state machine (lr_swap_state_machine.rs)api_mock.rs)lr_swap_tests.rs)cross_prices_closeprice calculation (using close price instead of average)⏳ Outstanding TODO Items
High Priority - Core Functionality
1.
find_best_quoteRPC Enhancementstrade_feefield) - requires trade_preimage for TPU2.
execute_routed_tradeRPC3. Price Calculation & Estimation
find_best_quote- current estimation uses quotes without slippage applied4. Trade Preimage Support
trade_preimagefor TPU to calculate total feesMedium Priority - Infrastructure
5. 1inch API Integration
test-ext-apifeature)eth_special_contractinstead of const (not valid on zk chains)6. Code Quality & Optimization
OneInchErrorinstead of whole errorLower Priority - Future Enhancements
7. Streaming & UX
8. Extended Provider Support
Merge Strategy
Per discussion with @dimxy:
devlr-swap-wip-currenton topFuture Considerations
As noted by @dimxy:
Related: #2699 - Account Abstraction PR
Housekeeping
References
find_best_quoteAPI documentationfind_best_quote