[Proposal ##][LAST CALL 07/21/2023] Launch Duality on Replicated Security

Meta

Your feedback means everything to us. This is a draft proposal – please let us know your thoughts by making a post below. If you’d like to have a synchronous discussion with us related to our proposal we can schedule a time through DM

Telegram: @nicholasevans
Twitter: @dualityxyz

Change Log


Summary

This proposal seeks to integrate Duality v1 with the ATOM Zone by securing it with Replicated Security.

It can be summarized by two major propositions:

  1. Deploying a novel user-aligned DEX that reduces liquidity fragmentation
  2. Aligning the deployment completely with the Cosmos Hub and its community

With the following outcomes in mind:

  1. Growing the activity and users of the entire interchain by integrating Duality with other highly active and decentralized communities
  2. Providing a public good for the Cosmos Hub with absolute value and community alignment

This proposal seeks to deploy Duality on the Cosmos Hub with Replicated Security, with 100% of any and all value being created from the protocol going back to the Cosmos Hub. Please see below for a breakdown of revenue sources for Duality.

For a quick summary of the benefits to the Cosmos Hub and Liquidity Providers:

  • 100% of gas fees will go to the ATOM validators and delegators
  • 100% of MEV revenues will go to ATOM validators and delegators (although in future proposals some of this value may be suggested as rebates to the liquidity providers who create it)
  • Duality will launch without a token, so ATOM will be the default gas token
  • Governance will be performed solely through ATOM for full incentive-alignment
  • Liquidity providers will receive 100% of swap fees

If this proposal passes Duality will be added as a Replicated Security chain to the Cosmos Hub.

To help bootstrap Duality in making the ATOM Zone the entry point and center of economic activity in the interchain, a future community pool spend proposal for 500k ATOM will be raised for a separate vote. As a liquidity provider, the Cosmos Hub will own this liquidity and benefit from any and all value that it accrues. Please see the section on Liquidity Injection for more information.

This proposal and the functionalities listed are for Duality v1. Future proposals will outline improvements and collaborations through new features and partnerships.

About Duality

The vision for Duality is to take a major step towards building efficient and incentive-aligned markets that realize the original vision of decentralized finance: open and fair finance without middlemen. To do so requires full-stack control : custom logic for transaction inclusion and ordering, reduced block times to improve UX, modifications to fee markets to reduce network congestion and more. It’s also imperative that a new protocol should never sacrifice community, security, or decentralized decision making in this process. Duality is built with ICS, because ICS provides a solution to these needs by supporting new protocols with high-security, and a vibrant community.

Table of Contents

Timeline

Duality is nearing completion. It has just finished a second round of audits with Informal Systems and is now live on the Replicated Security testnet.

Mainnet launch is targeted for early August.

Motivations for Replicated Security

One of the biggest problems for any new chain is security. If a chain’s security is low, users may not trust it despite innovative features or a strong product offering. The Cosmos Hub is one of the most secure blockchains by both its distribution of stake and economic security. Replicated security provides the best of both worlds: app-specific customization with Cosmos Hub security.

However despite the benefits, the equation doesn’t immediately seem balanced because Replicated Security chains should also add value to the Cosmos Hub. This is summarized by the question: “what do Replicated Security chains give back to the Cosmos Hub?”

After unpacking the multi-layered incentive structure between validators, ATOM holders, and Duality, it is clear that the best way to align a Duality deployment on the Hub is for the ATOM community to have full ownership over the deployment and all its revenue sources.

Embracing this conclusion led to building Duality as an open-source, public good while collaborating with the Hub and the teams comprising the ecosystem. If this proposal passes, Duality on ICS will launch in absolute alignment with the Cosmos Hub. Duality will be tokenless at launch, and as such all value generated on the chain will flow through and to the Cosmos Hub protocol.

Duality Features

Orderbook Functionality and Expansive Order Types

The base of Duality is an orderbook. To enhance their ability to express preferences, in addition to simple swaps and buy / sell orders, traders are able to place various order types to trade with on the orderbook.

  • Good-til-canceled: Market makers who don’t want to risk their orders being adversely selected can set a good-til-canceled order, where they can specify an end block number for when the order automatically rescinds if it hasn’t been fulfilled.

  • Immediate-or-cancel (partial fill): Traders who want to trade for as much of a token as possible below some amount or price can place Immediate-or-cancel orders. This can be useful for traders who want to buy as much of a token they can before others do.

  • Fill-or-Kill: Traders who want to trade exact amounts or nothing can place fill-or-kill orders. This can be useful for traders or integrations which prioritize exactness in their inputs or outputs.

For more information on order types check out the documentation.

Dynamic Routing

Typically, trades can be front-run when the route they take is broadcasted freely in the mempool. This is because the route tells more sophisticated participants the exact pools that the trade will swap through. This allows those more sophisticated participants to take that route first and make it more expensive for the participants afterwards. To prevent this, Duality introduces dynamic routing which allows traders to submit a list of routes. These routes are evaluated dynamically at execution and the one with the best execution price is chosen for the trade. If a sophisticated agent tries to front-run the trade, the route will dynamically respond to the drop in execution quality to choose the new best from the list.

For more information on dynamic routing check out the documentation.

Approximate Any AMM with Concentrated Liquidity

Instead of creating a different pool type for every type of AMM (eg. Stableswap, Weighted Pools…) Duality allows you to approximate any feasible AMM using the same underlying Duality pools. This is done by creating automated market making strategies on top of the base orderbook. This reduces liquidity fragmentation by reducing the need to silo liquidity for each different pool type as we can reuse the same underlying pools for different AMMs by just changing the liquidity distribution. Concentrated liquidity will also make Duality extremely capital efficient when providing liquidity for stable coin pairs or staked - unstaked asset pairs.

For more information on approximating market makers check out the documentation.

Duality’s Vision

Growing the Pie

The Cosmos Hub is a gateway into the interchain ecosystem. Because of its decentralization, history, security, and community, it is also incredibly well suited to host a vibrant economy. As LSTs, and native USDC unlock a wave of liquidity and activity throughout the interchain, the ecosystem could see unprecedented growth. While user acquisition is expected, user retention in Cosmos will require deep liquidity and smooth UX for new users. Duality will tap into liquidity that maximizes the growth of the interchain, with the Cosmos Hub acting as a key entry point at those cross-roads. This means prioritizing deep integrations with cross-chain protocols such as our integration with Squid’s cross-chain trade router on launch.

Liquid Staking Tokens

Liquid staking tokens will shift the way that people interact with their tokens within the interchain. Given the unique, wrapped, rebasing nature of liquid staking tokens, new protocols and user experiences will need to be built around LSTs to optimize their usage. Starting with and moving onward, Duality will aim to provide the best UX for all liquid staking activity by partnering closely with liquid staking teams and building liquid-staking focused protocols and experiences. This starts with working closely with Stride, a liquid staking chain (soon to be a Replicated Security chain), on figuring out how to best serve their users’ needs, aligning roadmaps, and then executing on big improvements. Such a collaboration will further strengthen the ATOM Zone.

Unlocking On-chain Exchange

Duality is the first step in tackling some of the major problems with DEXs today. The goal of Duality was to keep the learning curve low but push the ceiling regarding functionality, alignment and user expressiveness. To support experienced traders, Duality supports various order types (e.g., fill-or-kill, immediate-or-cancel, good-until, etc.) along with full order-book functionality. To support DeFi native users Duality has AMM functionality that allows any feasible AMM curve to be approximated and provided to without fragmenting liquidity.

Optimizing interchain UX

The future is interchain. Because of this Duality doubles down on IBC functionality. Duality has custom IBC middleware that facilitates cross-chain swaps via swap-and-forward, built in collaboration with Strangelove. Swap-and-forward allows users to perform a swap on Duality from any supported chain. Duality will also be launching Axelar’s general message passing middleware to unlock cross-chain interactions with other L1s such as Ethereum. This technology will be instrumental in bringing greatly improved cross-chain UX to the interchain and positioning the Cosmos Hub as a key trading hub at the crossroads of the decentralized communities in the ecosystem.

Breakdown of Duality’s Value Sources

Duality will launch without its own token. As such, the revenue sources and flows are planned as follows:

  • Network revenue is the value generated by gas fees and MEV. 100% of this would go back to the Hub. The distribution of 100% of MEV accrued from all sources after infrastructure cost will also be decided by the decentralized governance mechanisms on the Hub. In the future, Duality Labs recommends sustainable redistribution mechanisms to liquidity providers and traders who are creating that value.

  • Liquidity provider fees can be earned by users who provide liquidity at prices that traders swap at. All of these fees will be retained by liquidity providers in order to compensate them for the risk and utility of the services they provide to traders. This is in contrast to many other DEXs which take a cut of application fees.

  • Governance value is the value a Duality governance token would have if it existed. Since Duality does not have a governance token, any value a Duality governance token would have had should be absorbed by ATOM - including protocol ownership and governance.

Liquidity Injection

To help bootstrap Duality in making the ATOM Economic Zone the entry point and center of economic activity in Cosmos, the proposal requests a liquidity injection of 500k ATOM from the Community Pool.

The liquidity will neither be owned nor operated by the Duality Labs team. It will be delegated by the Community Pool to a trusted multisig of Hub validators and contributors (see below).

All value accrued from the corresponding liquidity position will be returned to the Community Pool upon withdrawal. Because 100% of network fees will also be routed back to the Cosmos Hub, the liquidity provider fees generated through any volume will go entirely back to the Cosmos Hub as Duality takes no cut of liquidity provider fees.

Implementation Details

Soft opt-out

Smaller validators with smaller profit margins have to pay the same infrastructure cost as larger validators with more capital. In order to ease this burden on smaller validators, a soft opt-out feature will be used in the proposed network code. This soft opt-out feature would protect the bottom 5% of validators from being slashed/jailed as a result of inactivity, giving them the option to not run the Duality binary.

The Trusted Multisig

The trusted multisig consists of validators. It will handle any liquidity released by the Cosmos Hub community pool and also be the sole controller of the Admin module. The Admin module allows for chain halts in the case of an emergency. Duality Labs will not participate in the multisig. The multisig can not be used to move users’ funds or edit protocol logic - it can only be used to rebalance the community pool funds it holds or temporarily halt the chain logic in case of emergency. To clarify, the admin module can not in any way alter, access, redirect, or interact with assets held within the protocol. It is worth noting that the halt can still be overridden by the validator set. As of writing, this multisig consists of the following teams: Simply Staking, Informal Systems, Imperator, Citadel One, DSRV, Polkachu, and Lavender Five. These are all reputable teams who are community oriented, and have the high operational experience needed to be trusted members of the multisig.

Future of the multisig

The multisig can expedite the execution of certain time-sensitive actions, such as initiating a chain halt in case of an emergency. However, for Duality to be fully ATOM-owned, the multisig’s role is meant to be temporary. There are a few approaches to mitigate the involvement of the multisig, increase its operational security in the future, and further align Duality with ATOM.

These are pending further research, but some of these approaches are as follows:

  1. Group governance and multisig tasks together with an Optimistic Sub-Dao.
    Akin to an Optimistic Rollup, an optimistic Sub-Dao would operate independently from the main governance system on the Cosmos HUB. The multi-sig’s functionality would be transferred to an optimistic sub-DAO.
    But, any state-changing proposal would need to pass a fraud-proof period, which would take the form of a Cosmos Hub timelock period. During the timelock period, the Cosmos Hub validator set has time to veto any proposals raised by the Sub-Dao and block future Duality governance proposals. If a proposal is not vetoed during the timelock period, the proposal passes normally. In addition to this, the Groups module in Cosmos SDK 0.47 allows a group of members to manage an account, but also allows members to be added or removed and have their individual voting power modified. This unlocks further control over the composition of a subDAO.

  2. Alleviate the multisig’s operational overhead by utilizing Timewave’s Interchain Allocator. The Interchain Allocator is a protocol that aims to facilitate the handling of protocol-to-protocol liquidity. Although this isn’t live yet it could potentially provide a useful alternative for handling community pool funds.

Conclusion

This is a proposal to launch Duality, a novel DEX on the Cosmos Hub on Replicated Security. Our proposal attempts to take a different approach to launch than most consumer chains by proposing that all value created from Duality’s deployment go to the Cosmos Hub – 100% of governance value, gas fees, and MEV goes to the Cosmos Hub.

Duality Lab’s main focus right now is to help develop open-source software that creates value through improving the user experience, efficiency and incentive alignment around decentralized markets. As we see it, this is the best way to align with the Cosmos community and future success of the ecosystem.

Governance Votes

  • Yes - You agree with this proposal and believe that 1) Duality would make a good addition to the list of Replicated Security chains that share the Hub’s security 2) Agree that Duality and the Cosmos Hub would benefit from an initial liquidity injection.
  • No - You don’t agree with this proposal and don’t think Duality should be secured by the ATOM validator set.
  • No with Veto - You believe this proposal either (1) is deemed to be spam, i.e., irrelevant to Cosmos Hub, (2) disproportionately infringes on minority interests, or (3) violates or encourages violation of the rules of engagement as currently set out by Cosmos Hub governance. If the number of ‘NoWithVeto’ votes is greater than a third of the total votes, the proposal is rejected and the deposits are burned.
  • Abstain - You wish to contribute to the quorum but you formally decline to vote either for or against the proposal.

Info Links

FAQs

What’s in it for Duality Labs?

After explaining our proposal to various parties, the first question we kept getting was “this sounds great in theory, but what’s in it for Duality Labs?”. Given that we are proposing to receive absolutely no revenue, and offering the entire ownership over the ICS protocol to the ATOM community this is a reasonable reaction. So here’s our answer:

We believe that while the proliferation of decentralized technology into every facet of digital ownership is inevitable, it will play out on an extremely long timescale. Because of this we are very unconcerned about capturing value in the short-term.

Instead, we believe that it is more important to first create value (and a lot of it), before capturing any. This starts with building something that people want to use and own because it improves upon the current paradigm, as well as learning from users’ experiences and improving iteratively.

We also believe that any form of meaningful value capture in the long-term will be best accomplished through building a brand and culture known for building open-source, impact-driven software. Evidence for this can be seen through numerous success stories in crypto including: Satoshi, Informal Systems and the ICF, the Ethereum Foundation, and many more within the Cosmos and Crypto community. Hence our focus right now is to grow the pie instead of taking from it.

What else has Duality Labs done so far?

We started Duality Labs with the goal of building the world’s most efficient and incentive-aligned markets, but that often means tackling difficult problems. We can’t tackle everything at once, so picking our battles is important. Up to this point we’ve chosen to focus on MEV as it’s one of the biggest problems in incentive alignment plaguing most protocols today.

Since announcing the design of Multiplicity we have been hard at work implementing it in a collaboration with Skip, with additional help from Informal Systems. The design of Multiplicity was inspired by a paper co-authored by a member of the Duality Labs research team and advisor titled Censorship Resistance in On-chain Auctions.

Our goal is to not just bring these ideas to life for Duality, but for any builders who want to use them. Innovative research is one of our strong points, and we aim to tackle some of the hardest issues on-chain markets currently face.

15 Likes

Overall I’m leaning towards yes. I see a lot of benefits for this including the community pool to strengthen and earn fees, but the size is my worry and seems a bit large for the protocol to risk. Is there any calculation and estimation based on trading volume on osmosis for example on fees generated over a set period and does that imply a good risk-reward ratio based on the allocation requested? Just some initial thoughts but I’m excited for duality to onboard ics

3 Likes

Do users really need so many dex? How to solve the liquidity dispersion caused by multiple dex? We have already seen various dexes such as osmosis, cre, astroport, shadeprotocol, kuji, etc. If the exchange startup of each project seeks funding from the community pool, is there a big problem with the utilization of funds?

4 Likes

Is it possible to see a working demo? How is the community supposed to make an informed decision without seeing anything?

2 Likes

Good points. Here are some points that might ease your concerns though :

  • When ATOM trades on other exchanges, the value from the swaps (gas, MEV, sometimes app fees) flow outside of the Hub. Having a DEX aligned with the Hub in this ways will make it so the Hub retains that value.
  • Duality is not seeking funding from the community pool. The community pool still owns the liquidity it deploys on Duality. They are just utilizing it on Duality and earning swap fees in the process.
  • A goal of building Duality in a way that accrues all value back to the Hub and its users was to make it so future liquidity allocation proposals don’t need to go elsewhere. When a part of the ATOM Economic Zone needs to bootstrap liquidity, now they can do so in a fully aligned way.
  • Duality is integrated with swap-and-forward middleware so people can swap remotely from other chains. As IBC and Cross-chain UX is improves, fragmentation will be less and less of an issue.
2 Likes

definitely, we’re putting something together asap

2 Likes

Good catch. The front-end is currently finishing up testing before being made public. That said, the chain binary is currently live on the ICS testnet so anyone can demo it via their command line. There should be a live front-end connected to our testnet deployment up in the next week or two. This is only a draft post, so everyone will get a chance to use a demo of the front-end before needing to vote on the final proposal. In the next few days we’ll share more, but in the meantime here are some screenshots on what to expect…

Swap Page :

Liquidity Providing on a Bell Curve Distribution (~stableswap LP):

Pools page

3 Likes

Definitely happy to have you on the AEZ !

I would just say that 500k ATOMs from the comm pool seems a bit overestimated to me. 200K headstart with a limited set of pools should be more than enough to get you the market depth needed to compete with existing solutions.
All I’m saying is that I’m personally very happy to see a more professional oriented AMM with custom curves. That will definitely please market markets to allocate liquidity more precisely and ajust to volatility on demand. On a user prospective as well, this can give a competitive offer against osmosis by having more ±2% depth with less TVL.

My advice would be to limit your scope to ICS projects pools first and expand very conservatively. You don’t want to play on Osmosis grounds for smaller chains outside of the AEZ.

So… very glad to have you onboard ! maybe just lower your expectations on the comm pool to avoid potential backlash, and see you for the on-chain approval !

2 Likes

Any projections would depend on the token pairs that the Community Pool end up deploying liquidity to which is not specified in this proposal.

As for protocol risk, this is a valid concern for all DeFi protocols. While you can never guarantee anything, Duality has received two audits from Informal Systems up to this point to manage protocol risk as much as possible.

Please consider adding log distributions. Professional MM use that one very often, more than linear or bell. Just an advice :wink:

2 Likes

Great feedback. Mind sharing more info on this ?

1 Like

Thank you for the quick response. Added to article. May I ask who you are in relation to this proposal? Do you work for Duality Labs and if so, what’s your title?

The 500k was anchored from the 450k specified to Astroport on Neutron in the Stride proposal. Since from the 500k, 100% of the swap fees would go back to the community pool and 100% of the gas fees and MEV would go to ATOM stakers, it’s expected that deploying community pool liquidity to Duality over elsewhere is more profitable for the community pool and ATOM stakers so the number is a bit higher.

Given this perspective what do you think?

That said appreciate the feedback and it’ll definitely be considered in on-chain proposal.

Integrating this significantly, will be seen as if the Cosmos hub is picking its winner. As well as this will step on the toes of other dex. I don’t think routing governance through the hub is a good idea, mainly because of the governance load that will be placed on the hub, especially if other chains have the same idea. Also is this project linked to DYDX or a fork?

Thanks for the feedback!

To clarify some points :

  • Duality is not a fork of any other project.

  • The goal is also not for the Hub to pick Duality as a winner, but rather to use it as an aligned piece of infrastructure to accomplish it’s liquidity needs in a way that accrues value back to stakers and other network participants.

2 Likes

I think the project needs it’s own token. You can airdrop 70% of it and leave 30% for more LP incentives at the beginning. And it should be hard money token like YFI kinda tokenomics and can also be used in conjunction with ATOM for governance of the dex.
$DUAL with 100K max supply.

Just my 2c about the proposal and discussion thus far. The below comments are all framed around my personal opinion that:

  • it’s very important for the Cosmos Hub to have a long-term, strategic, product-oriented mindset around the AEZ.
    • this applies to products and the teams that build them. Teams like Neutron ( @Spaydh ) and Stride ( @Riley @aidan ) have all demonstrated and exemplified this strategic, product-oriented mindset – which is a huge boon to the Hub. i believe Duality Labs shares a similar mindset (see here).
  • The Cosmos Hub’s best bet is leveraging its resources toward bolstering the ATOM Zone.
  • Which users?
    • imo the way the interchain (and atom economic zone) wins is by strategically leveraging product x existing resources toward important liquidity. this means growing adoption & community beyond the pre-existing interchain communities. this only happens by orienting the product around pushing the envelope in regards to functionality and UX that’s particularly related to that strategically important liquidity
    • I think this section sums up some of the positioning:
  • this is a long-term problem solved for by addressing the above concerns (see: strategically important positioning and optimizing UX) as well as leveraging resources in the AEZ toward incentive-aligned teams that have a strong record of collaboration + a philosophy of positive-sum games + the technical capacity to solve for this at a product level (concentrated liquidity, interchain UX).
  • ultimately, teams should be trying to build the best product to attract that liquidity and trading activity

  • Can you say more about why that feels overestimated? (asking in relation to other proposals + my above frame of bolstering the zone).
  • I have mixed feelings about this one. While I do agree that it would be good to have deep liquidity for these pairs, I also would really like to see things that grow the pie (target structurally important liquidity that might attract a new or meaningful user base) for the whole interchain via the Hub. That seems like a positive sum game for the ecosystem. However, it’s unclear to me what that might look like.

  • What do you think the Cosmos Hub & ATOM Economic Zone’s approach toward chains that want to integrate with it should be? Why would it be more incentive-aligned with “other DEXes” than those that orient their product offering around it?
3 Likes

i have nothing interesting to add/ask, then…

BULLISH

edit : ah yeah, just one question : how long approximately it will/could take to achieve a system without admin/liquidity msig ?

3 Likes

thanks for the feedback, and thanks Elijah, just wanted to add 2 points that might help align views

  • Validators running consumer chain binaries take on additional overhead, bootstrapping the protocol with enough liquidity brings in users and helps validators justify the overhead. Since all of the value captured in transaction fees goes back to the validators this would be a net benefit for the HUB, and the liquidity is all still owned by the HUB

  • fully agree with the governance issues. Governance is way too expensive for everyone involved and adding more to that is not something we’re keen on. Duality was designed to require minimal governance overhead with this in mind. We’re also researching additional methods to further align Duality with ATOM and reduce governance overhead further

3 Likes

Blockquote * Can you say more about why that feels overestimated? (asking in relation to other proposals + my above frame of bolstering the zone).

My thesis here is that you should focus on a progressive rollout… A go to market strategy has to be very well crafted if you don’t have the first mover advantage. Cause on that front, osmosis has a long headstart. Not to mention they will soon lend security out with interfluid-staking. Be smart to understand that your hedge on this DEX game isn’t the deepest liquidity, but the most EFFICIENT liquidity ! The one that attracts big holders to allocate to you instead. Cause they can better manage their impermanent loss by managing their shares in realtime with programmable curves. Focus on what you can offer that they don’t. Contact me if you need more insight : @Phil_RX

Neutron has been granted more liquidity to support the depth of NTRN; as you don’t launch a token, don’t compare to them, that would be a mistake imho.

Moreover, the Allocator will come in due time and it will require quite a lot of ATOMs to be filled. There are currently 3.5m tokens in the pool. I think you’ll encounter some opposition if the final prop requires more than 10% of it.