AxLabs / grantshares

GrantShares Program ๐ŸŒฑ
https://grantshares.io
Apache License 2.0
22 stars 3 forks source link

Invariant: fully permissionless AMM with concentrated liquidity #110

Open grantshares-dapp[bot] opened 8 months ago

grantshares-dapp[bot] commented 8 months ago

Abstract

Invariant is a DEX based on the concept of fully permissionless and concentrated liquidity. By being fully permissionless, Invariant empowers users to add liquidity pools with any token generated on-chain directly from the protocol's user interface, without the need for additional approvals from anyone. This unique feature positions Invariant as an ideal launchpad for newly generated tokens, providing an accessible avenue for their initial liquidity.

Proposal Information

Description

Invariant is a fully permissionless AMM DEX featuring a concentrated liquidity mechanism. Our project allows retail users to swap their tokens easily but also provides the opportunity for newly launched projects and liquidity providers to create their pools, gives a unique distribution formula for the most efficient liquidity, and reuses capital locked in the platform on other protocols thanks to tokenized positions. A concentrated liquidity mechanism makes Invariant more profitable and efficient than a standard AMM and makes it a natural liquidity hub that benefits the whole ecosystem. It also allows us to implement, in the future, more sophisticated capital management strategies to prevent the risk of impermanent loss.

We are committed to long-term support: solutions like fee sharing allowing us to send part of protocol fees to pool creators, being open source and preparing tutorials for devs to make integration with us easier. Theoretical aspects of our project are described in whitepaper: https://invariant.app/whitepaper.pdf

Motivation

Invariant is exploring new blockchain ecosystems as part of its transition to a multi-chain solution, and NEO N3 emerges as the ideal choice due to its advanced technology and features, particularly in scalability and security. The innovative dBFT consensus protocol establishes it as a robust Layer 1 solution for building a DeFi ecosystem. NEO N3 offers numerous advantages, including short block time, high TPS, and low transaction costs, which creates a favorable environment for our project. A key reason for integrating with NEO N3 is the potential for a burgeoning DeFi ecosystem on this chain. We plan to develop multiple advanced dApps that will not only build upon our core exchange but also integrate further with other DeFi protocols on the NEO N3 blockchain. This collaboration promises mutual benefits: increased trading volume for NEO N3 and significant profits for Invariant.

Goals

Our primary goal is to address the absence of CLAMM solutions on the NEO N3. Consequently, we aim to offer a solution that caters to a broad range of users, including individuals, projects, and liquidity providers. The key flaw in the traditional AMM model lies in its inefficiency, particularly in terms of locking and dividing liquidity across the entire ecosystem. Consequently, the introduction of each new AMM diminishes the average TVL due to liquidity fragmentation between protocols and the inability to reuse locked funds in other protocols. By employing a concentrated liquidity mechanism, there may be a higher risk of impermanent loss compared to providing liquidity across the entire price range. However, incorporating additional tools such as position management can mitigate this issue and offer liquidity providers the opportunity to achieve higher returns.

Deliverables & Roadmap

We are requesting a 4500 NEO grant to deploy an Invariant on NEO N3.Project is divided into 5 main milestones:

Deliverables Verifiability

MILESTONE 1: Protocol core, CLAMM math & primitive types

  1. Creation and implementation of a component facilitating the creation of high-level decimal types such as Token Amount, Liquidity, Percentage, FeeGrowth.
  2. Creation and validation of math functions tailored for concentrated liquidity mechanisms, ensuring accuracy through extensive testing.
  3. Development and rigorous testing of essential contract-storage types, including FeeTier, Pool, and Position, to confirm their implementation and functionality.
  4. Development ofย  a mathematical specification paper customized for the capabilities of NEO and NEP-17, that address the domain and precision of primitive types, as well as the mathematical functions performed on these types.

Completion of the milestone will be confirmed by the successful implementation and passing of all unit tests, verifying the reliability and accuracy of the features and publishing math spec documentation.

MILESTONE 2: Entry points creation

Implementation of all smart contract entry points for the Invariant Protocol, such as create_fee_tiers, swap, and claim_fee.

  1. Development and execution of comprehensive end-to-end tests covering these entry points for robust scenario testing.
  2. Creation of detailed technical documentation that explains the functionality and usage of each entry point.

Verification of the milestone's completion hinges on the complete implementation of the Invariant protocol, extensive technical documentation, and the successful passing of all end-to-end tests to ensure comprehensive code coverage.

MILESTONE 3: Typescript SDK to interact with the Invariant protocol

  1. Development of a TypeScript SDK to act as a client interface for the Invariant Protocol, equipped with advanced functions for transaction serialization, state fetching, and mathematical computations for off-chain simulations.
  2. Compilation of comprehensive technical documentation, detailing the SDK's functionality from a client perspective.

The completion will be marked by the packaging and publishing of the SDK on npm, inclusive of all its functionalities and the accompanying technical documentation.

MILESTONE 4: Integrate NEO to webapp

  1. Adaptation of UI components to match the Invariant design, with specific adjustments for the NEO N3 specifications, focusing on the token list and price chart range.
  2. Creation of handlers for widely-used wallets in the NEO N3 ecosystem to ensure smooth connection and transaction signing.
  3. Development of the app's global state, selectors, and actions to enhance interaction with NEO N3.
  4. Assembly of these components with the state to deliver a cohesive user experience.

The milestone will be considered complete once the integration of the NEO N3 into the multichain Invariant web app is successfully achieved.

MILESTONE 5: Collecting stats from NEO N3 chain

  1. Development of tools to streamline the calculation of token volume and total value locked (TVL) for each pair from smart contract data.
  2. Creation of a cron action for automated capture and storage of NEO N3 protocol state snapshots at regular intervals.
  3. Establishment of an API to disclose the gathered protocol statistics, facilitating access for external applications or services.
  4. Integration of NEO N3 statistics into the web application, allowing users to directly view token and pair statistics within the interface.

The milestone will be considered complete once the integration of the NEO N3 into the multichain Invariant web app is successfully achieved.

Upon completion of this milestone, the Invariant web application will have the capability to collect and display token and pair statistics from the NEO N3 chain. This enhancement will provide valuable insights to users, including token volume, TVL, and other relevant protocol metrics.

Budget Plan

We are asking for 4500 NEO to fully migrate Invariant to NEO N3. This amount will be divided between development and marketing. Based on our previous experience and market standards, we calculated the cost of each milestone, which will be:

This calculation is based on the time consumption and difficulty of each task.

The remaining 500 NEO will be used for a marketing campaign focused on promoting Invariant among NEO users, as well as on wider adoption of the chain among Invariant users on other chains. We are planning to run social media campaigns on our channels and through influencers to boost media coverage. Additionally, we want to host a podcast about programming on NEO to spread the news among other projects that might be interested in building on top of us on that chain.

About You / Your Organization

Short-Bio

The Invariant team is composed of three highly skilled programmers, along with a bizdev manager which makes 4 in total. Our founder and core dev, Wojciech, has been developing blockchain applications since 2017 and has extensive experience with various prominent chains, including Ethereum, Solana and Aptos but he is also familiar with Java and C#. Wojciech is deeply committed to the DeFi sector, handling the backend aspects of Invariant and conducting comprehensive research on capital efficiency in DeFi protocols. His LinkedIn is: https://pl.linkedin.com/in/wojciech-cichocki97

Supporting him in this project are two skilled full-stack developers: Aleksander and Jakub, who bring a wealth of experience in blockchain dApps. Their primary responsibilities will involve meticulously preparing and executing various tests to ensure the smooth functioning of our dApp. Additionally, they will be concentrating on the design and development of user-friendly and aesthetically pleasing interfaces for our application, enhancing the overall user experience. Their combined expertise in both backend and frontend development is crucial for the seamless integration of our application's functionality and visual appeal.

Our business development manager is called Andrzej. He takes care of all the operational stuff regarding the project. Andrzej has experience as an accountant and a manager in a crypto startup. His LinkedIn is: https://www.linkedin.com/in/andrzej-zapalowicz

Portfolio of Projects / Past Experience

Our project has been around live on Solana mainnet since March 2022 and can be tested here: https://invariant.app

Since its launch, Invariant has never experienced any major outages, and its daily average volume is around $1,500,000.


Proposal Info :clipboard:

[ {
  "target_contract" : "0x6276c1e3a68280bc6c9c00df755fb691be1162ef",
  "method" : "releaseTokens",
  "params" : [ {
    "type" : "Hash160",
    "value" : "ef4073a0f2b305a38ec4050e4d3d28bc40ea63f5"
  }, {
    "type" : "Hash160",
    "value" : "ebbac87ebd6a774d6cf1329a8dce69b5d0a084ff"
  }, {
    "type" : "Integer",
    "value" : "4500"
  } ],
  "call_flags" : 15
} ]

๐Ÿ‘‡ React with ๐Ÿ‘ if you liked it, or ๐Ÿ‘Ž if you think this proposal can be enhanced!