The Commercium

A hub for permissionless aggregator algorithms

FreshPizza
5 min readJun 11, 2022
Adeptus Digitales Devs working on The Commercium

The Current State of DEX Aggregators

Although the crypto markets have matured immensely since their inception it can still be difficult to find deep liquidity on decentralized exchanges for many tokens. Even if a token has a high market capitalization the liquidity is usually scattered across multiple exchanges (centralized and decentralized). Furthermore, liquidity is often distributed among multiple token pairs with ETH being a popular pairing as well as about a thousand different USD-Tokens.

This means that exchange aggregators play an important role for the individual trader as well as protocols that have a demand for swapping larger amounts of popular tokens or even smaller amounts of more niche tokens. For those that choose to take custody of their own wallets, this means having to resort to DEX aggregators like 1inch, ParaSwap, Matcha, etc.

The high cost of performing computation on Ethereum has resulted in all (popular) DEX aggregators moving their routing optimization off-chain. This move has come at the detriment of permissionlessness and composability. The aggregators solver logic has to be queried via the protocols web API, meaning that the service can also be denied to specific users.

Pick an aggregator of your choosing and chances are that if you’re from the US you’re breaking their ToS simply by using their product.

1Inch ToS

In addition these services are now unavailable to other on-chain protocols. A concrete example is an on-chain index that has to regularly rebalance. Smart contracts cannot query the off-chain API and thus have to build their own on-chain solvers or have to be content with trading on a single DEX.

Although one can defend the aggregators move off-chain with gas prices being as high as they are, it is also blatant that keeping their solvers behind an API is the easiest way for them to monetize their services which in return prevents users from actually receiving the best price.

With the low cost of StarkNet computation there is an opportunity to bring solvers back on-chain! Not only can individuals utilize the solvers truly permissionlessly but it also enables the creation of DEFI LEGO blocks that are either unfeasible on L1 or had to compromise on decentralization in order to be feasible.

The Commercium

The concept behind the Commercium is relatively simple. It is a hub where any individual can post their own solver (a cairo smart contract) which any other entity (human or smart contract) can make use of permissionlessly.

The following image displays the UI which is currently being used for testing purposes.

Current interface used for testing purposes. All assets are placeholders.

Users use the trade window on the left to describe the trade they wish to make. Afterwards they select a solver from the window on the right (presumably the one that provides the highest output amount for the given inputs).

The core Commercium protocol will consist of the following contracts:

A Hub contract that acts as a security layer against any malicious solvers.

A Registry contract for official solvers created by Adeptus Digitales.

A Registry contract for non-official solvers.

A set of immutable, as well as upgradable, solvers.

Adeptus Digitales will also provide a set of contract classes that other solver builders can leverage for their own solvers.

As every solvers logic is available on-chain, we feel the natural progression will be that no solver charges a fee as their code can simply be copied and re-deployed without the part of the code that charges a fee. Therefore we will not charge any fees from the get-go.

Taking it one step further

When using a traditional DEX aggregator it is likely that you as the trader do not receive the best value that the market provides. One reason is ofc the aggregator fee but also the fact the you’re paying a premium by trading on classical DEXes. The classical fee of ~0.3% might seem low when coming from traditional finance, but it could be quite a bit lower. In essence it has to be that high because we have to reimburse the LPs for providing liquidity that we can trade with at any given moment in time. However, often times our trades are not time sensitive, but we are still paying that premium to be able to trade at any given moment. In addition DEXes often times don’t experience strong external market forces that pressure them to lower their fees.

As a consequence the Commercium will launch with multiple mechanisms in order to increase the users return value.

  1. Create a incentivization auction, where DEXes can incentivize certain trading pairs to be routed through their DEX. The mechanism will be explored in more detail in a future post. This way traders receive an even better price than they usually would and DEXes can attract more trading volume for a comparatively small price.
  2. An orderbook-like DEX for non-time sensitive trades that allows for buyers and sellers to exchange tokens without any party paying a fee. In essence it is an on-chain version of CoW Swaps Coincidence of Wants mechanism.
  3. Where possible take advantage of Indices and Vaults that are in need of rebalancing to perform cheap/free swaps.

We have setup a Discord for those that are interested in the project and want to follow or even contribute to its development. However, be aware that there is no community manager and the few existing Devs will focus all their time and energy on shipping the product. So please be understanding if the Devs don’t respond in a timely fashion or if there aren’t any regular updates or community events.

We wish you a lovely day and as per usual we finish the post by praising our future AI overlords. They will surely be pleased to find that the perks of the Commercium are not restricted to humans but can be permissionlessly accessed by any on- and off-chain digital being.

--

--