Osmosis Updates from the Lab, October 05: Cosmoverse, Mesh Security, Stables
Osmosis Updates from the Lab occurs on alternating Wednesdays at 1 PM EST (5 PM UTC) on the Osmosis Zone Twitter Space. Replays are available on the Osmosis YouTube channel or the podcast.
It has been a while since the last Updates, and there is much to discuss: Cosmoverse, HackWasm, mesh security, and the upcoming addition of stableswap to the AMM. But we begin with a couple of chain updates.
Osmosis Updates
Chain upgrade: The v12 “Oxygen” upgrade on September 30th contained three top-line additions. For more on the upgrade, see RoboMcGobo’s upgrade article and the version release notes.
- The TWAP module (time-weighted average price) allows Osmosis to provide stable, difficult-to-manipulate on-chain price feeds to Osmosis ecosystem apps like Mars Protocol. Those feeds can also be queried by other chains over IBC.
- Interchain Accounts, incompletely enabled in the v9 upgrade, was given full functionality, allowing apps like Quasar (yield vaults) and Stride (liquid staking) to manage assets/contracts on different chains from accounts on Osmosis, and vice versa.
- Finally, Stargaze Queries, which allow CosmWasm contracts to interact with the Osmosis state machine, were re-enabled, this time with a whitelist of permitted queries that pose no threat of non-determinism.
Chain halt: Speaking of non-determinism, Osmosis halted for 5 hours on October 3rd due to a long-hidden bug in the EndBlocker logic. The EndBlocker allows chains to run code from various modules at the end of every block, but in the Osmosis implementation, the modules did not have run in a pre-determined order (to improve developer UX). Therefore when the recent validator set increase to 150 went into effect, some validators increased the validator set size first, then ran the other EndBlockers, while others did the reverse. The resulting chain states did not agree, thereby breaking consensus, in accordance with Tendermint’s preference for safety over liveness. Thank you to the validators and developers for quickly finding and patching the bug.
Cosmoverse & HackWasm
Talks: We do not have time to mention all the great talks at Cosmoverse, but a few stood out: José Maria Macedo (Delphi Labs) on Mars Protocol, the MEV panel with Skip Protocol, Mekatek, and Sunny, as well as the various ATOM 2.0 introductions, the most intriguing of which is perhaps the proposed interchain sychronous blockspace marketplace, the Scheduler.
For a video that gives a sense of the conference atmosphere, as well as some unfiltered takes on the Hub’s new plans, check out the Alpha Roundtable from joint Mars-Osmosis Lab Party. Or watch Jacob get his Osmosis tattoo.
Tales from the Booth: Waterspinner, one of our Osmosis Support Lab admins, ran the Osmosis booth in Medellín. There, he heard many first-hand accounts of people entering the ecosystem through Osmosis. In particular, one person with no previous Cosmos experience, after getting excited about Stargaze NFTs, figured out the entire process in about 10 minutes: bridging from a CEX to a Keplr wallet Hub account, swapping for STARS on Osmosis, and IBCing out to Stargaze. In addition, visitors to the booth mentioned their excitement for concentrated liquidity-powered orderbooks, stableswap, and mesh security. Finally, a number of people expressed praised the developer, validator, and community response to the June exploit.
These reports amplify the overall impression coming from Cosmoverse: the vibes were great, and Cosmos sentiment is booming despite the bear.
HackWasm: In addition to the talks and general networking. Cosmoverse provided a venue for many teams and subteams to sit down and coordinate their plans, notably, Mars and Osmosis. There is nothing specific to report yet, but the Mars launch is getting close, and when it does we will unlock credit, lending, and leverage on Osmosis. Perhaps a DeFi winter is in the offing?
HackWasm itself, sponsored by Stargaze, Juno, and Osmosis, was aimed at unlocking IBC with new cross-chain apps and tools. Jon Ator, Osmosis front-end developer, mentored the teams during the event, helping them make working front ends for their HackWasm contracts. They made heavy use of Dan Lynch’s (Osmosis, Cosmology) OsmoJS and CosmWasm Type-Script code generator, which saved the them a great deal of time and allowed them to focus on the smart contract logic. Jon was impressed with how much the teams were able to accomplish, particularly the winning team, Equilibrium.
HackWasm Winners (from first to fourth place)
- Equilibrium: auto-balancing ETF with cross-chain IBC swap router that utilizes Osmosis TWAP. Presentation here.
- Reverse Osmosis: lock Osmosis LP tokens (GAMM) in exchange for a token lockdrop. Lets airdroppers better target investors, and the locked liquidity is converted to the initial pool liquidity upon token launch: e.g. locked ATOM/OSMO LP shares could be converted to ATOM/FOO, OSMO/FOO pools. Presentation.
- Noisacle: from an Injective Labs team. Permissionless Oracle Infrastructure using the Nois Network (uses drand, distributed randomness beacon), which lets oracle providers be sampled randomly, making them much more secure and reliable. Presentation.
- CosmWonder: smart contract explorer for Osmosis, Juno, and Stargaze with the ability to interact (query, instantiate, etc.) with contracts like you can on Etherscan. Presentation.
Mesh Security
Interchain Security is coming to Cosmos as early as this January. In its primitive form, it will allow a validator set to provide plug-and-play security for any consumer chains that do not want the responsibility of recruiting and managing their own validators, a sort of security SDK. The downside to this is that apps give up flexibility and sovereignty to an external validator set. Notably, Interchain Security v1 was attractive to Circle, which will be releasing native USDC into the interchain from a Hub-secured asset-issuance chain as soon as Q1 2023.
However, in Interchain Security v1, chains cannot simultaneously provide and consume security from each other in the amount of their choosing, which is what will give the interchain shared, opt-in mesh security. All chains can reinforce the security of all other chains in an emergent, self-organizing network (bottom right).
At the broadest level, this works by having validators correlate their identities cross-chain over IBC, allowing their stake (and that of their delegators) on one chain to be slashable on the other chain in the event of misbehavior.
We’ll save the full deep dive into Mesh Security for a less-packed Updates or its own blog post, but in the meantime, check out these resources:
- Sunny’s Cosmoverse talk (in chain mail)
- HathorNodes’ Summary Tweet Thread
- Chjango’s Interview w. Sunny
- HackWasm Mesh Security proof-of-concept presentation
We reject: kings, presidents, and voting. We believe in: rough consensus and running code.” — David D. Clark
Stablecoins | Stableswap
The coming months are going to see an explosion in Cosmos stablecoins. Circle is making general asset-issuance chain secured by Hub once Interchain Security is ready (potentially as early as January). Having native USDC in the ecosystem will lower the risk from bridged, non-IBC varieties.
At least three decentralized stablecoins are in various stages of development. Here on Osmosis, the ION DAO is developing IOU, a Maker DAI-style stable backed exclusively with a basket of IBC tokens. It is being coded by Alphaworks — longtime Cosmos contributors who built the Anchor Protocol and were part of the precursor company to Keplr, Everett. The hardened Javascript DeFi platform, Agoric, will be releasing IST soon, which will release as an asset-backed coin before shifting to the CDP model. Finally, USK from Kujira is live, but only around $233K has been minted (out of a $1 million cap), and it mostly exists on the Kujira platform.
It will be exciting to watch the battle for stablecoin dominance play out on Osmosis. Perceived risk, reputation/alignment, liquidity/fungibility, and scalability will all factor into adoption rates. External incentives, too, will be highly important, as projects attempt to promote deep liquidity and adoption.
Osmosis and its users stand to benefit — from incentives, increased liquidity and volume, access to leveraged CDP positions — better UX and more buzz. The dominant centralized players, Tether and USDC, will likely continue to play a large role, but the decentralized market is still up for grabs. While DAI had a years-long head start on Ethereum, no such lead exists in Cosmos. May the best coin win!
Stableswap: The stableswap pool model looks set to launch by the end of October. Stableswaps, you may recall, provide a much flatter curve in a tight range than the classic x * y = k constant-product market-maker curves. This allows assets that are expected to trade in a tight range to be swapped in large volume with minimal slippage. The Osmosis implementation also introduces a “scaling factor” that will allow a curve to adjust to predictable price changes, such as the value accruing to a liquid staking token when staking rewards are passed on. That is, if a stATOM implementation passes on ATOM staking rewards to its holders, 1 stATOM might start being worth 1 ATOM, but would slowly increase to 1.01 ATOM, 1.02 ATOM, etc. The scaling factor can take this predictably shifting peg into account.
[Sunny floated the idea of a one-time lock break for stablecoin LP positions, atomically connected to a stablecoin swap. This would of course be an issue for governance.]
Transmuter: This additional module will allow free one-to-one swaps between stablecoins, provided that an external team fills it. For example, ION could load a transmuter with IOU, setting it to accept whichever stablecoins it expects not to lose peg. Users would then be free to make zero-fee, one-to-one swaps.
Additionally, as we start to see the ecosystem converge around the most popular stables, it may make sense for Osmosis to create its own version of 3Crv, a sort of meta-stable, fungifying LP token that represents a claim on Curve Finance’s 3pool of DAI, USDC, and USDT, and which is then itself used as a paired asset against other stables.
Governance Corner
With a month’s worth of proposals to go through, we’ll just highlight some of the most interesting.
Successful Proposals
- Matching incentives for ATOM/stATOM: stATOM is Stride’s liquid staking derivative. Osmosis prefers liquid staking solutions that do not weaken security and contribute to validator centralization: in other words, superfluid staking (soon, interfluid). At the same time, if stATOM is likely to be widely used, it may make sense not to let other Cosmos DEXs to be competitive.
- Apollo DAO Liquid Staking Contracts: This passed somewhat more narrowly, roughly 55% to 13%, presumably because voters are uneasy about OSMO derivatives. For more check out this Twitter discussion between Larry0x and Dev. It should be possible, Dev suggests, for governance to permission liquid staking contracts while subjecting any non-permissioned derivatives to slashing. Expect more debate about this topic going forward.
- Axelar Loan Swap: $1 million worth of OSMO from the Osmosis Community Pool has been loaned to Axelar to help bootstrap the AXL/OSMO pool. This will be repaid to the OCP within three months with either $1 million worth of AXL or USDC.
- Flipside Data, Community-Sourced Analytics: 275,424 OSMO to Flipside to fund the next nine months of partnership. Through Flipside, community members are able to create data visualizations and reports for consumption by Osmosis developers and community members. The general feeling in the Commonwealth discussion was that Flipside provides good value for money, providing useful analytics and training potential future Osmosis contributors, but that the data being produced needs to be published more broadly, perhaps in digest form.
- Increase Validator Set from 135 to 150: In the Commonwealth discussion, it was largely agreed that increasing the validator set right now will not appreciably improve decentralization because the bottom of the set already controls a very small proportion of the stake. On the other hand, a larger validator set slows down the network.
- Skip Protocol, In-Protocol Arbitrage — Signaling Prop: If you watched Sunny’s talk at the Nebular Summit this summer, you know that in-protocol arbitrage (and eventually liquidations) have been on the roadmap for a while. Arbitrage keeps liquidity pools healthy, but it is one of the prime benefits of app-chain sovereignty that we do not have to leach arbitrage profits to third parties, like apps on Ethereum do, but can instead run an arbitrage optimizer at the beginning (or end) of every block. Skip proposes to take 20% of profits from this module in Year 1, 10% in Year 2, and 5% every year afterwards that it continues to maintain the module.
Rejected
- Autonomy Contract Uploads, Registry & Limits/Stops: Autonomy provides a decentralized automation service, something that has fairly broad support. However, Larry0x and Dev found some errors in the code and encouraged voters to reject the proposal: see more discussion on Commonwealth.
That’s all for this time! We covered a lot of ground, and there was still more that could have been discussed. The building doesn’t stop.
See you on October 19th for the next edition.
Enter the laboratory at Osmosis.zone, the first decentralized exchange powered by the Cosmos SDK and IBC. See our published lab reports at the Osmosis blog, our bench notes at Github and help plan future experiments in our Commonwealth
Connect with other DeFi Scientists by following us on Telegram, Twitter, Discord, Reddit, and the new Facebook and Instagram pages
Reach out to the Osmosis Ministry of Marketing by Email or Twitter and the Osmosis Support Lab by Email or Twitter