funded
Universal Liquidity Composition and MEV resistance framework for DeFi
Current Project Status
In Progress
Amount
Received
₳60,000
Amount
Requested
₳300,000
Percentage
Received
20.00%
Solution

Open off-chain framework based on years of DeFi research that allows to match any type of order or pool with one another to optimize execution price and fee while minimizing room for MEV.

Problem

Utilization of liquidity on Cardano will stay low as long as there is liquidity fragmentation, no interop between different types of liquidity and exploitation of liquidity by MEV seekers

Team

1 member

Universal Liquidity Composition and MEV resistance framework for DeFi

Please describe your proposed solution.

The UTxO model holds promising prospects for on-chain trading but falls short of the ideal. The challenge lies in fragmented liquidity trapped within various contracts and governed by closed execution systems, often referred to as 'batchers.' Additionally, due to the closed nature of these systems, end users are deprived of information regarding the execution of their orders, creating a significant potential for abuse through mechanisms such as MEV, frontrunning, and other types of attacks. To address these issues, we present a framework for universal liquidity aggregation and transparent execution, which can be adopted and utilized by any dApp team.

Universal Liquidity Composition: Temporal Liquidity Book

We propose a solution for universal off-chain liquidity aggregation based on a simple idea: all liquidity available on the market (AMM, market\limit orders, programmable orders etc.) can be projected into a 3-dimensional space: Price, Volume, and Time. Thus matchmaking logic for all types of liquidity can be described with a universal set of rules.

The implementation will be done in Rust programming language and will be optimized for efficient memory utilization to support the facilitation of large sets of liquidity chunks.

chunks-2dbde7.png

MEV resistance: Order Steering and Decentralized Execution Assessment

Universal composition of liquidity won’t be possible without MEV resistance, because MEV can siphon all the gains of liquidity aggregation. Our anti-MEV solution is based on two pillars:

  1. Orders can be steered to a subset of off-chain executors (aka “batchers”) instead of just “send to all”
  2. The quality of off-chain execution can be assessed using an evolving set of metrics right on the client (in your favorite DEX’s app). The result of the assessment can be used to automatically assign orders to those executors providing the best execution quality (price and speed).

Off-chain part of order steering will be implemented in Rust as well. Execution Assessment will be implemented as a combination of off-chain service to aggregate relevant on-chain data and provide an easy interface to query it and a client SDK in Typescript to perform assessment itself on the client side.

Explore more in the Spectrum Bloom: A self-developing, sustainable, eUTxO-native framework for decentralized finance white paper.

Please define the positive impact your project will have on the wider Cardano community.

To measure the impact we will use the following metrics:

  • Measuring the utility within the ecosystem: Number of projects that decided to onboard the solution
  • Measuring the trust of the ecosystem: Total Value Locked in those protocols that decided to onboard the solution

The outputs will be released on GitHub and will be open to anyone — the broad documentation of how to use and integrate the solution. Everything will be broadcast through Spectrum Labs Community Channels (such as Twitter, Discord, and Telegram).

We will share those outputs via Spectrum Labs community channels (such as Twitter, Telegram and Discord).

What is your capability to deliver your project with high levels of trust and accountability? How do you intend to validate if your approach is feasible?

  • Spectrum Labs pioneered the decentralization in off-chain execution systems in Cardano. Currently, the Spectrum DEX operates on Cardano using a fully trustless but not that efficient and transparent system. This proposal is partly an improvement on Spectrum's current decentralised off-chain system that can be expanded to various other dApps.
  • Our development team possesses extensive experience of over 4 years in the DeFi and blockchian industry, including >2 years specifically dedicated to the Cardano space.
  • Spectrum Labs boasts a reputable standing within both the Cardano and Ergo communities.
  • Our development team has received successful funding three times through the Catalyst program, consistently delivering timely progress updates.
  • In addition to the funding acquired through Catalyst, we have access to ample resources, ensuring we are not limited in terms of available means.

What are the key milestones you need to achieve in order to complete your project successfully?

Title: Abstract Temporal Liquidity Book Implementation in Rust

Description: Implementation of the matching engine plus all abstractions to facilitate processing of real orders and pools from the concrete network (including abstractions for parsing of orders/pools from the network), an interpreter that evaluates strategies generated by the engine into transactions, hot storage for UTxOs, a tracker of on-chain entities such as pools and long-lasting orders)

Outputs:

  • Rust library containing the implementation of TLB and all components facilitating its working cycle (described above)

Acceptance criteria:

  • The code is published in an open-source repository (URL is to be provided later)
  • API of TLB is covered with tests for common matching scenarios (order-to-order, order-to-heterogeneous-orders, order-to-heterogeneous-orders-and-pool, order-to-pool)

>Title: Support of Common Liquidity Types, Documentation, and Examples

Description: To work properly with different liquidity types, support for different types of orders and liquidity pools is required, because the execution engine is universal this task boils down to the implementation of main type classes describing how to parse orders and pools from chain and how to interpret them into transactions again. This way the actual aggregation of different liquidity sources will be possible. Also, documentation and wiring of a working off-chain bot will be provided as an example of library usage.

Outputs:

  • Implementation of type classes required to support AMM pool, limit order, and auction order (published in the open-source repository)
  • Documentation explaining how to build off-chain services with the library is published in the open-source repository
  • Example wiring of a real off-chain bot is published in the repository

Acceptance Criteria:

  • Support for listed liquidity types is showcased in the example bot wiring
  • Documentation explaining how to build off-chain services with the library

>Title: Order Steering support in Rust library and data accessibility service

Description: Order Steering support will be added to the tracker and the interpreter supplied with the library. To efficiently assess execution a configurable off-chain indexer service is needed to query data from the client. It will be included in the library or published in a separate repository along with documentation that will describe how to tweak, configure, and deploy the service.

Outputs:

  • Implementation of Order Steering in relevant library components
  • Off-chain indexer service

Acceptance Criteria:

  • Order Steering support implemented with the library is showcased in the example Bot implementation
  • Off-chain indexer can index on-chain data relevant to execution assessment (matching transactions)

>Title: Decentralized Execution Assessment SDK

Description: Typescript SDK for DEA will be supplied as a part of the library. Along with documentation specifying methodologies of assessment implemented in the SDK.

Outputs:

  • DEA SDK

Acceptance Criteria:

  • Assessment tools provided in the SDK can recognize common MEV patterns: sandwich attack, front-running

>Outputs:

  • All listed above components of the protocol are developed (code is written) and covered with tests
  • All outputs are well documented and the documents are published on GitHub and GitBook

Acceptance Criteria:

  • Project Completion Report is written and submitted
  • A video demonstrating how all the components work together is recorded as evidence of the project's completion
  • Comprehensive documentation on how to use the tool is provided in GitHub readme.md file in an open repository

Who is in the project team and what are their roles?

Leaders

Ilya Oskin

Tech Lead

Engineering Leader with 6 years of experience in the blockchain industry. Keen on functional programming. Took part in the development of the reference node of the eUTxO-based blockchain Ergo and its explorer. Designed and developed the first version of the ErgoDEX protocol from scratch. The main architect of the Spectrum Finance Cardano AMM. Lead researcher and developer of the Spectrum Network

In the scope of the proposal, Ilya is responsible for leading the development of the whole project's outputs

GitHub · LinkedIn

Yasha Black

Product Lead

Product manager, product analyst, UX/UI, and JavaScript developer with 7 years of experience in the IT industry. Built a strong product team, and designed the first version of the Spectrum Finance user interface.

In the scope of the proposal, Yasha is responsible for funds management, as well as for the control and acceptance of final works

LinkedIn

Core team

Timofey Gusev

Lead Software Developer

Developed smart contracts and execution bots for Ergo and Cardano sides of Spectrum Finance protocol (Scala, Haskell, Plutus). Designed and developed an internal Cardano explorer.

Timofey is responsible for implementing the proposed solution in the proposal's scope.

GitHub · LinkedIn

Alexander Romanovsky

Lead Core/SC Developer

Developed smart contracts and off-chain services for Ergo and Cardano sides of the Spectrum Finance AMM protocols (Scala, Haskell, Plutus, Plutarch).

Alexander is responsible for implementing the proposed solution in the proposal's scope.

GitHub · LinkedIn

Ruslan Salakhov

Lead TypeScript Developer

Build the architect of the current Spectrum Finance interface. Has 7+ years of experience as a JavaScript developer and 5 years in building interfaces and tools in fintech.

Ruslan is responsible for implementing the proposed solution in the proposal's scope.

GitHub · LinkedIn

Alex Oranov

Senior Blockchain Researcher

Has 5 years of experience in research and development, including scientific work, industrial solutions related to artificial intelligence, and data analysis. Participated in the smart contracts design and development of the Yield Farming protocol (Ergo side). Researcher and one of the Whitepaper authors of the Spectrum Network protocol.

Alex is responsible for implementing the proposed solution in the proposal's scope.

GitHub

Please provide a cost breakdown of the proposed work and resources.

Milestone 1

Duration: 1 month.

Monthly costs:

  • Development and documenting: $21,000
  • 3 Senior Developers
  • Management: $8000
  • 1 Tech Leader

Total milestone costs: $29,000

Milestone 2

Duration: 1 month.

Monthly costs:

  • Development and documenting: $21,000
  • 3 Senior Developers
  • Management: $8000
  • 1 Tech Leader

Total milestone costs: $29,000

Milestone 3

Duration: 1 month

Monthly costs:

  • Development and documenting: $21,000
  • 3 Senior Developers
  • Management: $8000
  • 1 Tech Leader

Total milestone costs: $29,000

Milestone 4

Duration: 1 month

Monthly costs:

  • Development and documenting: $21,000
  • 3 Senior Developers
  • Management: $8000
  • 1 Tech Leader

Total milestone costs: $29,000

Final Milestone

Duration: 1 week

Monthly costs: $0

Total milestone costs: $0

All the works for the final milestone will be volunteered by Spectrum Labs founders.

Total Budget: $116,000

For now, the ADA price is close to $0.4 per ADA. We set the budget of this proposal to 300,000 ADA to mitigate price fluctuation risks.

How does the cost of the project represent value for money for the Cardano ecosystem?

We estimated the cost of the project based on average dev salaries which is $7,000-10,000k for 5+ years of experience (senior software developer grade). Our team is blockchain and Cardano-focused and obtained most of the experience in the crypto industry so the domain-specific knowledge is sufficient to tackle the most challenging industry problems.

The value of the project can be considered from different angles. First of all the implementation of the project if onboarded by different currently existing dApps will bring more transparency to the space and hence make those dApps more valuable for people by eliminating the need to trust the close and permit systems. The composability feature will allow us to save millions of value by matching orders with the best possible price within the ecosystem in the long run.

The MEV and other attacks will be reduced to a minimum which also will save a lot of value for all the Cardano DeFi users.

Lastly, the decentralized nature of the framework can become a huge selling point both for any specific dApp and for the ecosystem as a whole to onboard new users to Cardano DeFi.

close

Playlist

  • EP2: epoch_length

    Authored by: Darlington Kofa

    3m 24s
    Darlington Kofa
  • EP1: 'd' parameter

    Authored by: Darlington Kofa

    4m 3s
    Darlington Kofa
  • EP3: key_deposit

    Authored by: Darlington Kofa

    3m 48s
    Darlington Kofa
  • EP4: epoch_no

    Authored by: Darlington Kofa

    2m 16s
    Darlington Kofa
  • EP5: max_block_size

    Authored by: Darlington Kofa

    3m 14s
    Darlington Kofa
  • EP6: pool_deposit

    Authored by: Darlington Kofa

    3m 19s
    Darlington Kofa
  • EP7: max_tx_size

    Authored by: Darlington Kofa

    4m 59s
    Darlington Kofa
0:00
/
~0:00