Skip to content

Instantly share code, notes, and snippets.

@Dexaran
Last active May 4, 2024 23:19
Show Gist options
  • Save Dexaran/a4d14551f3ddc58a96c5664c2f76b5b2 to your computer and use it in GitHub Desktop.
Save Dexaran/a4d14551f3ddc58a96c5664c2f76b5b2 to your computer and use it in GitHub Desktop.

Dex223 development report (5/4/2024)

This article is a development report of a Dex223 decentralized exchange.

We’re building an exchange to speed up adoption of the ERC-223 token standard. ERC-223 was created to solve a security problem in the older ERC-20 standard. Security issue of ERC-20 caused $200M losses on Ethereum in 2023.

Take a look at other Dex223 development reports.

Core smart-contracts: merged liquidity concept

Merged liquidity was declared as one of the main features of Dex223 and a new concept in DeFi. The "merged liquidity" is a method of combining multiple tokens in the same pool which significantly improves the opportunity of supporting multiple standards for tokens in a DEX.

Currently the ERC-20 standard is the main token standard for fungible tokens on Ethereum and despite it's problems it was not superseded by any other standards even though there were multiple proposals like ERC-223, ERC-677 (superseded by 777 later), ERC-1363 and few others. The root of the problem with upgrading to a new standard is that there is no defined upgrading procedure in Ethereum at all. The developers have no viable option to pick a new standard because no standard other than ERC-20 is currently supported by CEX'es and infrastructural services and CEX'es and infrastructural services are not supporting new standards because implementers are not using anything other than the most adopted standard with some rare exceptions.

There was no clear transition method before we introduced the Token Converter. The Token Converter is supposed to become the default upgrading method for any future upgrade of the token ecosystem. We understand that there are hundreds of already-existing tokens and they are not going to go away overnight so we introduced a method of transforming the "old" tokens to a new version. This would instantly allow anyone to benefit from the features of the new standard without a need to lost backwards compatibility.

The Token Converter will create exactly one new "version" for every existing token (at a predetermined address). Right now there is an infamous ERC-20 USDT token for example. After the deployment of the converter there will be ERC-20 USDT and a ERC-223 USDT which will co-exist on the mainnet.

The technical difficulty here is that the ERC-223 USDT is a new smart-contract with its own address so by default it would be treated as a separate token by Uniswap and other exchanges which are unaware of the Converter.

If we will simply support ERC-223 standard in Uniswap smart-contracts then in case of a USDT-DAI trading pair there would be multiple pools:

  1. ERC-20 USDT : ERC-20 DAI

  2. ERC-20 USDT : ERC-223 DAI

  3. ERC-223 USDT : ERC-20 DAI

  4. ERC-223 USDT : ERC-223 DAI

As the result, if a liquidity provider would want to provide liquidity for the USDT-DAI pair they would need to decide one configuration of the standards they want to supply liquidity for. In case the liquidity provider supplied liqudity for the ERC-20 USDT : ERC-223 DAI pair they will not receive any fees from the trades made on the ERC-20 USDT : ERC-20 DAI pair as it is treated as a different liquidity pool and a different pair even though it's the same exact token with just a different "version".

Merged liquidity allows us to join all the token versions in one pool so that there will be only USDT : DAI pool which will accept liquidity in any standard and also allow users to perform swaps paying with a token of any standard.

A user who performs a swap, or a liquidity provider who chooses to withdraw liquidity or profits, will need to specify the standard of the token they receive. If there are not enough tokens of the specified standard on the Pool balance, then the Pool will cover the missing amount using the Converter since there are enough tokens of a different version of the standard in the pool at any time.

Core smart-contracts: merged liquidity implementation

The merged liquidity is partially implemented. It is currently possible to provide liquidity in any standard and perform swaps with tokens of any standards. Fee collecting functions and some other functions of the pool contract still need to be upgraded and further optimization has to be done.

1. Bytecode size limitation in EVM. (Read more about EIP-170 bytecode size limitation). When extending the code of the UniswapV3 contracts we faced strict limitations of the EVM which significantly over complicated the task. There is a limit of the smart-contract's bytecode size that can be deployed on Ethereum mainnet. Currently it's set to 24 KB which would be quite good for 1980 but for a more-or-less complex program it's a huge limitation.

In order to bypass the limitation of EVM we can split the contract into "parts" where one pool contract would pull the executable code from a different contract at runtime. This requires a rework of the Uniswap's contracts however, introduces new security risks that have to be addressed and increases the gas usage. Unfortunately it seems that this is the only option for us to implement the merged liquidity properly.

2. Call stack depth limitation in EVM. (Read more about call stack depth limitation). EVM is a stack machine and it's characteristics are not that impressing nowadays. When a user interacts with a smart-contract it is common to "tell" smart-contract what exactly the user wants it to do. For example when performing a swap it's required to tell the contract (1) what token you are going to pay, (2) how much of the second token you expect to receive, (3) deadline for the transaction etc.

Uniswap's contracts already push the EVM to its limits. In Dex223 we need to provide just one more variable to the contract: the identifier of the standard that a user is willing to receive after the swap and that's too much for the EVM so it can't handle it. For the most part this month was a fight against EVM limitations rather than the rework of the contracts which slowed down the process of the development. Unfortunately as there are no "native" ways of performing some actions as it would be logically required in Dex223 we have to design overengineered solutions to solve simplest problems like adding a little bit of code to an already existing smart-contract. This reduces the advantages in gas optimization that Dex223 would get from supporting the ERC-223 standard naturally.

We prioritize the cost of direct swap actions as it affects most of the users. Currently we are preparing for the launch of the prototype on Sepolia testnet to showcase the features of the DEX, however it will require an additional release to make contracts more gas efficient for direct swaps.

The current version of the Dex223 core smart-contracts that support both ERC-20 and ERC-223 tokens in one pool can be found here (this is a raw version which exceeds 24KB bytecode limit, may not be deployable on Ethereum mainnet. Works fine with custom chains/testnets/Remix IDE): https://github.com/Dexaran/Dex223-dev/tree/2eb028ffa3a4d7eb51d2970002fe0c388e2e8061

Compatible periphery contracts: https://github.com/EthereumCommonwealth/Dex223-periphery/tree/72b9b7cc5e94fd95d726610cf8e285ff0f0abb73

Dex223 contracts with "code libraries" (deployable on mainnet):

Contracts deployed on Sepolia testnet:

UI

We're getting ready to launch a prototype, so there haven't been many major UI changes this month. Our designers prepare mobile versions and carry out the update for the layout of versions for different screen sizes.

There were few minor feature updates:

  • Feedbacks form will be added to the "Swap" page.
  • Introduced a gas estimation that would display "how much gas a user will spend if swapping a token of each standard" to showcase that ERC-223 swaps could be cheaper even when this option is not selected.
  • Added a state message indicating the need to confirm an action on the wallet side.
  • Added routing visualisation.

All the changes and updates can be reviewed in our Figma:

https://www.figma.com/file/PqZCc7iExMXpZ2nEU9oRDx/%F0%9F%94%84-DEX223-Exchange-%F0%9F%94%84-(Copy)?type=design&node-id=2460%3A62488&mode=design&t=hxX6Z0EGv3XXcwDQ-1

Dex223 Marketing report

This time we've prepared a recap of the marketing activities that were performed by the team. There were a total of 52 AMAs in 2024.

Dex223 subreddit was created (https://www.reddit.com/r/Dex223/) and a separate subreddit for ERC-223 (https://www.reddit.com/r/ERC223).

A total of 73 press releases were published on different media platforms.

We are currently discussing partnership opportunities with 2 EVM chains and negotiating the opportunity to list D223 and introduce ERC-223 support with centralized exchanges. The details can not be revealed until there is any official announcement so follow https://twitter.com/Dex_223 for the updates.

Press Release Wed, February 7, 2024

Yahoo Insider: https://finance.yahoo.com/news/dex223-revolutionizes-decentralized-exchange-landscape-181500100.html

Business Insider: https://markets.businessinsider.com/news/stocks/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation-1033043258

Morningstar: https://www.morningstar.com/news/accesswire/831937msn/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Marketwatch: https://www.marketwatch.com/press-release/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation-ab4109df

Yahoo Paper: https://yahoopaper.com/press-release/2024-02-07/6931/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

CBS News: https://cbs247news.com/press-release/2024-02-07/6925/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

AccessWire: https://www.accesswire.com/831937/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

BizWire Express: https://www.bizwireexpress.com/showstoryAccesswire.php?storyid=24170

King NewsWire: https://kingnewswire.com/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation-2402079568/

Street Insider: https://www.streetinsider.com/Accesswire/Dex223+Revolutionizes+Decentralized+Exchange+Landscape+with+ERC-223+Innovation/22734839.html?classic=1

Digital Journal: https://www.digitaljournal.com/pr/news/accesswire/dex223-revolutionizes-decentralized-exchange-landscape-1640681492.html

Finanznachrichten.de: https://www.finanznachrichten.de/nachrichten-2024-02/61348476-dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation-200.htm

Menafin: https://menafn.com/1107824314/Dex223-Revolutionizes-Decentralized-Exchange-Landscape-With-ERC-223-Innovation

Development Tone: https://developmenttone.com/press-release/2024-02-07/6930/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Crypto StudyStock: https://cryptostudystock.com/press-release/2024-02-07/6917/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Branding News: https://brandingnews.net/press-release/2024-02-07/6940/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Springfield TV: https://springfield-tv.com/press-release/2024-02-07/6927/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Economy Jack: https://www.economyjack.com/2024/02/07/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation/

Georgia Timeline: https://georgiatimeline.com/press-release/2024-02-07/6916/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Hot Speak Times: https://hotspeaktimes.com/press-release/2024-02-07/6915/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Expert ProTech: https://expertprotech.com/press-release/2024-02-07/6912/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

North Tribune: https://northtribune.us/press-release/2024-02-07/6941/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

America Insider: https://america-insider.net/press-release/2024-02-07/6909/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Alwatan News: https://alwatannews.co.uk/press-release/2024-02-07/6935/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Euro Hotline: https://eurohotline.us/press-release/2024-02-07/6938/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Globe News: https://goblenewspr.com/press-release/2024-02-07/6937/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Yorkweek: https://yorkweek.us/press-release/2024-02-07/6952/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Brand News 24: https://brandnews24.us/press-release/2024-02-07/6939/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Genie Research: https://genieresearch.co.uk/press-release/2024-02-07/6913/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Medical Research TV: https://medicalresearchtv.com/press-release/2024-02-07/6908/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Hot Talk News: https://hottalknews.com/press-release/2024-02-07/7086/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Ceramicb: https://ceramicb.com/press-release/2024-02-07/7107/dex223-revolutionizes-decentralized-exchange-landscape-with-erc-223-innovation

Press Release Mon, April 15, 2024

Access Wire: https://www.accesswire.com/853000/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Yahoo Finance: https://finance.yahoo.com/news/dex223-multi-chain-deployment-game-200000521.html

Markets Business Insider: https://markets.businessinsider.com/news/stocks/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility-1033247844

Markets Financial Content: https://markets.financialcontent.com/stocks/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Market Watch: https://www.marketwatch.com/press-release/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility-2a78bc78

Big News Network: https://www.bignewsnetwork.com/news/274271158/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Kansas City Post: https://www.kansascitypost.com/news/274271158/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Digital Journal: https://www.digitaljournal.com/pr/news/accesswire/dex223-multi-chain-deployment-game-changer-crypto-153340304.html

King News Wire: https://kingnewswire.com/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility-24041411064/

Economy Jack: https://www.economyjack.com/2024/04/14/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility/

Benzinga: https://www.benzinga.com/pressreleases/24/04/38240586/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Rickett Grain: https://www.rickettgrain.com/markets/stocks.php?article=accwirecq-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

CEO CA Newsroom: https://ceo.ca/newsroom?fac88d88c617

Finanznachrichten: https://www.finanznachrichten.de/nachrichten-2024-04/61940991-dex223-dao-llc-dex223-multi-chain-bereitstellung-ein-game-changer-fuer-die-zugaenglichkeit-von-krypto-boersen-200.htm?lang=de

Business Times Online: https://business.times-online.com/times-online/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Research Studio: https://researchstudio.co.uk/press-release/2024-04-14/7798/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility-2

Funds Special: https://www.fundsspecial.com/2024/04/14/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility/

Finance Zeus: https://www.financezeus.com/2024/04/14/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility/

The Ridgway Record: https://business.ridgwayrecord.com/ridgwayrecord/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

My Mother Lode: https://money.mymotherlode.com/clarkebroadcasting.mymotherlode/article/accwirecq-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Marketers Media Newsroom: https://news.marketersmedia.com/dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility/89127078

Punxsutawney Spirit: https://business.punxsutawneyspirit.com/punxsutawneyspirit/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Wapakoneta Daily News: https://business.wapakdailynews.com/wapakdailynews/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Big Spring Herald: https://business.bigspringherald.com/bigspringherald/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

St. Marys Pennsylvania - The Daily Press: https://business.smdailypress.com/smdailypress/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

WN.com: https://article.wn.com/view/2024/04/14/Dex223_MultiChain_Deployment_A_GameChanger_for_Crypto_Exchan/

The Newport Daily Express: https://business.newportvermontdailyexpress.com/newportvermontdailyexpress/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

The Pilot News: https://business.thepilotnews.com/thepilotnews/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Stark Ville Daily News: https://business.starkvilledailynews.com/starkvilledailynews/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Borger News Herald: https://business.borgernewsherald.com/borgernewsherald/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

The Evening Leader: https://business.theeveningleader.com/theeveningleader/article/accwirecq-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

The Saline Courier: https://business.bentoncourier.com/bentoncourier/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Investor Wedbush: https://investor.wedbush.com/wedbush/article/accwirecq-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Malvern Daily Record: https://business.malvern-online.com/malvern-online/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

The Chronicle Journal: https://markets.chroniclejournal.com/chroniclejournal/article/binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Pilot Grove Coop: https://www.pilotgrovecoop.com/markets/stocks.php?article=binary-2024-4-14-dex223-multi-chain-deployment-a-game-changer-for-crypto-exchange-accessibility

Video content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment