Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transmuter V3 support with scaling factors. #368

Merged
merged 3 commits into from
Mar 11, 2024

Conversation

piobab
Copy link
Collaborator

@piobab piobab commented Mar 7, 2024

The only reasonable way to determine version of the transmuter pool is through instantiate_msg schema in Pool response:

osmosisd query poolmanager pool 1212 --node https://rpc.osmosis.zone:443 --chain-id osmosis-1
pool:
  '@type': /osmosis.cosmwasmpool.v1beta1.CosmWasmPool
  code_id: "148"
  contract_address: osmo10c8y69yylnlwrhu32ralf08ekladhfknfqrjsy9yqc9ml8mlxpqq2sttzk
  instantiate_msg: eyJwb29sX2Fzc2V0X2Rlbm9tcyI6IFsiaWJjL0QxODkzMzVDNkU0QTY4QjUxM0MxMEFCMjI3QkYxQzFEMzhDNzQ2NzY2Mjc4QkEzRUVCNEZCMTQxMjRGMUQ4NTgiLCJpYmMvNDk4QTA3NTFDNzk4QTBEOUEzODlBQTM2OTExMjNEQURBNTdEQUE0RkUxNjVENUM3NTg5NDUwNUI4NzZCQTZFNCJdLCJhZG1pbiI6ICJvc21vMWdteDZ4OGxudmdobnl3YXpxY3l4NTZydDA3amRhdHJhY2hxZDRhZTA3M2doYXo3cmZ5bXFsZDd5NjAifQ==
  pool_id: "1212"

V1 (live on Osmosis mainnet):

{
  "pool_asset_denoms": [
    "ibc/072E5B3D6F278B3E6A9C51D7EAD1A737148609512C5EBE8CBCB5663264A0DDB7",
    "ibc/52C57FCA7D6854AA178E7A183DDBE4EF322B904B1D719FC485F6FFBC1F72A19E"
  ]
}

V2 (for now only available on Osmosis testnet):

{
  "pool_asset_denoms": [
    "uosmo",
    "factory/osmo14eq94mckd6kp0pwnxx33ycpk762z7rum29epr3/teko02"
  ],
  "admin": "osmo14eq94mckd6kp0pwnxx33ycpk762z7rum29epr3",
  "alloyed_asset_subdenom": "teko"
}

V3 (no live yet, contains normalization factors):

/// Fields taken from Instantiate msg https://github.com/osmosis-labs/transmuter/blob/47bbb023463578937a7086ad80071196126349d9/contracts/transmuter/src/contract.rs#L74
#[cw_serde]
struct TransmuterV3InstantiateMsg {
    pub pool_asset_configs: Vec<AssetConfig>,
    pub alloyed_asset_subdenom: String,
    pub alloyed_asset_normalization_factor: Uint128,
    pub admin: Option<String>,
    pub moderator: Option<String>,
}

@piobab piobab requested review from dancreee and markonmars March 7, 2024 17:07
@piobab piobab merged commit d208e0d into support-osmo-cosmwasm-pool Mar 11, 2024
5 checks passed
piobab added a commit that referenced this pull request Mar 12, 2024
* Add CosmWasm pool support for Osmosis.

* Swapper migration.

* Update schema.

* Fix deserialization. Update test case.

* 1:1 price for CosmWasmPool (transmuter) when estimating out amount.

* Cover CosmWasm pool usage in estimate.

* Use wasm serde.

* Transmuter V3 support with scaling factors. (#368)

* Transmuter V3 support with scaling factors.

* Ignore audit for test dependency.

* Clean comment.

* Use CalcOutAmtGivenInRequest for CosmWasm pool.
@piobab piobab deleted the transmuter-v3-support branch March 14, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant