[Request] Update XCS v2 Contracts

Summary
Adoption of this proposal will introduce a parameter that allows for the optional bypass of the denom path unwinding process in the XCS v2 contract. This enhancement will enable entities such as Mitosis, which employ osmosis assets as the original denom, to leverage XCS v2 as their primary method for crosschain swapping.

About Mitosis
Mitosis is in the process of developing a Structured Products Market for LSTs, operating as a standalone appchain. The initial launch will feature margin trading capabilities, with swap settlements being executed within Osmosis.

Below are some key aspects Mitosis delivers to end users.

  • Accessibility : Margin Trading and Earn Vault Features will be available to users from Osmosis holding Stride LSTs and Stablecoins
  • Cross-Chain Swaps : Utilizing Osmosis’ XCS technology, we facilitate seamless cross-chain swaps, positioning Mitosis as a prime use case for this groundbreaking technology.
  • Enhanced Yields for Passive Investors : By depositing assets in our vaults, passive investors can augment their Stride Staking APY with supplementary yields generated from trader-incurred fees.
  • Dual Earning Avenues for Active Investors: Active investors can leverage market movements through classic margin trading while accruing additional returns via Stride’s staking APY.
  • Sophisticated Liquidation Logic: Our approach incorporates four distinct data points—offchain and onchain spot prices, Time-Weighted Average Price (TWAP), and an aggregated composite of these metrics—to ensure accurate asset pricing and justified liquidations, mitigating unwarranted liquidation cascades.
  • Automated Investment Strategies: Tailored to individual risk profiles, these strategies offer a balanced blend of active and passive investment approaches, significantly enhancing user experience.
  • Robust 2024 Roadmap: Our vision extends to innovations like Fixed Yields and Real-World Asset (RWA) products, in collaboration with eligible partners.

As Mitosis grows, we anticipate a bigger trading volume and higher TVL for Osmosis.

Current Issue
The XCS v2 architecture features an automated IBC denom path unwinding function designed to streamline the token’s denom prior to its transfer to the recipient. For optimal functionality, it is imperative that all participating host zones in the swap path implement the Packet-Forwarding Module (PFM). Presently, Stride’s integration of PFM is pending, which has led to error-laden outcomes in our XCS v2 testing.

While reverting to XCS v1 is a potential alternative, this version does not support Supercharged Pools within the swap trajectory. Consequently, this limitation hinders our ability to ascertain the most advantageous swap paths for our users

Solution
We propose the introduction of a parameter within the XCS v2 contract that can exempt the denom path unwinding process. This adjustment would result in the following modification to the memo.

memo A - Current XCS v2

{
	"wasm": {
		"contract": "osmo1crosschainswapcontract"
		"msg":{
				"osmosis_swap": {
				"output_denom": "ibc/token"  // stOSMO,
				"receiver": "stride1receiver",   // Intermediate receiver
				"slippage": {
					"twap": {
						"slippage_percentage":"20", 
						"window_seconds": 10
					}
				},
	      "next_memo": {
					"forward": {
						"receiver": "mito1receiver", // Final receiver
						"port": "transfer",
						"channel": "channel-N"
					}
				},
				"on_failed_delivery": "do_nothing" 
			}
		}
	}
}

memo B - New XCS v2

{
	"wasm": {
		"contract": "osmo1crosschainswapcontract"
		"msg":{
				"osmosis_swap": {
				"output_denom": "ibc/token"  // stOSMO,
				"receiver": "mito1receiver",   // Final receiver 
				"slippage": {
					"twap": {
						"slippage_percentage":"20", 
						"window_seconds": 10
					}
				},
	      
				"on_failed_delivery": "do_nothing" 
			}
		}
	}
}

Modifying XCS v2 as stated above will lower the barrier for teams that utilize osmosis assets as the origin denom to use XCS v2.

Osmosis is the Interchain Liquidity Hub, and liquidity is King in DeFi. Our team plans on building additional features on top of Osmosis and will continuously add value.

We are currently in the finalization phase of development, and will go through an audit very shortly. For full disclosure, all our code will be open-source and relevant documents will be ready soon.

Contacts

  • Telegram Handle: @jason0_0oo
  • Email : jason@mitosis.finance

Is this a proposal to upload a newer version of XCS or have the work done?
Any work done would need to be uploaded for use, but the changes themselves aren’t controlled by the chain.

XCS contracts are open source and so can just have these changes proposed on github instead.

Then this post could be used as the notice that a new version was being uploaded in an on-chain proposal, which needs to contain:

  • Git Commit ID or release
  • Version of Compiler used
  • A description of the code’s purpose for a layman (Included already)

Hey Johnny,

In line with your recommendation, we are proposing an update to XCS.

The team will prepare the revised code and propose it on GitHub within the coming weeks.

Subsequent to this, I will update the forum proposal to include the code along with pertinent details, such as the compiler version.

1 Like

In which proposal was the original contract uploaded?
I can’t find it :sweat_smile:

Are you looking for this?

No, I was looking for the proposal we had on chain on Osmosis :slight_smile:

Found it though:

The title here says “Upload Crosschain Swaps Contract V2”; how are these different? Kinda confusing it both says V2 now ^^