Skip to main content

Polkadex: A fully decentralized, peer-peer, cryptocurrency exchange for DeFi ecosystem in Substrate.

  • Proposer: Gauthamastro
  • Payment Address: 34agZfxE1SSGxXgTQQvVGv1RcEEFCX9mEy
  • Status: Terminated via email

Project Overview πŸ“„β€‹

Overview​

There are many decentralized exchanges/protocols available in the market for traders but they still prefer to use centralized solutions for their convenience and ease of use knowing very well that their funds are at risk. This is because decentralized solutions are still not user friendly to an average trader. Some of them also have no proper decentralization and also got hacked in the process. We cannot call an exchange decentralized if it can lose or freeze customer funds.

The problems faced by decentralized exchanges are:

  • Inadequate UI/UX experience.
  • Low liquidity
  • Lack of advanced trading features, high-frequency trading, and bots.
  • Lack of proper decentralization and interoperability.

To solve the above problems, our goal is to build a fully decentralized, peer-peer, cryptocurrency exchange for the Defi ecosystem in Substrate. The project envisages the creation of a fully decentralized platform for exchanging tokens in a peer-peer, trustless environment, that enables high-frequency trading, high-liquidity, and lightning-fast transaction speed for supporting Defi applications.

In order to address the first problem, we needed to enable features that attract users into the exchange which includes a fast, responsive UI and trading features. It is mainly to attract day traders and retail investors who prefer centralized exchanges due to convenience and speed of execution. The block time of 3s given by the Babe/Grandpa consensus algorithm allows transaction speeds of up to 400/s under test conditions which is more than sufficient to compete with any centralized solutions in the market today. Please check our analysis here. Since Substrate hot-swapping of Consensus algorithm, we think a platform like Substrate will support the future growth of the exchange by changing consensus to accommodate more transactions per second as better ones emerge.

Secondly, the lack of liquidity is addressed by enabling,

  1. High-frequency trading using feeless transactions.
  2. APIs that enable trading/AMM bots to observe market changes and submit trades.
  3. Advanced trading features like stop limit, market limit, Stop loss, Fill/Kill, Post only, TWAP, etc.

Finally, proper decentralization and Interoperability are achieved by having a parachain in Polkadot that brings in liquidity from other blockchains and also using ChainBridge protocol that connects directly to the Ethereum network. Hence, traders have two different mechanisms to bring in liquidity.

The value we provide to the Substrate community is,

  1. They can build custom UI/UX to connect to our network and create their own custom exchange experience.
  2. Traders can contribute their own custom trading algorithms by making use of market data provided by our full nodes.
  3. They get a decentralized trading platform to trade Polkadot & Ethereum tokens.
  4. This will be one of the first Decentralized exchanges to have High-Frequency Trading bot support using APIs directly from full nodes.

An indication of how you will integrate this project into Substrate / Polkadot / Kusama.​

Polkadex is a decentralized exchange platform. It will have three high-level components.

  • An independent substrate chain for high-speed consensus secured and governed by network participants.
  • A Parachain on Polkadot for bringing liquidity from Polkadot’s interoperability community.
  • A set of decentralized relayer set that use Substrate's ChainBridge pallet to allow interoperability with Ethereum.

An indication of why your team is interested in creating this project.​

We are amused by the plethora of centralized institutions cropping up around the decentralized idea of open, peer to peer, programmable internet of value. Decentralized Exchanges are built on the idea of non-custodial interoperability. Polkadot and Substrate are the most promising blockchain interoperability platforms. We want to provide our users with maximum liquidity, security, and world-class user experience. Hence, we are excited and confident that building a DEX on Substrate, supported by Polkadot’s interoperability, will increase user engagement and overall trading experience when combined with our trading expertise over the years.

Project Details​

  • Mockups of exchange UI Components

    • Login In Page Login Mockup
    • Dashboard DashBoard Mockup
  • We have created a proof of concept of the idea. check here

Ecosystem Fit​

We have provided a comparison chart against two famous DEXs

FeaturesPolkadexBinanceDexBitsharesDex
Decentralized OrderbookYesYesYes
Block time3 sec2 sec3 sec
Custom Trading botYesNoNo
Network SizeDynamic100Dynamic
Responsive UIYesYesNo
Upgradable State Transition FunctionYesNoNo
Automated Market Making SupportYesNoNo
Custom UI/UX SupportYesNoYes
Peer-Peer Blockchain InteroperabilityYesNoNo
Advanced Order types (Stop limit, Stop loss, etc)YesNoNo
High Frequency Trading SupportYesNoNo
Margin TradingYesNoNo

Team πŸ‘₯​

Team members​

  • Vivek Prasannan (Btech Computer Engineering) is passionate about Decentralized computing and has been actively following the crypto/blockchain community since 2013. He has researched and worked on a new BSIP for Bitshares that will enable off-chain activities that can be settled transparently on the blockchain, and implicitly enables the creation of savings accounts for the users that are locked a certain time period to enhance fund security. He has successfully exited two startups in cloud computing, infrastructure support, and fintech space.

    • Experience: C++, RUST & Substrate Framework
  • Gautham J, a 3rd-year B.Tech undergrad student at National Institute of Technology, Calicut, India. He has been at the forefront of distributed ledger technology by launching his own version of a consensus algorithm known as Pebble using Lamport’s vector clocks which is still in progress. The team received a blockchain innovation award from the BFSI sector by Banking Frontier. He has also co-authored an academic paper for Supply Chain management and predictions using machine learning models and ethereum network which is currently being peer-reviewed.

    • Experienced in GoLang, RUST, Python, C++, and Substrate Framework.
  • Deepansh Singh, a 4th-year B.Tech undergrad student at National Institute of Technology, Calicut, India. worked with multiple early-stage startups for developing business strategies and exited after making those startups a success. One of the startups that he worked got the Best Startup award in the National Institute of Technology Startup Conclave. He is also part of the Innovation Council for universities in Kerala under the Government of India. He along with Gautham received an award for their innovative consensus algorithm that enables high throughput transactions in permissionless networks.

Team Website​

Individual

Team Code Repos​

Team LinkedIn Profiles​

Development Roadmap πŸ”©β€‹

Overview​

  • Total Estimated Duration: 7 weeks
  • Full-time equivalent (FTE): 3.5 FTE
  • Total Costs: 1.5 BTC

Milestone 1 - Optimize Trading algorithm & Check for data errors​

  • Estimated Duration: 5 weeks
  • FTE: 2
  • Costs: 1.2 BTC
NumberDeliverableSpecification
1.Refactor Trading Engine in DEX palletRefactoring the limit and market order algorithms for efficiency and high-speed trading.
2.Optimize Storage accessOptimize the storage and efficiency of reads and writes to substrate storage.
3.Check for Data errorsChecking the security for buffer overflows or any other type of data errors that may affect exchange transactions.
4.Market Data APISave closing_bid, closing_ask, and volume for each trading pair at each block on the chain.
5.Enable Market Data RPCImplement RPC for retrieving Market data from full nodes for technical analysis.
6.Unit testsIntegration of Unit tests for Limit, Market Orders & Market Data API.
7.DocumentationProper documentation to submit Limit, Market orders or retrieve Market Data using Polkadotjs API.
8.Docker ContainerProvide a docker container

Milestone 2: Web UI, Documentation & Tutorials​

  • Estimated Duration: 2 weeks
  • FTE: 1.5
  • Costs: 0.3 BTC
NumberDeliverableSpecification
1.Provide our Web UIConvert mockups into working websites and connect them to full nodes using polkdotjs API. (Includes Dashboard, Login using Polkadot browser extension).
2.Custom Trading Bot TutorialA simple implementation trading bot based on moving average enabled using market data from full nodes.
3.API DocumentationDocumentation of APIs provided by a full node for developing custom UI/UX.
4.Basic Trading TutorialBasic trading tutorial for submitting limit & market orders based on our UI design.

Community engagement​

The tutorials and Documentation that we provide will be published as articles in Medium and other social media platforms with due mention about Web3 grant. We also intend to engage community by providing grants in our tokens to add more support and improve our codebase.

Future Plans​

We will be registering an LLC for taking this project ahead. We intend to host a the Web UI provided here. We will also be developing a cloud service to analyse and aggregate the market data to provide a wide range of technical indicators like Bollinger bands, RSI etc. We want to provide traders the maximum possible user experience compared to a centralized exchange.