Upload Transmuter v3 as CW-Pool

Transmuter is a CosmWasm contract that allows 1:1 conversion of one asset to another by establishing a new CosmWasm pool type.

Transmuter V3 adds to the functionality of Transmuter V2 pools by adding:

  • A scaling factor that accounts for when multiple tokens that represent the same pre-bridge token at different levels of accuracy within the alloy.
  • The ability for the Admin of a Transmuter pool to add and remove tokens from an Alloyed asset while retaining the same factory token to remove the need for migrations.

User Flow

The full launch of Alloyed Assets using V3 of the Transmuter Contract will allow users to deposit any constituent of an Alloyed Asset to Osmosis and receive a token backed by their deposit usable throughout the Osmosis ecosystem. This results in a user flow similar to major CEXs, which accept deposits from multiple chains and increase a user’s balance, but with an entirely decentralized, on-chain mechanism.

The intended user flow will be that when depositing or withdrawing to Osmosis, a regular user will only see that they are interacting with the Canonical Alloyed Asset and be provided a choice of bridging options to withdraw or deposit via, with the cheapest or most unrestricted one offered first. On initiating a transaction, IBC hooks are used to transfer the asset along the selected bridge and join or exit the Transmuter pool.

As this flow will be frontend only, advanced users or those interacting with frontends that have not integrated the IBC hooks will be able to retain the un-alloyed asset on Osmosis.

From there a swap would route through the Transmuter pool as usual, not stranding these users if they arrive on Osmosis via a frontend without this full integration.

Tokenization of Transmuter pools as Alloyed Assets

Transmuter pool shares are represented by a minted factory token. This allows them to be used in all Osmosis applications in the same way as any other token.

As native Osmosis tokens, the representative token may be IBC transferred to another chain, allowing these to be used by other interchain DeFi applications if desired.

While this represents a proliferation of standards by creating another derivative, this deposit and withdrawal flow intends to solve the composability problem on Osmosis.

Other chains may implement a similar system, causing assets to exit the alloy, cross a bridge, and enter a similar grouping on the destination chain.

They can also use Osmosis’ solution by automatically transferring bridged assets to Osmosis, entering the transmuter pool, and returning the alloyed asset to the originally intended chain. This is similar to the IBC unwinding mechanism that chains currently use when transferring an asset between two chains, neither of which is the original source of the asset.

Security

The Transmuter pool has built-in rate limitation settings, which can prevent the ratio of tokens from changing excessively in a set period. These rate limits minimize any issue with one constituent from draining the liquidity of the paired assets in the alloy.

There are two types of limiters in place.

  • Change Limiter determines the maximum percentage of an asset permitted to exit the pools based on the moving average of the asset’s relative weighting over a specified period.

  • Static Limiter determines the maximum percentage of the pool allowed to be a specific asset, preventing extreme imbalance from occurring and minimizing the exposure of the Alloyed Asset to a particular constituent.

Example: The allFOO pool is composed of 50% FOO.Bridge1 and 50% FOO.Bridge2.

FOO.Bridge1 is compromised, and the respective token supply on Osmosis suddenly increases.

The allFOO pool has a Change Limiter in place of 10%/Day, 30%/Week, and a Static Limiter in place of 0.6.

On Day 1, the Change Limiter is hit, freezing the imbalance at 0.55 FOO.Bridge1 and 0.45 FOO.Bridge2.

On Day 2, the Change Limiter would trigger at 0.605. However, the Static Limiter caps the imbalance at 0.6, effectively freezing the pool even if the Moderator or Admin has not yet acted.

These limiters limit the amount of compromised FOO.Bridge1 that can be disposed of on Osmosis, allowing the cause of the issue and a path to resolution to become more apparent through recovering or resupplying the underlying funds.

Admin Role

The Admin Role can perform the following tasks:

Delegate Set Active Status This allows the Admin to delegate a Moderator address to disable the underlying Transmuter pool of the Alloyed Asset temporarily in an emergency. Disabling will freeze the pool’s contents, as no internal messages can be run apart from enabling the Active Status again. This delegation allows either the wider Osmosis DAO or a large subDAO to handle Metadata and Limiter settings while retaining rapid response by a smaller subDAO in an emergency.

Set Alloyed Metadata This allows the on-chain metadata for how the Alloyed Asset is displayed to be adjusted, such as the displayed denomination, description, and symbol.

Manage Limiters This allows the limiters above to be created, removed, or modified. These must be set appropriately so that normal trading is not impacted and a security issue in any of the constituent assets is minimized.

Add New Assets Added in V3; this allows the admin to add a new constituent asset to a pool, which can then be used as an underlying token for the Alloyed Asset. Further administrative action can then be taken to add any limiters. This allows the Alloyed Asset to grow as more bridges become available without fragmenting liquidity by having multiple Alloyed Assets for the same token in circulation.

Administrator for Canonical Alloyed Assets should be claimed by the Osmosis DAO.

Moderator Role

Set Active Status

In an emergency, the Moderator can temporarily disable the underlying pool of the Alloyed Asset. This allows time for any information about an incident to become available and a path forward to be decided without exposing the Alloyed Asset to losses beyond those incurred by the backing at the time of the freeze.

Mark Corrupted Assets

By marking an asset as corrupted, the Moderator signals that it should be removed from the Alloyed Asset. No new deposits will be allowed, but withdrawals are allowed. This will allow the Alloyed Asset to restore its peg, particularly when paired with any intervention approved by governance, such as Insurance, which can deposit an uncorrupted asset and withdraw the corrupted component

Contract information

Release: V3.0.0

Compiler Version: cosmwasm/optimizer:0.15.0

Checksum: a40e832bddf4ce49f4c0fba9f8fe3f8acadebd0f85d925e90944263c36d8d96e

Code repository: GitHub - osmosis-labs/transmuter: A CosmWasm contract to enable 1-direction 1:1 conversion of one asset to another.

Target Onchain Date: Transmuter V3 has recently completed audit and is undergoing the audit actions review stage. This proposal will go on chain when this is complete and V3 is released, or on the 8th May, whichever is later.

3 Likes

I simply love this!
This is a must-have to make the ecosystem easier to navigate for non-pro users.

I like that the standard flow will automatically end up with the alloyed asset as outcome.

Regarding the selection screen of the bridges; will it also be possible to include some sort of indication of the traffic across the bridge? Enabling users to select less-crowded bridges to have assets arive faster?

This would be more to do with the frontend implementation of any deposit flow than the contract itself. The revamp would initially involve selecting the lowest cost to bridge, which should increase as a route becomes busier and takes longer. If there are other settings involved, the deposit and withdraw flow may be able to display these settings as well eventually.

1 Like

Yeah, true. The contract should be able to handle all routes, whereas the frontend can be configured in such a way to show costs, traffic and other potentially important metrics.

Will be uploading v3.1 of the Transmuter pool linking to this thread.

This release is based on feedback from initial usage and includes two main updates:

  • Allow alloys to start with single asset
    • This allows alloys to be created where there is only a single asset at the moment without having to do a liquidity migration as more bridges become available.
    • Important for proposals such as Bootstrapping of ERC-20 Markets using Protocol Liquidity, upcoming bridges expected from TON, TRON and DOGE, as well as single bridges currently in use from XRP.
  • Increased restrictions on subdenom validation at creation.
    • This allows the subdenoms to be parsed more easily since they have predictable formatting.
1 Like