Statemint Update / Roadmap

Rae, if there is no dedicated team building liquidity here, there won’t be any liquidity for people to place orders against. I don’t see how a DEX can fulfill “bulk trades” with thin liquidity. Thin liquidity might solve the “I just need 1 DOT to keep my account from getting closed” issue for users, but bulk trades by definition require lots of liquidity or high slippage will result.

1 Like

Hey, Atticus here; core contributor to the largest DEX on Moonbeam (& Polkadot) right now.
Appreciate highlighting the roadmap, and great to see a lengthy discussion so far.

It seems that the core argument for instituting a DEX on a common good parachain is the synchronous handling of DOT fee to asset fee conversion directly on statemint since the following (crucial) point has been addressed in the above discussions;

  • Pain point of asset withdrawl from Custodian > Statemint > Parachain can be addressed through a business relationship between Parity <> CEXs for users to specify target/destination parachain on the withdrawal transaction

If we agree on the above, then the argument for a DEX takes a secondary step since there are various ways to achieve the intended objective – allowance for (other) asset fee conversion on Statemint – which is ultimately, one of the UX aspect on Polkadot that, while we agree requires optimizations, should not drain Polkadot of the massive resources (time, resources, funds) required to operate a fully functional DEX that encompass emissions mgmt, governance, support, maintenance etc. Even if say, the operations is outsourced to a stateDEX, the design decisions around liquidity management and the economical/political vectors would create a rabbit hole that’ll just undermine the premise of Polkadot.

The main contention of enhancing the UX via asset fee conversion on Statemint doesn’t justify the corresponding (cumulative) work required for effective liquidity management, which should be an objective undertaken by specialized liquidity hubs operating on each parachain, as with any L1s in DeFi. If I may, perhaps an equivalent parallel on how StellaSwap addressed the same issue is via our feature of “Swap-for-Gas”, which essentially allows first time users that do not have any GLMR (Moonbeam’s native token) when bridging their assets to Moonbeam to perform gasless swaps of their first-time-bridged-asset (e.g. USDC/USDT/ETH/WBTC) into GLMR. This transaction, since gasless, doesn’t require GLMR and therefore, there is no need for a user to have GLMR to start transacting on Moonbeam. This feature radically enhances UX, as outlined in the objective of this thread, but still, it is a secondary feature.

And btw, we spent a tremendous amount of time internally and top protocols like Moonwell in developing a liquidtiy plan for Moonbeam during the public grants process. Our grant proposal (which passed), can be seen here: grants/MBGP1.md at 1efdeeb04d7d3d58350c270e616057252296e99b · moonbeam-foundation/grants · GitHub. Perhaps this is useful in understanding the extent and depth of creating baseline liquidity for the ecosystem; merging it with the resource requirements and economical+political risk vectors would be a good benchmark in understanding the need for a stateDEX for UX optimization.

6 Likes

Thanks everyone for engaging so much on this thread. Will focus this reply on the DEX part. I think there are three main questions:

  1. Should Statemint have a DEX? What would the goals be?
  2. If yes, what properties should it have?
  3. Who should build it? (And, what is “it”? What are the objective functions?)

First, I see this brought up all the time. Some examples here, here, here, here. I think everyone wants the Treasury to award proposals in stablecoins (one discussion here). I’ve heard from investors that they think Polkadot is not a viable ecosystem because it doesn’t have a DEX in the core protocol, and this hurts teams trying to get funding to start their project on Polkadot. SR Labs has also raised a few issues (one related to fee payment mentioned here), all of which are solved by the ability of synchronous asset conversion. I’ve argued against a Statemint DEX for a long time, but I have to say now that I believe any time not having one is hurting the entire ecosystem.

Second, I think a DEX on Statemint, as part of the Polkadot protocol must be trustless (ideally no privileged functions, and any of them granted to Relay Chain governance tracks), credibly neutral (not prevent any asset from being used), have a third-party security audit, and be usable with only DOT (but possible with other assets too).

Third, who should build it? But first, what is “it”? As people have pointed out (I think @alice_und_bob said it best), a DEX pallet is the easiest part of the entire thing. It needs tooling, an XCM interface for interaction with other paras, compatibility with permissionless access means (light clients, wallets), UIs/access points that cannot censor users/transactions (or at least enough access points such that users have a credible expectation of always finding one avenue), liquidity participation, and probably more.

I never said that Parity would do all that. And that’s one of the reasons we’re having this discussion. If it has any hope of meeting its intended goals, it needs effort from a lot of different groups. Yes, Parity can make a pallet, but that’s only a fraction of the work. There’s really no argument or delusion from me on this point.

Finally, I understand DEXs compete for liquidity and users. And I know that the simple xyk style is not optimal. A DEX on Statemint should optimize for security (buying execution, absolute permissionlessness), neutrality, and a means for the Treasury to reliably grant proposals in stablecoins. But I don’t expect it to optimize for competition with other options in the ecosystem.

6 Likes

It seems incredible to me that we’ve seen this exact situation within the past year, and nobody has brought it up yet.

CosmosHub (ATOM’s native chain) was created as a credibly neutral hub for the Cosmos ecosystem, providing a center point on the IBC network and eventually shared security. But the ATOM team felt there wasn’t enough value accrual to their token, and furthermore what better place to have a dex than at the crossroads of the Cosmos ecosystem?

After all, not only did most Cosmos chains have IBC connections to the Hub, ATOM is listed on basically every exchange. How convenient! So they created Gravity Dex, allocated dev resources to it (at the cost of delaying shared security) and allocated ATOM for rewards.

But there was a big problem with this. It wrecked the credible neutrality that the CosmosHub needs for its other features to work. Sunny Aggarwal (founder of Osmosis, a Cosmos ecosystem dex) said in an interview that Osmosis couldn’t use shared security now that ATOM was a competitor. And what about the place of the ATOM token, which previously had been a popular quote currency on Osmosis? Would it still be appropriate in that role?

What about the other chains, building in Cosmos’s ecosystem, but perhaps also competing against what now was apparently going to become a DeFi hub?

So…what happened? Well, it turns out that the Atom team wasn’t nearly as good at building a dex as the folks who’d built a chain specifically for that purpose. GravityDex was a failure, and ended up spinning off into its own chain (rebranded Crescent now). The ATOM team then refocused their efforts on shared security, which they’ll end up delivering much later than if they hadn’t created this distraction for themselves.

In summary, please review what happened in Cosmos before making the same mistake. Keep common good parachains as genuine common goods. IE things that everyone benefits from, but aren’t commercially viable.

5 Likes

I wonder if the proposal should rather be for Statemint/e to provide a “DEX distributor”? Things like payment for order flow are passed along to the end user, etc. Here the obvious issues are interfaces for each DEX and of course the distribution logic…

One can imagine a DEX or it’s users having an incentive to provide interface code. The distribution logic seems the novel/hard part…

Thoughts?

1 Like

Great discussion and read all replies.

IMO the most valuable point of view is to standardize parachain assets through Statemine/t, so that exchanges, wallets, and custodians can support all parachains with only one integration. This can indeed bring a lot of convenience to the entire Dotsama and make more new users enter the Dotsama with a good experience.

But I think to achieve this goal, it is only necessary to provide users with a small amount of token of the specified parachain as the gas fee, and Statemine/t can be used as a place to exchange various parachain tokens through KSM/DOT, but I think it may not a DEX in the traditional sense, maybe I prefer to call it a “Gas Station”, any parachain can provide KSM/DOT <> Parachain Token liquidity for Statemine/t Gas Station by itself, according to the design experience of Bifrost flexible fee, only a small amount of liquidity is needed to meet the user’s demand for a gas fee, so liquidity can come from the community or parachain treasury’s provision.

So, from the perspective of Gas Station, it seems that it does not need to consider more issues about liquidity, competition or operation. Maybe someone will use it as a DEX by providing more liquidity, but I think it will only is a minority. Btw, in my mind that ideally Dotsama liquidity should be characteristically aggregated in different parachains and user trade or collateral liquidation should be done in parachains through aggregator routing and XCM cross-chain.

10 Likes

That’s the thing here - I’m glad that you brought it up. It is not a commercial move at all. There are so many aspects to this that Parity shouldn’t, wouldn’t, and couldn’t own.

Rather:

or

Very glad to see that 1) there are so many first time posters! (Welcome :clap:) and 2) this discussion remains constructive!

3 Likes

I’ve done some thinking into what makes a successful defi ecosystem recently. For any defi ecosystem, there has to be the (1) the right infrastructure (custodian multisig wallet, bridges, the DEX itself etc.) (2) liquidity and (3) the end user.

Right now, the vast majority of users who wants to trade on a DEX would prefer to do it in Ethereum itself because they have (1) and (2) fulfilled. Basically any non-Ethereum L1 is losing massively to Ethereum in Defi due to the infrastructure and liquidity already present in Ethereum.

Being an earlier ecosystem, it’s both the job of Parity as well as other builders in the ecosystem to build (1) and attract (2) and (3). Now, Statemint is whether we like it or not going to be the place where assets like USDT/USDC will be minted. When traders want to trade in Polkadot, they basically aren’t going to want to trade with wrapped USDT/wrapped USDC pairs but the native sufficient version which has to come from Statemint; also very few people would want to trade with Wrapped Eth pairs on Polkadot, since Uniswap V3 has native Eth pairs and way more liqiudity. Without a sufficient amount of USD stables, any DeFi eco is basically dead in the water.

As an “assets parachain”, Statemint should not just be able to generate the assets but also make it easy for institutions/end users to use and integrate with. Since Defi and the traditional finance world revolves around the USD, a first priority should be to figure out how to generate the maximum amount of USD stables (and maximize Statemint’s usecase). While I don’t personally think Parity should operate a full uniswap-V2 dex for many of the points previously pointed out, I think it makes alot of sense if there is some sort of mechanism within Statemint to encourage a DOT<->USDT/USDC swap alone.

Practically speaking, this Statemint USDT/C <> DOT pair would probably be quite liquid. Many DEXes in polkadot can draw from its liquidity through XCM and enhance their own DEX’s pairs (these DEXes can also have their own DOT to USDT/USDC pairs too), and Statemint would also be the preferred “one stop route” for CEXes and other institutions to integrate with Polkadot and bolster Polkadot’s overall liquidity significantly, due to Statemint being where the sufficient assets originate from.

Overall this would allow us to see greater liquidity across the Polkadot ecosystem’s many dexes and more end user demand. One end infrastructure goal that such an integration might enable would be a CEX being able to allow users to directly mint USDT/USDC with DOT because they are both working with Tether and have an easy integration with Statemint.

5 Likes

Currently, the whole ecosystem is quite disconnected, there’s Hydra / Basilisk that is uniting them all etc etc.

I feel the pain and negativity coming from all DEX builders in the ecosystem regarding this proposal.
It’s reasonable and understandable.

I strongly believe that there should be a native StateminE/T DEX. At least for the dark times. There’s no deep liquidity on parachains / dApps at this point.

The first DOT crowdloan results were just horrible. In terms of narrative, Solana / FTX crush is actually one of the best momentum Dotsama had out there.

There needs to be a common good DEX providing basic functionality and, maybe, even gathering liquidity from other parachains.

Like a common-good 1inch for the whole Polkadot ecosystem.

StateminE/T DEX can act as the initial UX problem solution and eventually get terminated via governance vote, right?

What really important is solving the essential UX issue that each and every one of us is aware of.

It might help bring in a lot of new liquidity that will eventually split among dApps and parachains in the search for the best yield.

1 Like

strongly support this good idea. there no need have a DEX for many parachains. acctually I think most of the classic basic defi infrastruture which already verified on eth should be implement on common good chain. polkadot’s parachain also can benefit from it through XCM. and should explore other direction that other chain like eth can not do.

One thing that is becoming clear to me is that I have no idea what the scope of the “DEX” we’ve been discussing is. Would it be possible to enumerate the goals (and non-goals) of the DEX? Or clearly state exactly what the capabilities would be? A dex pallet that any parachain could integrate with sounds a lot different than something like Uniswap that is run by a team of product managers, engineers, and bizdev, so maybe we’re just misinterpreting what you are proposing (highly likely).

2 Likes

I can see that a lot of people will have their opinions on the direction of adding a DEX to Statemint.

Here is my two cents.

I talked about a scenario like this here: How XCM will actually be used with XCMP

As stated in that post, we know for sure that asking users to constantly move funds between parachains will be very inefficient and provide a really bad experience for users. I expect that there will trivial DEX pallets deployed to many chains, even those outside of the DeFi world.

If we agree that statemint will be a hub which contains many different tokens (both fungible and non-fungible), it of course makes sense for there to be some functionality allowing users to trustlessly trade between different assets.

I do not expect that a DEX on statemint would be competitive to any dedicated DEX parachain (in terms of liquidity, UI/UX, or feature set). Nor would I expect there to be any kind of profit mechanism in this DEX, which might have made it a competitor to other parachains. If parachains do feel some single minimal DEX pallet is a competitor, perhaps they should question whether their parachain is bringing enough value to the network.

I also think, if another Parachain can offer a service which completely overshadows the DEX on statemint, then that is great! In some ways, a really base level DEX acts as a floor to our ecosystem, and we should push parachains to provide experiences which incentivize users to trade on their chain, versus keeping assets on statemint.

Finally, I would probably want to point out that thanks to our governance systems, no decisions made now or later has to be permanent. It seems backwards to our philosophy to be afraid to add some feature. Instead we should welcome experimentation (of course prioritizing security and safety), and let users decide how they want to use products.

It seems obvious to me that the upside at this time far outweighs any speculative downside.

13 Likes

I personnaly strongly support this proposal as to me, swapping two assets is kind of a common good facility. But I don’t think either Uniswap v2 or any existing AMM based model (except aggregation) is the right way to do it.

I think this dex could bring more users to the eco as the dotsama’s store front, but it has to comply with some rules not to compete with existing dexes, such as not using KSM for incentivizing liquidity, acting as an aggregator, using fees to be redistributed via treasury, and focusing on best execution via order books instead of amms (acting as an aggregator for them).

I think the is a clear misunderstanding and fear of parachains/existing dexes potentially competing with this dex and creating a potential conflict of interest with DotSama’s governance and its own community. I think you guys are wrong.

There is a clear confusion by most of you guys about what brings liquidity into a market and what should and how it should be incentivized. As an ecosystem, we need to support each other and stateminE/T was exactly made for solving the free rider problem in any market, acting as a base model for parachains to develop themselves organically upon it.

I think there are few features that dotsama needs to implement in order to integrate with other ecosystems and eventually with regulated exchanges and institutions as well. Because in the end, only « users » will bring liquidity.

  1. EXECUTION

Any exchange needs to tackle execution as a fundamental feature of its architecture. It’s the primitive that brings liquidity to any market. Substrate’s current execution is not a priority as current dexes are too much focused on economic incentives. But someone as to tackle this. Like in a prisoners game, only a common good architecture can focus on this. That was common good parachains are all about imo: solving the free rider problem.

This dex would not compete AT ALL with any parachain if it could bring the best execution to the ecosystem. It could be done via l2s, TEEs, phat contracts or even « off-chain », and we could even build order books on top of these. On the contrary? It could bring more users to the eco, which we definitely lack of. Which leads me to 2)

  1. REGULATION

As an « official » product from dotsama, it will eventually have to be regulated as an exchange and thus look like an exchange: this statemint exchange could be the doorway to onboard new users to dotsama, as well as institutionals looking for a decentralized best executiton exchange (GSR, Jump, or even investment banks and asset managers).

  1. ANTI-TRUST RULES

There are clear rules that this dex should use not to compete with any parachain, such as never using KSM and an extra incentive for liquidity bootstrapping.

As a common good dex, it must serve parachains to bring liquidity to their ecosystem, not the opposite. But meanwhile, as an official product, it also has to remain independent from other dotsama dexes and not collude with any of them. This has to be taken very seriously by DotSama’s governance to protect the exchange and the well being of the ecosystem.

CONCLUSION

I think this common dex can only be the fuel to the DeFi ecosystem in DotSama. We already have so many pallets related to this to implement it and we could show the power of our DeFi eco via XCM by displaying them in an unified UI.

Last but not least, I’ll quote the GOAT who recently tweeted about polkadex:

« Finally, an exchange which looks, acts and feels like a CEX, coded on @substrate_io, hosted on @polkadot. @polkadex »

this is what imo is this proposal all about.

1 Like

It has been a while since I had my head in the market micro-structure/adverse selection literature, and I’ve just scanned some of the recent lit I’d consider reliable on AMM’s (Uniswap v1, v2, v3)… with that caveat:

I’m not convinced things are as settled as you suggest.

  • front-running (sandwich attacks)
  • price discovery
  • transaction cost volatility (effective spread volatility)
  • adverse selection risk
  • etc.

all seem reasonable metrics, to me at least. I’m far from convinced that, for TVL, “Of course it’s the right metric for a DEX”

Asking the question “Is volume and chain-specific TVL the right metric to judge?” tells me nothing about who should or “…should not be operating a DEX.”

Agreed?

1 Like

My premise, and experience, is that “regulated market” is, eventually, a synonym for “crony capitalism”, is that a core Dotsama use case? My initial impression was the opposite.

If the Dotsama DEX becomes regulated in jurisdiction X, do we pre-commit to evict all users from jurisdiction X? Or do we all get dragged into that regulatory regime?

Why?

If you’re aiming to be regulated… I believe you’ll find this statement the subject of evidence arguments that, contrary to the assertions of person A, the real purpose of feature/rule N, was to give effect to the collusive/anti-competitive objective you just articulated.

As I said above. Some people take anti-competition arrangements seriously. My understanding is that these arrangements have always been justified/rationalized as being for ‘the good of the public’.

Is there an implicit objective to have various legislatures pass laws granting Dotsama an exemption from such laws - like some politically popular sports enjoy in some jurisdictions?

Is it an objective of Dotsama to curry that political support?

1 Like

This may be the crux of the reason our points of view are diametrically opposed.

To my mind an exchange with objectively superior performance and governance could attract the liquidity of those users who value those metrics and governance features.

Who are those users? Well, first: what are the metrics and governance features?

Some users are sensitive to adverse selection risk. Others prioritize predictable execution costs. Etc.

Does the liquidity you desire reside with the users your exchange appeals to?

Is there a single exchange design that is optimal across all attributes all individuals care about?

1 Like

From a normal user’s standpoint, i totally agree with this guy. It’s hard for me to accept the reality when the “forcibly transferred” user’s asset from Acala’s team with the weight of their token to control the governance, what if i just trust Polkadot’s protocol, not parachain’s team, what DEXes (gas station) that i’m able to use to find a storm-shelter for hacks on parachain if not the one on statemine/t?

1 Like

I will comment only on the DEX side here.

As a power user of most L1s and someone who is by now absolutely jaded by the “DeFi” meme, I would tentatively support a Statemine-level DEX, with well defined caveats.

It is undeniable that every new DEX fragments liquidity and is by definition a vampire attack on all others, while also usually just introducing another perma-go-down token as a bribe, optimizing for presale whales. This system is a broken race to the bottom, and I think it is long overdue for a serious revamp - a Statemine-run DEX would, I think, force DEX teams to think outside the box, not to mention improve the UX across the board if truly abstracted as presented above.

However, liquidity is a serious problem as pointed out by others. The Statemine DEX cannot serve “as a floor” because if there is no liquidity on it, there is no liquidity. If the liquidity is too low on, say, Zenlink, there is no reason for the LPs that are there to pool together into Statemine DEX, not without incentives.

As such, I think the only way that DEX could be viable, apart from the Treasury itself LPing, is:

  • introduce an LP reward in DOT which should, in theory for DOT pairs, be around the staking profit % so that people have a reason to LP and risk IL
  • the DOT reward is funded by treasury, instead of a burn, redirect 0.2% to the DEX, like Kusama currently pays kappa sigma mu instead of burning KSM.
  • regular governance proposals can change this % as needed, as more pairs show up
  • introduce pool balancing such that a user-submitted setting proposal can change these, and use DOT governance to vote on this, so that if, say, USDT/DOT becomes unbalanced vs RMRK/DOT, it can be rebalanced with rewards (like Curve gauges)
  • automatically create a DOT/X pool for every X token which is voted in as sufficient, or is bridged from Kusama as already having been sufficient there, and automatically redistribute gauges on a weekly basis to include it in order to trigger a rebalancing, and attract LP and DOT holder attention, so that a manual rebalance can be considered
  • allow secondary reward pools on top of every pair, which can be funded by anyone at any time with any sufficient Asset. This will incentivize teams to add more LP rewards into every pool.

By doing something like this we force innovation, concentrate simple-DEX liquidity into an actually usable pool of volume, help CEXes integrate these volumes properly, and generally possibly do a lot of good for teams that want to build creative UIs and/or aggregators, or maybe even incentive models for their dapps which behind the scenes use this DEX.

I understand this is an existential threat to some DEX teams, just as the NFT side of things is for us, but sometimes stuff like this needs to happen so we can stop kicking the can down the road and dreaming of “if we build it they will come”. So I am cautiously optimistic about this direction.

6 Likes

Look in any CEX at any L1 (or L2) and tell me what the highest volume pairs are for that asset: it’s the L1 (or L2 asset):USD stables pair, because that’s what institutional traders trade on and that’s what exchanges integrate with.

The only major advantage Statemint has as a DEX is because it’s a home for sufficient assets, which means its usage as a DEX would mainly involve users (primarily institutional) trying to enter the ecosystem through stables. and that’s why the only DEX solution that makes sense for both trading and integration is one with only a few pairs between DOT and sufficient assets. For a pair like DOT/RMRK, Statemint confers no advantage here over other DEXes, and other DEXes can simply do the same job but way better. In addition, limiting pairs allows people to focus resources on supporting that pair as much as possible and any funding from the Polkadot treasury in DOT to be spent on the things that matter most.

Therefore we should still do a DEX but limit it to only a few important pairs that empower other DEXes to innovate and draw from Statemint’s resources.

3 Likes

Generally, I agree. However, that does not mean Statemint has to stand still.

I’m skeptical there is one DEX to rule them all, or even “most” of the users.
I could be persuaded there is one UI/UX and routing algorithm to rule “most” of them.

What preferences should that UI/UX reveal (in the sense of ‘allow Statemint to use’, rather than ‘expose a secret’)? DEX have incentives to help here as well as police each others behavior.

Asking users is hard, but each existing DEX should be obsessing on: what do our users want.
So ask them: what metrics (quantitative: minimum avg/median spread, minimum spread volatility, etc ) or characteristics (qualitative: KYCounterparty, etc.) are you targeting.

Then offer users a dream experience. DEX and user should be happy.

As a CGP the DEX’s can inspect the code and be confident Statemint doesn’t play favorites or misbehave.

Statemint could attract users and DEX (i.e. make both happy) if we can come up with ways to:

  • Preserve pathways for new DEX entrants (or different phases of maturity/development).
  • Provide new/refined UI/UX pathways for new user categories.
  • Provide opportunities for users to insure against any known risks (rather than exclude a DEX).
  • Allocate between DEX’s when two or more DEX have indistinguishable metrics/characteristics.
  • Preserve competition when the metrics of one fully/partially dominates another (related to 1, but could be a long-term feature/characteristic).
  • Allow under-performing DEX to fail (related to 1.).
  • Verify the performance metrics a DEX claims (part of the price of admission, but see 1).
  • Validate DEX qualitative claims (as above).

That is Statemint should be DEX agnostic. In fact it should be ignorant of the fact I’m running an off-chain LOB - as long as I don’t claim I’m running an on-chain AMM.

If all existing DEX refuse to participate or oppose something like the above, perhaps then Statemint would be justified in creating a standalone DEX?

Have we reached that point?