sora-xor / rfps

SORA network development public Request for Proposal development process
Apache License 2.0
11 stars 24 forks source link

[RFP]: Polkaswap Swap Market:SMART Review to Allow several Routes #110

Open miansegat opened 4 months ago

miansegat commented 4 months ago

Proposal Due Date

July 2024

Proposal Overview

The current Market:SMART swap system on Polkaswap calculates the best available route based on connected liquidity sources, such as XYK Pools and TBC. However, it is limited to using a single route per swap transaction. This limitation means the system cannot utilize multiple routes to optimize the swap, potentially leading to suboptimal outcomes, especially for larger transactions.

To address this, the proposal aims to enhance the Market:SMART swap system by enabling it to recognize and use multiple routes. By incorporating the ability to calculate and utilize 2, 3, or more routes as necessary, the system can optimize the swap process, even with the necessary increase in fees factored into the calculation. This would prevent situations where increasing the amount to be delivered for a swap results in a lower amount received, ensuring more efficient and cost-effective swaps for users.

Here is an example with the ETH/XOR pool: 2024-07-23 Polkaswap SMART ex-2 2024-07-23 Polkaswap SMART ex-1

Benefits to the SORA Ecosystem

  1. Improved Swap Rates:

    • By leveraging multiple routes, the system can find better exchange rates, maximizing the value received by users in each swap transaction.
  2. Reduced Slippage:

    • Distributing trades across several routes minimizes the price impact on any single liquidity pool, leading to reduced slippage and more stable prices.
  3. Enhanced Liquidity Utilization:

    • More efficient use of available liquidity across all connected sources ensures higher overall liquidity, benefiting liquidity providers and traders alike.
  4. Increased User Satisfaction:

    • Providing users with more optimal swap outcomes enhances their trading experience and increases their trust and engagement with the Polkaswap platform.

Distinctiveness from Existing Solutions

The current system in the SORA ecosystem allows for single-route swaps, which can lead to inefficiencies and suboptimal results. This proposal differentiates itself by introducing a multi-route capability that:

By implementing this proposal, the SORA ecosystem can significantly enhance its swap capabilities, offering users more efficient and optimal trading experiences while maximizing the utilization of available liquidity.

Proposal Goals

What is the goal of the proposal?

The goal of this proposal is to enhance the Polkaswap Market:SMART swap system by enabling it to calculate and utilize multiple routes for a single swap transaction. This enhancement aims to optimize the swap process, ensuring that users receive the best possible rates by leveraging the combined liquidity from multiple sources rather than relying on a single route.

What problem does it solve?

The current Market:SMART swap system on Polkaswap calculates the best available route for a swap based on connected liquidity sources, such as XYK Pools and TBC. However, it only supports the use of a single route per swap transaction. This limitation can result in suboptimal outcomes, especially when larger swap amounts are involved. Specifically, the problems addressed by this proposal include:

  1. Suboptimal Swap Rates:

    • The single-route approach can lead to situations where increasing the amount to be delivered for a swap results in a lower amount received. This is because the current system does not account for the potential benefits of splitting the swap across multiple routes.
  2. Inefficient Liquidity Utilization:

    • By not recognizing and utilizing multiple routes, the system fails to fully leverage the available liquidity across all connected sources. This inefficiency can lead to higher slippage and less favorable exchange rates for users.
  3. Increased Slippage:

    • Single-route swaps can cause significant price impact on the chosen liquidity pool, especially for large transactions. Multi-route swaps would distribute the impact across several pools, reducing slippage and improving the overall swap experience.

Proposal Summary:

The proposal seeks to upgrade the Polkaswap Market:SMART swap system to:

By addressing these issues, the enhanced swap system will provide users with better rates, reduce slippage, and improve the overall efficiency of liquidity utilization on Polkaswap.

Scope of Work

Implementing the proposal to enhance the Polkaswap Market:SMART swap system to support multiple routes within the SORA ecosystem involves several key steps. This detailed scope of work outlines the necessary tasks and the estimated effort required for each phase of the project.

Research and Planning

  1. Feasibility Study:

    • Conduct a thorough analysis of the current Market:SMART swap system.
    • Evaluate the technical and economic feasibility of multi-route swaps.
    • Identify potential challenges and mitigation strategies.
  2. Requirement Gathering:

    • Define the functional and non-functional requirements for the multi-route swap feature.
    • Engage with stakeholders, including developers, users, and liquidity providers, to gather inputs.
  3. Design Specification:

    • Develop a detailed design specification outlining the architecture, algorithms, and data flow for the multi-route swap system.
    • Include considerations for user interface changes and integration with existing components.

Current Roadblocks and Barriers to Success

Implementing the proposed multi-route swap system in Polkaswap involves several potential challenges and barriers that need to be addressed for successful execution. Here are the key roadblocks and considerations:

  1. Algorithm Complexity:

    • Catch: Developing an advanced pathfinding algorithm that can efficiently calculate optimal multi-route swaps is complex and resource-intensive.
    • Attention: Ensure thorough testing and validation of the algorithm to handle various swap scenarios and edge cases effectively.
  2. Increased Network Fees:

    • Catch: Multi-route swaps may result in higher netwok fees due to the complexity and number of transactions involved.
    • Attention: Optimize the algorithm to minimize network fees and provide users with clear information about the cost implications of multi-route swaps.
  3. Smart Contract Security:

    • Catch: Modifying or creating new smart contracts introduces potential security vulnerabilities.
    • Attention: Conduct rigorous internal and third-party security audits to identify and mitigate risks. Ensure the contracts are robust and secure.
  4. Integration with Existing Infrastructure:

    • Catch: Integrating the new multi-route system with the current Polkaswap infrastructure requires seamless coordination and testing.
    • Attention: Plan for extensive integration testing to ensure compatibility and smooth operation with existing systems.
  5. User Experience and Education:

    • Catch: Users may find the new multi-route feature complex and challenging to understand.
    • Attention: Design a user-friendly interface and provide comprehensive educational resources to help users understand the benefits and functionality of multi-route swaps.
  6. Liquidity Distribution:

    • Catch: The effectiveness of multi-route swaps depends on the availability and distribution of liquidity across different pools.
    • Attention: Monitor liquidity levels and work with liquidity providers to ensure adequate distribution for optimal swap outcomes.
  7. Performance and Scalability:

    • Catch: The new system must handle a high volume of transactions efficiently without compromising performance.
    • Attention: Invest in scalable infrastructure and conduct performance testing to ensure the system can handle growth and high transaction volumes.

By paying special attention to these potential roadblocks and barriers, the implementation of the multi-route swap system can be more effectively managed, leading to a successful enhancement of the Polkaswap platform within the SORA ecosystem.

Evaluation Metrics and Criteria

To evaluate the success of the multi-route swap system implementation, we will use the following metrics and criteria:

  1. Algorithm Efficiency:

    • Metric: Time taken to compute optimal multi-route swaps.
    • Criteria: The algorithm should compute optimal routes within a reasonable timeframe, ensuring swift transaction processing.
  2. Swap Rate Improvement:

    • Metric: Comparison of swap rates before and after implementation.
    • Criteria: Users should consistently receive better swap rates due to the multi-route optimization.
  3. Network Fee Optimization:

    • Metric: Average network fees for multi-route swaps compared to single-route swaps.
    • Criteria: Network fees should be optimized.
  4. User Adoption and Satisfaction:

    • Metric: User feedback and adoption rate of the multi-route feature.
    • Criteria: Positive user feedback and increased usage of the multi-route swap functionality.
  5. System Performance and Scalability:

    • Metric: System performance metrics such as transaction throughput and latency.
    • Criteria: The system should maintain high performance and scalability under increased transaction volumes.
  6. Security and Reliability:

    • Metric: Number of security incidents or vulnerabilities reported.
    • Criteria: No major security incidents, with any reported vulnerabilities promptly addressed.

Definition of Done

The proposal will be considered completed and successfully integrated into the SORA ecosystem when the multi-route pathfinding algorithm is developed, tested, and validated to handle various swap scenarios effectively, ultimately enhancing the Polkaswap platform with optimized multi-route swap capabilities.

Submission Requirements

Whichever the development team considers

Submission Method

Blockchain: Mainnet

Project Due Date

August 2024

Budget Amount

Whichever the development team considers