# \[Request\] Update XCS v2 Contracts

**URL:** <https://forum.osmosis.zone/t/request-update-xcs-v2-contracts/572>\
**Category:** DApps / Tooling\
**Created:** [November 6, 2023, 8:11am UTC](https://forum.osmosis.zone/t/request-update-xcs-v2-contracts/572 "2023-11-06T08:11:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Mitosis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.osmosis.zone/jason_mitosis/32/481_2.png) [@Jason\_Mitosis](https://forum.osmosis.zone/u/Jason_Mitosis)\
**Post date:** [November 6, 2023, 8:11am UTC](https://forum.osmosis.zone/t/request-update-xcs-v2-contracts/572/1 "2023-11-06T08:11:17Z")

</div>

**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

```auto
{
	"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

```auto
{
	"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

---

<div class="post-metadata">

**Author:** ![JohnnyWyles](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.osmosis.zone/johnnywyles/32/3114_2.png) [@JohnnyWyles](https://forum.osmosis.zone/u/JohnnyWyles)\
**Post date:** [November 6, 2023, 5:18pm UTC](https://forum.osmosis.zone/t/request-update-xcs-v2-contracts/572/2 "2023-11-06T17:18:50Z")

</div>

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.

> <https://github.com/osmosis-labs/osmosis/tree/main/cosmwasm/contracts/crosschain-swaps>
>
> //github.com/osmosis-labs/osmosis/tree/main/cosmwasm/contracts/crosschain-swaps

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)

---

<div class="post-metadata">

**Author:** ![Jason\_Mitosis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.osmosis.zone/jason_mitosis/32/481_2.png) [@Jason\_Mitosis](https://forum.osmosis.zone/u/Jason_Mitosis)\
**Post date:** [November 7, 2023, 2:30am UTC](https://forum.osmosis.zone/t/request-update-xcs-v2-contracts/572/3 "2023-11-07T02:30:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![LeonoorsCryptoman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.osmosis.zone/leonoorscryptoman/32/208_2.png) [@LeonoorsCryptoman](https://forum.osmosis.zone/u/LeonoorsCryptoman)\
**Post date:** [November 7, 2023, 8:03pm UTC](https://forum.osmosis.zone/t/request-update-xcs-v2-contracts/572/4 "2023-11-07T20:03:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jason\_Mitosis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.osmosis.zone/jason_mitosis/32/481_2.png) [@Jason\_Mitosis](https://forum.osmosis.zone/u/Jason_Mitosis)\
**Post date:** [November 8, 2023, 2:39am UTC](https://forum.osmosis.zone/t/request-update-xcs-v2-contracts/572/5 "2023-11-08T02:39:46Z")

</div>

Are you looking for this?

> [@Upload XCS v2 Contracts](https://forum.osmosis.zone/t/upload-xcs-v2-contracts/335):
>
> Upload CrossChain Registry Contract V1 Passing this proposal will upload V1 of the Crosschain Registry contract to the Osmosis chain. Details The set of contracts within the XCS bundle enables trades on Osmosis to be carried out remotely from another chain connected to Osmosis by IBC. Version two of the contracts simplifies the usage of crosschain swaps by keeping registries with information about IBC channels used, denoms used on Osmosis, and when to use packet forward middleware vs. callback…

---

<div class="post-metadata">

**Author:** ![LeonoorsCryptoman](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.osmosis.zone/leonoorscryptoman/32/208_2.png) [@LeonoorsCryptoman](https://forum.osmosis.zone/u/LeonoorsCryptoman)\
**Post date:** [November 9, 2023, 7:31pm UTC](https://forum.osmosis.zone/t/request-update-xcs-v2-contracts/572/6 "2023-11-09T19:31:56Z")

</div>

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

Found it though:

> **[Mintscan](https://www.mintscan.io/osmosis/proposals/632)**
>
> Interchain explorer and analytics powered by Cosmostation.

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