diff --git a/contracts/liquidity_hub/pool-manager/schema/pool-manager.json b/contracts/liquidity_hub/pool-manager/schema/pool-manager.json index 8d15e202..7c030414 100644 --- a/contracts/liquidity_hub/pool-manager/schema/pool-manager.json +++ b/contracts/liquidity_hub/pool-manager/schema/pool-manager.json @@ -13,13 +13,20 @@ ], "properties": { "bonding_manager_addr": { + "description": "The address of the bonding manager contract.", "type": "string" }, "incentive_manager_addr": { + "description": "The address of the incentive manager contract.", "type": "string" }, "pool_creation_fee": { - "$ref": "#/definitions/Coin" + "description": "How much it costs to create a pool. It helps prevent spamming of new pools.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] } }, "additionalProperties": false, @@ -540,7 +547,7 @@ ] }, "FeatureToggle": { - "description": "Pool feature toggle", + "description": "Pool feature toggle, can control whether swaps, deposits, and withdrawals are enabled.", "type": "object", "required": [ "deposits_enabled", @@ -549,12 +556,15 @@ ], "properties": { "deposits_enabled": { + "description": "Whether or not deposits are enabled", "type": "boolean" }, "swaps_enabled": { + "description": "Whether or not swaps are enabled", "type": "boolean" }, "withdrawals_enabled": { + "description": "Whether or not swaps are enabled", "type": "boolean" } }, @@ -617,14 +627,10 @@ "additionalProperties": false }, "PoolType": { + "description": "Possible pool types, it can be either a constant product (xyk) pool or a stable swap pool.", "oneOf": [ { - "type": "string", - "enum": [ - "constant_product" - ] - }, - { + "description": "A stable swap pool.", "type": "object", "required": [ "stable_swap" @@ -647,12 +653,21 @@ } }, "additionalProperties": false + }, + { + "description": "xyk pool", + "type": "string", + "enum": [ + "constant_product" + ] } ] }, "SwapOperation": { + "description": "The type of swap operation to perform.", "oneOf": [ { + "description": "A swap operation that uses the WhaleSwap router.", "type": "object", "required": [ "whale_swap" @@ -667,12 +682,15 @@ ], "properties": { "pool_identifier": { + "description": "The identifier of the pool to use for the swap.", "type": "string" }, "token_in_denom": { + "description": "The token denom to swap in.", "type": "string" }, "token_out_denom": { + "description": "The token denom returning from the swap.", "type": "string" } }, @@ -684,6 +702,7 @@ ] }, "SwapRoute": { + "description": "The swap route structure", "type": "object", "required": [ "ask_asset_denom", @@ -692,12 +711,15 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" }, "swap_operations": { + "description": "The swap operations to perform to get from offer asset to ask asset.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" @@ -730,17 +752,10 @@ "oneOf": [ { "description": "Retrieves the contract's config.", - "type": "object", - "required": [ + "type": "string", + "enum": [ "config" - ], - "properties": { - "config": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false + ] }, { "description": "Retrieves the decimals for the given asset.", @@ -757,9 +772,11 @@ ], "properties": { "denom": { + "description": "The queried denom in the given pool_identifier.", "type": "string" }, "pool_identifier": { + "description": "The pool identifier to do the query for.", "type": "string" } }, @@ -783,9 +800,15 @@ ], "properties": { "offer_asset": { - "$ref": "#/definitions/Coin" + "description": "The offer asset to swap.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] }, "pool_identifier": { + "description": "The pool identifier to swap in.", "type": "string" } }, @@ -805,17 +828,19 @@ "type": "object", "required": [ "ask_asset", - "offer_asset", "pool_identifier" ], "properties": { "ask_asset": { - "$ref": "#/definitions/Coin" - }, - "offer_asset": { - "$ref": "#/definitions/Coin" + "description": "The ask asset to get after the swap.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] }, "pool_identifier": { + "description": "The pool identifier to swap in.", "type": "string" } }, @@ -839,9 +864,11 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" } }, @@ -852,17 +879,10 @@ }, { "description": "Gets all swap routes registered", - "type": "object", - "required": [ + "type": "string", + "enum": [ "swap_routes" - ], - "properties": { - "swap_routes": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false + ] }, { "description": "Simulates swap operations.", @@ -879,9 +899,15 @@ ], "properties": { "offer_amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount to swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "operations": { + "description": "The operations to perform.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" @@ -908,9 +934,15 @@ ], "properties": { "ask_amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount to get after the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "operations": { + "description": "The operations to perform.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" @@ -923,6 +955,7 @@ "additionalProperties": false }, { + "description": "Retrieves the pool information for the given pool identifier.", "type": "object", "required": [ "pool" @@ -944,7 +977,7 @@ "additionalProperties": false }, { - "description": "Retrieves the creator of the swap routes that can then remove them.", + "description": "Retrieves the creator of the swap route to get from offer to ask asset. The creator of the swap route can remove it.", "type": "object", "required": [ "swap_route_creator" @@ -958,9 +991,11 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" } }, @@ -1001,8 +1036,10 @@ } }, "SwapOperation": { + "description": "The type of swap operation to perform.", "oneOf": [ { + "description": "A swap operation that uses the WhaleSwap router.", "type": "object", "required": [ "whale_swap" @@ -1017,12 +1054,15 @@ ], "properties": { "pool_identifier": { + "description": "The identifier of the pool to use for the swap.", "type": "string" }, "token_in_denom": { + "description": "The token denom to swap in.", "type": "string" }, "token_out_denom": { + "description": "The token denom returning from the swap.", "type": "string" } }, @@ -1042,7 +1082,6 @@ "migrate": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", - "description": "The migrate message", "type": "object", "additionalProperties": false }, @@ -1079,13 +1118,19 @@ "config": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ConfigResponse", + "description": "The response for the `Config` query.", "type": "object", "required": [ "config" ], "properties": { "config": { - "$ref": "#/definitions/Config" + "description": "The contract configuration.", + "allOf": [ + { + "$ref": "#/definitions/Config" + } + ] } }, "additionalProperties": false, @@ -1110,6 +1155,7 @@ } }, "Config": { + "description": "The contract configuration.", "type": "object", "required": [ "bonding_manager_addr", @@ -1138,13 +1184,18 @@ ] }, "pool_creation_fee": { - "$ref": "#/definitions/Coin" + "description": "How much it costs to create a pool. It helps prevent spamming of new pools.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] } }, "additionalProperties": false }, "FeatureToggle": { - "description": "Pool feature toggle", + "description": "Pool feature toggle, can control whether swaps, deposits, and withdrawals are enabled.", "type": "object", "required": [ "deposits_enabled", @@ -1153,12 +1204,15 @@ ], "properties": { "deposits_enabled": { + "description": "Whether or not deposits are enabled", "type": "boolean" }, "swaps_enabled": { + "description": "Whether or not swaps are enabled", "type": "boolean" }, "withdrawals_enabled": { + "description": "Whether or not swaps are enabled", "type": "boolean" } }, @@ -1268,6 +1322,7 @@ "pool": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PoolInfoResponse", + "description": "The response for the `Pool` query.", "type": "object", "required": [ "pool_info", @@ -1275,10 +1330,20 @@ ], "properties": { "pool_info": { - "$ref": "#/definitions/PoolInfo" + "description": "The pool information for the given pool identifier.", + "allOf": [ + { + "$ref": "#/definitions/PoolInfo" + } + ] }, "total_share": { - "$ref": "#/definitions/Coin" + "description": "The total LP tokens in the pool.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] } }, "additionalProperties": false, @@ -1359,6 +1424,7 @@ "additionalProperties": false }, "PoolInfo": { + "description": "Contains the pool information", "type": "object", "required": [ "asset_decimals", @@ -1370,6 +1436,7 @@ ], "properties": { "asset_decimals": { + "description": "The decimals for the given asset denoms, provided in the same order as asset_denoms.", "type": "array", "items": { "type": "integer", @@ -1378,38 +1445,47 @@ } }, "asset_denoms": { + "description": "The asset denoms for the pool.", "type": "array", "items": { "type": "string" } }, "assets": { + "description": "The total amount of assets in the pool.", "type": "array", "items": { "$ref": "#/definitions/Coin" } }, "lp_denom": { + "description": "The LP denom of the pool.", "type": "string" }, "pool_fees": { - "$ref": "#/definitions/PoolFee" + "description": "The fees for the pool.", + "allOf": [ + { + "$ref": "#/definitions/PoolFee" + } + ] }, "pool_type": { - "$ref": "#/definitions/PoolType" + "description": "The type of pool to create.", + "allOf": [ + { + "$ref": "#/definitions/PoolType" + } + ] } }, "additionalProperties": false }, "PoolType": { + "description": "Possible pool types, it can be either a constant product (xyk) pool or a stable swap pool.", "oneOf": [ { - "type": "string", - "enum": [ - "constant_product" - ] - }, - { + "description": "A stable swap pool.", "type": "object", "required": [ "stable_swap" @@ -1432,6 +1508,13 @@ } }, "additionalProperties": false + }, + { + "description": "xyk pool", + "type": "string", + "enum": [ + "constant_product" + ] } ] }, @@ -1444,13 +1527,19 @@ "reverse_simulate_swap_operations": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ReverseSimulateSwapOperationsResponse", + "description": "The response for the `ReverseSimulateSwapOperations` query.", "type": "object", "required": [ "amount" ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount of the initial token needed to get the final token after the swap operations.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] } }, "additionalProperties": false, @@ -1475,19 +1564,44 @@ ], "properties": { "burn_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The burn fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "offer_amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount of the offer asset needed to get the ask amount.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "protocol_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The protocol fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "spread_amount": { - "$ref": "#/definitions/Uint128" + "description": "The spread amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "swap_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The swap fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] } }, "additionalProperties": false, @@ -1501,13 +1615,19 @@ "simulate_swap_operations": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SimulateSwapOperationsResponse", + "description": "The response for the `SimulateSwapOperations` query.", "type": "object", "required": [ "amount" ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount of the final token after the swap operations.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] } }, "additionalProperties": false, @@ -1532,19 +1652,44 @@ ], "properties": { "burn_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The burn fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "protocol_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The protocol fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "return_amount": { - "$ref": "#/definitions/Uint128" + "description": "The return amount of the ask asset given the offer amount.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "spread_amount": { - "$ref": "#/definitions/Uint128" + "description": "The spread amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "swap_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The swap fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] } }, "additionalProperties": false, @@ -1558,20 +1703,28 @@ "swap_route": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SwapRouteResponse", + "description": "The response for the `SwapRoute` query.", "type": "object", "required": [ "swap_route" ], "properties": { "swap_route": { - "$ref": "#/definitions/SwapRoute" + "description": "The swap route taken for the queried swap.", + "allOf": [ + { + "$ref": "#/definitions/SwapRoute" + } + ] } }, "additionalProperties": false, "definitions": { "SwapOperation": { + "description": "The type of swap operation to perform.", "oneOf": [ { + "description": "A swap operation that uses the WhaleSwap router.", "type": "object", "required": [ "whale_swap" @@ -1586,12 +1739,15 @@ ], "properties": { "pool_identifier": { + "description": "The identifier of the pool to use for the swap.", "type": "string" }, "token_in_denom": { + "description": "The token denom to swap in.", "type": "string" }, "token_out_denom": { + "description": "The token denom returning from the swap.", "type": "string" } }, @@ -1603,6 +1759,7 @@ ] }, "SwapRoute": { + "description": "The swap route structure", "type": "object", "required": [ "ask_asset_denom", @@ -1611,12 +1768,15 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" }, "swap_operations": { + "description": "The swap operations to perform to get from offer asset to ask asset.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" @@ -1630,12 +1790,14 @@ "swap_route_creator": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SwapRouteCreatorResponse", + "description": "The response for the `SwapRouteCreator` query.", "type": "object", "required": [ "creator" ], "properties": { "creator": { + "description": "The creator of the swap route.", "type": "string" } }, @@ -1644,12 +1806,14 @@ "swap_routes": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SwapRoutesResponse", + "description": "The response for the `SwapRoutes` query.", "type": "object", "required": [ "swap_routes" ], "properties": { "swap_routes": { + "description": "The swap routes registered in the contract.", "type": "array", "items": { "$ref": "#/definitions/SwapRoute" @@ -1659,8 +1823,10 @@ "additionalProperties": false, "definitions": { "SwapOperation": { + "description": "The type of swap operation to perform.", "oneOf": [ { + "description": "A swap operation that uses the WhaleSwap router.", "type": "object", "required": [ "whale_swap" @@ -1675,12 +1841,15 @@ ], "properties": { "pool_identifier": { + "description": "The identifier of the pool to use for the swap.", "type": "string" }, "token_in_denom": { + "description": "The token denom to swap in.", "type": "string" }, "token_out_denom": { + "description": "The token denom returning from the swap.", "type": "string" } }, @@ -1692,6 +1861,7 @@ ] }, "SwapRoute": { + "description": "The swap route structure", "type": "object", "required": [ "ask_asset_denom", @@ -1700,12 +1870,15 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" }, "swap_operations": { + "description": "The swap operations to perform to get from offer asset to ask asset.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/execute.json b/contracts/liquidity_hub/pool-manager/schema/raw/execute.json index 15e611b0..e40859b6 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/execute.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/execute.json @@ -493,7 +493,7 @@ ] }, "FeatureToggle": { - "description": "Pool feature toggle", + "description": "Pool feature toggle, can control whether swaps, deposits, and withdrawals are enabled.", "type": "object", "required": [ "deposits_enabled", @@ -502,12 +502,15 @@ ], "properties": { "deposits_enabled": { + "description": "Whether or not deposits are enabled", "type": "boolean" }, "swaps_enabled": { + "description": "Whether or not swaps are enabled", "type": "boolean" }, "withdrawals_enabled": { + "description": "Whether or not swaps are enabled", "type": "boolean" } }, @@ -570,14 +573,10 @@ "additionalProperties": false }, "PoolType": { + "description": "Possible pool types, it can be either a constant product (xyk) pool or a stable swap pool.", "oneOf": [ { - "type": "string", - "enum": [ - "constant_product" - ] - }, - { + "description": "A stable swap pool.", "type": "object", "required": [ "stable_swap" @@ -600,12 +599,21 @@ } }, "additionalProperties": false + }, + { + "description": "xyk pool", + "type": "string", + "enum": [ + "constant_product" + ] } ] }, "SwapOperation": { + "description": "The type of swap operation to perform.", "oneOf": [ { + "description": "A swap operation that uses the WhaleSwap router.", "type": "object", "required": [ "whale_swap" @@ -620,12 +628,15 @@ ], "properties": { "pool_identifier": { + "description": "The identifier of the pool to use for the swap.", "type": "string" }, "token_in_denom": { + "description": "The token denom to swap in.", "type": "string" }, "token_out_denom": { + "description": "The token denom returning from the swap.", "type": "string" } }, @@ -637,6 +648,7 @@ ] }, "SwapRoute": { + "description": "The swap route structure", "type": "object", "required": [ "ask_asset_denom", @@ -645,12 +657,15 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" }, "swap_operations": { + "description": "The swap operations to perform to get from offer asset to ask asset.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/instantiate.json b/contracts/liquidity_hub/pool-manager/schema/raw/instantiate.json index 8fdc4795..f73769af 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/instantiate.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/instantiate.json @@ -9,13 +9,20 @@ ], "properties": { "bonding_manager_addr": { + "description": "The address of the bonding manager contract.", "type": "string" }, "incentive_manager_addr": { + "description": "The address of the incentive manager contract.", "type": "string" }, "pool_creation_fee": { - "$ref": "#/definitions/Coin" + "description": "How much it costs to create a pool. It helps prevent spamming of new pools.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] } }, "additionalProperties": false, diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/migrate.json b/contracts/liquidity_hub/pool-manager/schema/raw/migrate.json index be217b7d..7fbe8c57 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/migrate.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/migrate.json @@ -1,7 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "MigrateMsg", - "description": "The migrate message", "type": "object", "additionalProperties": false } diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/query.json b/contracts/liquidity_hub/pool-manager/schema/raw/query.json index f8f2f798..e9162721 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/query.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/query.json @@ -4,17 +4,10 @@ "oneOf": [ { "description": "Retrieves the contract's config.", - "type": "object", - "required": [ + "type": "string", + "enum": [ "config" - ], - "properties": { - "config": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false + ] }, { "description": "Retrieves the decimals for the given asset.", @@ -31,9 +24,11 @@ ], "properties": { "denom": { + "description": "The queried denom in the given pool_identifier.", "type": "string" }, "pool_identifier": { + "description": "The pool identifier to do the query for.", "type": "string" } }, @@ -57,9 +52,15 @@ ], "properties": { "offer_asset": { - "$ref": "#/definitions/Coin" + "description": "The offer asset to swap.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] }, "pool_identifier": { + "description": "The pool identifier to swap in.", "type": "string" } }, @@ -79,17 +80,19 @@ "type": "object", "required": [ "ask_asset", - "offer_asset", "pool_identifier" ], "properties": { "ask_asset": { - "$ref": "#/definitions/Coin" - }, - "offer_asset": { - "$ref": "#/definitions/Coin" + "description": "The ask asset to get after the swap.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] }, "pool_identifier": { + "description": "The pool identifier to swap in.", "type": "string" } }, @@ -113,9 +116,11 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" } }, @@ -126,17 +131,10 @@ }, { "description": "Gets all swap routes registered", - "type": "object", - "required": [ + "type": "string", + "enum": [ "swap_routes" - ], - "properties": { - "swap_routes": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false + ] }, { "description": "Simulates swap operations.", @@ -153,9 +151,15 @@ ], "properties": { "offer_amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount to swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "operations": { + "description": "The operations to perform.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" @@ -182,9 +186,15 @@ ], "properties": { "ask_amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount to get after the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "operations": { + "description": "The operations to perform.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" @@ -197,6 +207,7 @@ "additionalProperties": false }, { + "description": "Retrieves the pool information for the given pool identifier.", "type": "object", "required": [ "pool" @@ -218,7 +229,7 @@ "additionalProperties": false }, { - "description": "Retrieves the creator of the swap routes that can then remove them.", + "description": "Retrieves the creator of the swap route to get from offer to ask asset. The creator of the swap route can remove it.", "type": "object", "required": [ "swap_route_creator" @@ -232,9 +243,11 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" } }, @@ -275,8 +288,10 @@ } }, "SwapOperation": { + "description": "The type of swap operation to perform.", "oneOf": [ { + "description": "A swap operation that uses the WhaleSwap router.", "type": "object", "required": [ "whale_swap" @@ -291,12 +306,15 @@ ], "properties": { "pool_identifier": { + "description": "The identifier of the pool to use for the swap.", "type": "string" }, "token_in_denom": { + "description": "The token denom to swap in.", "type": "string" }, "token_out_denom": { + "description": "The token denom returning from the swap.", "type": "string" } }, diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_config.json b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_config.json index b1b907f1..b9a36357 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_config.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_config.json @@ -1,13 +1,19 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ConfigResponse", + "description": "The response for the `Config` query.", "type": "object", "required": [ "config" ], "properties": { "config": { - "$ref": "#/definitions/Config" + "description": "The contract configuration.", + "allOf": [ + { + "$ref": "#/definitions/Config" + } + ] } }, "additionalProperties": false, @@ -32,6 +38,7 @@ } }, "Config": { + "description": "The contract configuration.", "type": "object", "required": [ "bonding_manager_addr", @@ -60,13 +67,18 @@ ] }, "pool_creation_fee": { - "$ref": "#/definitions/Coin" + "description": "How much it costs to create a pool. It helps prevent spamming of new pools.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] } }, "additionalProperties": false }, "FeatureToggle": { - "description": "Pool feature toggle", + "description": "Pool feature toggle, can control whether swaps, deposits, and withdrawals are enabled.", "type": "object", "required": [ "deposits_enabled", @@ -75,12 +87,15 @@ ], "properties": { "deposits_enabled": { + "description": "Whether or not deposits are enabled", "type": "boolean" }, "swaps_enabled": { + "description": "Whether or not swaps are enabled", "type": "boolean" }, "withdrawals_enabled": { + "description": "Whether or not swaps are enabled", "type": "boolean" } }, diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_pool.json b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_pool.json index 9a3ce9fc..ac073d62 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_pool.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_pool.json @@ -1,6 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "PoolInfoResponse", + "description": "The response for the `Pool` query.", "type": "object", "required": [ "pool_info", @@ -8,10 +9,20 @@ ], "properties": { "pool_info": { - "$ref": "#/definitions/PoolInfo" + "description": "The pool information for the given pool identifier.", + "allOf": [ + { + "$ref": "#/definitions/PoolInfo" + } + ] }, "total_share": { - "$ref": "#/definitions/Coin" + "description": "The total LP tokens in the pool.", + "allOf": [ + { + "$ref": "#/definitions/Coin" + } + ] } }, "additionalProperties": false, @@ -92,6 +103,7 @@ "additionalProperties": false }, "PoolInfo": { + "description": "Contains the pool information", "type": "object", "required": [ "asset_decimals", @@ -103,6 +115,7 @@ ], "properties": { "asset_decimals": { + "description": "The decimals for the given asset denoms, provided in the same order as asset_denoms.", "type": "array", "items": { "type": "integer", @@ -111,38 +124,47 @@ } }, "asset_denoms": { + "description": "The asset denoms for the pool.", "type": "array", "items": { "type": "string" } }, "assets": { + "description": "The total amount of assets in the pool.", "type": "array", "items": { "$ref": "#/definitions/Coin" } }, "lp_denom": { + "description": "The LP denom of the pool.", "type": "string" }, "pool_fees": { - "$ref": "#/definitions/PoolFee" + "description": "The fees for the pool.", + "allOf": [ + { + "$ref": "#/definitions/PoolFee" + } + ] }, "pool_type": { - "$ref": "#/definitions/PoolType" + "description": "The type of pool to create.", + "allOf": [ + { + "$ref": "#/definitions/PoolType" + } + ] } }, "additionalProperties": false }, "PoolType": { + "description": "Possible pool types, it can be either a constant product (xyk) pool or a stable swap pool.", "oneOf": [ { - "type": "string", - "enum": [ - "constant_product" - ] - }, - { + "description": "A stable swap pool.", "type": "object", "required": [ "stable_swap" @@ -165,6 +187,13 @@ } }, "additionalProperties": false + }, + { + "description": "xyk pool", + "type": "string", + "enum": [ + "constant_product" + ] } ] }, diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_reverse_simulate_swap_operations.json b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_reverse_simulate_swap_operations.json index 6e6216b7..9c364c10 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_reverse_simulate_swap_operations.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_reverse_simulate_swap_operations.json @@ -1,13 +1,19 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "ReverseSimulateSwapOperationsResponse", + "description": "The response for the `ReverseSimulateSwapOperations` query.", "type": "object", "required": [ "amount" ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount of the initial token needed to get the final token after the swap operations.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] } }, "additionalProperties": false, diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_reverse_simulation.json b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_reverse_simulation.json index 93cb5298..f901b023 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_reverse_simulation.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_reverse_simulation.json @@ -12,19 +12,44 @@ ], "properties": { "burn_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The burn fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "offer_amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount of the offer asset needed to get the ask amount.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "protocol_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The protocol fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "spread_amount": { - "$ref": "#/definitions/Uint128" + "description": "The spread amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "swap_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The swap fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] } }, "additionalProperties": false, diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_simulate_swap_operations.json b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_simulate_swap_operations.json index b15e18ee..80f0fc32 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_simulate_swap_operations.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_simulate_swap_operations.json @@ -1,13 +1,19 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SimulateSwapOperationsResponse", + "description": "The response for the `SimulateSwapOperations` query.", "type": "object", "required": [ "amount" ], "properties": { "amount": { - "$ref": "#/definitions/Uint128" + "description": "The amount of the final token after the swap operations.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] } }, "additionalProperties": false, diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_simulation.json b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_simulation.json index d364c2b5..7faa00a3 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_simulation.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_simulation.json @@ -12,19 +12,44 @@ ], "properties": { "burn_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The burn fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "protocol_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The protocol fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "return_amount": { - "$ref": "#/definitions/Uint128" + "description": "The return amount of the ask asset given the offer amount.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "spread_amount": { - "$ref": "#/definitions/Uint128" + "description": "The spread amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] }, "swap_fee_amount": { - "$ref": "#/definitions/Uint128" + "description": "The swap fee amount of the swap.", + "allOf": [ + { + "$ref": "#/definitions/Uint128" + } + ] } }, "additionalProperties": false, diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_route.json b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_route.json index 82801ed3..c988b63e 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_route.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_route.json @@ -1,20 +1,28 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SwapRouteResponse", + "description": "The response for the `SwapRoute` query.", "type": "object", "required": [ "swap_route" ], "properties": { "swap_route": { - "$ref": "#/definitions/SwapRoute" + "description": "The swap route taken for the queried swap.", + "allOf": [ + { + "$ref": "#/definitions/SwapRoute" + } + ] } }, "additionalProperties": false, "definitions": { "SwapOperation": { + "description": "The type of swap operation to perform.", "oneOf": [ { + "description": "A swap operation that uses the WhaleSwap router.", "type": "object", "required": [ "whale_swap" @@ -29,12 +37,15 @@ ], "properties": { "pool_identifier": { + "description": "The identifier of the pool to use for the swap.", "type": "string" }, "token_in_denom": { + "description": "The token denom to swap in.", "type": "string" }, "token_out_denom": { + "description": "The token denom returning from the swap.", "type": "string" } }, @@ -46,6 +57,7 @@ ] }, "SwapRoute": { + "description": "The swap route structure", "type": "object", "required": [ "ask_asset_denom", @@ -54,12 +66,15 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" }, "swap_operations": { + "description": "The swap operations to perform to get from offer asset to ask asset.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_route_creator.json b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_route_creator.json index 825c4ef4..0c80f134 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_route_creator.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_route_creator.json @@ -1,12 +1,14 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SwapRouteCreatorResponse", + "description": "The response for the `SwapRouteCreator` query.", "type": "object", "required": [ "creator" ], "properties": { "creator": { + "description": "The creator of the swap route.", "type": "string" } }, diff --git a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_routes.json b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_routes.json index c1f6e47c..4096e368 100644 --- a/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_routes.json +++ b/contracts/liquidity_hub/pool-manager/schema/raw/response_to_swap_routes.json @@ -1,12 +1,14 @@ { "$schema": "http://json-schema.org/draft-07/schema#", "title": "SwapRoutesResponse", + "description": "The response for the `SwapRoutes` query.", "type": "object", "required": [ "swap_routes" ], "properties": { "swap_routes": { + "description": "The swap routes registered in the contract.", "type": "array", "items": { "$ref": "#/definitions/SwapRoute" @@ -16,8 +18,10 @@ "additionalProperties": false, "definitions": { "SwapOperation": { + "description": "The type of swap operation to perform.", "oneOf": [ { + "description": "A swap operation that uses the WhaleSwap router.", "type": "object", "required": [ "whale_swap" @@ -32,12 +36,15 @@ ], "properties": { "pool_identifier": { + "description": "The identifier of the pool to use for the swap.", "type": "string" }, "token_in_denom": { + "description": "The token denom to swap in.", "type": "string" }, "token_out_denom": { + "description": "The token denom returning from the swap.", "type": "string" } }, @@ -49,6 +56,7 @@ ] }, "SwapRoute": { + "description": "The swap route structure", "type": "object", "required": [ "ask_asset_denom", @@ -57,12 +65,15 @@ ], "properties": { "ask_asset_denom": { + "description": "The ask asset denom, i.e. the asset that is being received.", "type": "string" }, "offer_asset_denom": { + "description": "The offer asset denom, i.e. the asset that is being swapped.", "type": "string" }, "swap_operations": { + "description": "The swap operations to perform to get from offer asset to ask asset.", "type": "array", "items": { "$ref": "#/definitions/SwapOperation" diff --git a/contracts/liquidity_hub/pool-manager/src/contract.rs b/contracts/liquidity_hub/pool-manager/src/contract.rs index fc3ae0bb..71d7a6a1 100644 --- a/contracts/liquidity_hub/pool-manager/src/contract.rs +++ b/contracts/liquidity_hub/pool-manager/src/contract.rs @@ -191,7 +191,7 @@ pub fn execute( #[cfg_attr(not(feature = "library"), entry_point)] pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result { match msg { - QueryMsg::Config {} => Ok(to_json_binary(&queries::query_config(deps)?)?), + QueryMsg::Config => Ok(to_json_binary(&queries::query_config(deps)?)?), QueryMsg::AssetDecimals { pool_identifier, denom, @@ -210,13 +210,11 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result Ok(to_json_binary(&queries::query_reverse_simulation( deps, env, ask_asset, - offer_asset, pool_identifier, )?)?), QueryMsg::SimulateSwapOperations { @@ -241,7 +239,7 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result Ok(to_json_binary(&queries::get_swap_routes(deps)?)?), + QueryMsg::SwapRoutes => Ok(to_json_binary(&queries::get_swap_routes(deps)?)?), QueryMsg::Ownership {} => Ok(to_json_binary(&cw_ownable::get_ownership(deps.storage)?)?), QueryMsg::Pool { pool_identifier } => { Ok(to_json_binary(&queries::get_pool(deps, pool_identifier)?)?) diff --git a/contracts/liquidity_hub/pool-manager/src/queries.rs b/contracts/liquidity_hub/pool-manager/src/queries.rs index c4227798..90d826f4 100644 --- a/contracts/liquidity_hub/pool-manager/src/queries.rs +++ b/contracts/liquidity_hub/pool-manager/src/queries.rs @@ -115,7 +115,6 @@ pub fn query_reverse_simulation( deps: Deps, _env: Env, ask_asset: Coin, - _offer_asset: Coin, pool_identifier: String, ) -> Result { let pool_info = get_pool_by_identifier(&deps, &pool_identifier)?; diff --git a/contracts/liquidity_hub/pool-manager/src/tests/suite.rs b/contracts/liquidity_hub/pool-manager/src/tests/suite.rs index 09f56c42..ff94f0c2 100644 --- a/contracts/liquidity_hub/pool-manager/src/tests/suite.rs +++ b/contracts/liquidity_hub/pool-manager/src/tests/suite.rs @@ -597,10 +597,6 @@ impl TestingSuite { self.app.wrap().query_wasm_smart( &self.pool_manager_addr, &white_whale_std::pool_manager::QueryMsg::ReverseSimulation { - offer_asset: Coin { - amount: Uint128::zero(), - denom: offer_asset, - }, ask_asset, pool_identifier, }, @@ -688,7 +684,7 @@ impl TestingSuite { .wrap() .query_wasm_smart( &self.pool_manager_addr, - &white_whale_std::pool_manager::QueryMsg::Config {}, + &white_whale_std::pool_manager::QueryMsg::Config, ) .unwrap() } @@ -720,7 +716,7 @@ impl TestingSuite { ) -> &mut Self { let swap_routes_response: StdResult = self.app.wrap().query_wasm_smart( &self.pool_manager_addr, - &white_whale_std::pool_manager::QueryMsg::SwapRoutes {}, + &white_whale_std::pool_manager::QueryMsg::SwapRoutes, ); result(swap_routes_response); diff --git a/packages/white-whale-std/src/pool_manager.rs b/packages/white-whale-std/src/pool_manager.rs index 62c606f0..b1623b79 100644 --- a/packages/white-whale-std/src/pool_manager.rs +++ b/packages/white-whale-std/src/pool_manager.rs @@ -5,11 +5,16 @@ use cosmwasm_schema::{cw_serde, QueryResponses}; use cosmwasm_std::{Addr, Coin, Decimal, Uint128}; use cw_ownable::{cw_ownable_execute, cw_ownable_query}; +/// The type of swap operation to perform. #[cw_serde] pub enum SwapOperation { + /// A swap operation that uses the WhaleSwap router. WhaleSwap { + /// The token denom to swap in. token_in_denom: String, + /// The token denom returning from the swap. token_out_denom: String, + /// The identifier of the pool to use for the swap. pool_identifier: String, }, } @@ -47,16 +52,21 @@ impl fmt::Display for SwapOperation { } } +/// The swap route structure #[cw_serde] pub struct SwapRoute { + /// The offer asset denom, i.e. the asset that is being swapped. pub offer_asset_denom: String, + /// The ask asset denom, i.e. the asset that is being received. pub ask_asset_denom: String, + /// The swap operations to perform to get from offer asset to ask asset. pub swap_operations: Vec, } -// Used for all swap routes +/// The response for the `SwapRoute` query. #[cw_serde] pub struct SwapRouteResponse { + /// The swap route taken for the queried swap. pub swap_route: SwapRoute, } @@ -70,7 +80,8 @@ impl fmt::Display for SwapRoute { } } -// Define a structure for Fees which names a number of defined fee collection types, maybe leaving room for a custom room a user can use to pass a fee with a defined custom name +// Defines a structure for Fees which names a number of defined fee collection types, leaving +// room for a custom fee a user can use to pass a fee with a defined custom name #[cw_serde] pub enum FeeTypes { Protocol, @@ -79,35 +90,48 @@ pub enum FeeTypes { Custom(String), } +/// Params for the stable swap, used when changing the amplification factor #[cw_serde] - pub struct StableSwapParams { + /// Initial amplification factor pub initial_amp: String, + /// Future amplification factor, i.e. target pub future_amp: String, + /// Block height when the initial amplification factor kicks in. It goes gradually from the + /// initial to the future amplification factor between the given blocks. pub initial_amp_block: String, + /// Block height when the future amplification factor will be set. It goes gradually from the + /// initial to the future amplification factor between the given blocks. pub future_amp_block: String, } -// Store PoolInfo to N -// We define a custom struct for which allows for dynamic but defined pools +/// Contains the pool information #[cw_serde] pub struct PoolInfo { + /// The asset denoms for the pool. pub asset_denoms: Vec, + /// The LP denom of the pool. pub lp_denom: String, + /// The decimals for the given asset denoms, provided in the same order as asset_denoms. pub asset_decimals: Vec, + /// The total amount of assets in the pool. pub assets: Vec, + /// The type of pool to create. pub pool_type: PoolType, + /// The fees for the pool. pub pool_fees: PoolFee, //pub stable_swap_params: Option } -impl PoolInfo {} +/// Possible pool types, it can be either a constant product (xyk) pool or a stable swap pool. #[cw_serde] pub enum PoolType { + /// A stable swap pool. StableSwap { /// The amount of amplification to perform on the constant product part of the swap formula. amp: u64, }, + /// xyk pool ConstantProduct, } @@ -121,13 +145,14 @@ impl PoolType { } } +/// The contract configuration. #[cw_serde] pub struct Config { /// The address of the bonding manager contract. pub bonding_manager_addr: Addr, /// The address of the incentive manager contract. pub incentive_manager_addr: Addr, - // We must set a creation fee on instantiation to prevent spamming of pools + /// How much it costs to create a pool. It helps prevent spamming of new pools. pub pool_creation_fee: Coin, // Whether or not swaps, deposits, and withdrawals are enabled pub feature_toggle: FeatureToggle, @@ -135,12 +160,14 @@ pub struct Config { #[cw_serde] pub struct InstantiateMsg { + /// The address of the bonding manager contract. pub bonding_manager_addr: String, + /// The address of the incentive manager contract. pub incentive_manager_addr: String, + /// How much it costs to create a pool. It helps prevent spamming of new pools. pub pool_creation_fee: Coin, } -/// The migrate message #[cw_serde] pub struct MigrateMsg {} @@ -239,77 +266,94 @@ pub enum ExecuteMsg { pub enum QueryMsg { /// Retrieves the contract's config. #[returns(ConfigResponse)] - Config {}, - + Config, /// Retrieves the decimals for the given asset. #[returns(AssetDecimalsResponse)] AssetDecimals { + /// The pool identifier to do the query for. pool_identifier: String, + /// The queried denom in the given pool_identifier. denom: String, }, - /// Simulates a swap. #[returns(SimulationResponse)] Simulation { + /// The offer asset to swap. offer_asset: Coin, + /// The pool identifier to swap in. pool_identifier: String, }, - /// Simulates a reverse swap, i.e. given the ask asset, how much of the offer asset is needed to - /// perform the swap. + /// Simulates a reverse swap, i.e. given the ask asset, how much of the offer asset is needed + /// to perform the swap. #[returns(ReverseSimulationResponse)] ReverseSimulation { + /// The ask asset to get after the swap. ask_asset: Coin, - offer_asset: Coin, + /// The pool identifier to swap in. pool_identifier: String, }, - /// Gets the swap route for the given offer and ask assets. #[returns(SwapRouteResponse)] SwapRoute { + /// The offer asset denom, i.e. the asset that is being swapped. offer_asset_denom: String, + /// The ask asset denom, i.e. the asset that is being received. ask_asset_denom: String, }, /// Gets all swap routes registered #[returns(SwapRoutesResponse)] - SwapRoutes {}, - + SwapRoutes, /// Simulates swap operations. #[returns(SimulateSwapOperationsResponse)] SimulateSwapOperations { + /// The amount to swap. offer_amount: Uint128, + /// The operations to perform. operations: Vec, }, /// Simulates a reverse swap operations, i.e. given the ask asset, how much of the offer asset /// is needed to perform the swap. #[returns(ReverseSimulateSwapOperationsResponse)] ReverseSimulateSwapOperations { + /// The amount to get after the swap. ask_amount: Uint128, + /// The operations to perform. operations: Vec, }, - + /// Retrieves the pool information for the given pool identifier. #[returns(PoolInfoResponse)] Pool { pool_identifier: String }, - /// Retrieves the creator of the swap routes that can then remove them. + /// Retrieves the creator of the swap route to get from offer to ask asset. The creator of + /// the swap route can remove it. #[returns(SwapRouteCreatorResponse)] SwapRouteCreator { + /// The offer asset denom, i.e. the asset that is being swapped. offer_asset_denom: String, + /// The ask asset denom, i.e. the asset that is being received. ask_asset_denom: String, }, } +/// The response for the `Config` query. #[cw_serde] pub struct ConfigResponse { + /// The contract configuration. pub config: Config, } +/// The response for the `SwapRoutes` query. #[cw_serde] pub struct SwapRoutesResponse { + /// The swap routes registered in the contract. pub swap_routes: Vec, } +/// The response for the `Pool` query. #[cw_serde] pub struct PoolInfoResponse { + /// The pool information for the given pool identifier. pub pool_info: PoolInfo, + /// The total LP tokens in the pool. pub total_share: Coin, } @@ -327,11 +371,17 @@ pub struct AssetDecimalsResponse { /// SimulationResponse returns swap simulation response #[cw_serde] pub struct SimulationResponse { + /// The return amount of the ask asset given the offer amount. pub return_amount: Uint128, + /// The spread amount of the swap. pub spread_amount: Uint128, + /// The swap fee amount of the swap. pub swap_fee_amount: Uint128, + /// The protocol fee amount of the swap. pub protocol_fee_amount: Uint128, + /// The burn fee amount of the swap. pub burn_fee_amount: Uint128, + /// The fee amount of the swap going to the osmosis community pool. #[cfg(feature = "osmosis")] pub osmosis_fee_amount: Uint128, } @@ -339,35 +389,49 @@ pub struct SimulationResponse { /// ReverseSimulationResponse returns reverse swap simulation response #[cw_serde] pub struct ReverseSimulationResponse { + /// The amount of the offer asset needed to get the ask amount. pub offer_amount: Uint128, + /// The spread amount of the swap. pub spread_amount: Uint128, + /// The swap fee amount of the swap. pub swap_fee_amount: Uint128, + /// The protocol fee amount of the swap. pub protocol_fee_amount: Uint128, + /// The burn fee amount of the swap. pub burn_fee_amount: Uint128, + /// The fee amount of the swap going to the osmosis community pool. #[cfg(feature = "osmosis")] pub osmosis_fee_amount: Uint128, } -/// Pool feature toggle +/// Pool feature toggle, can control whether swaps, deposits, and withdrawals are enabled. #[cw_serde] pub struct FeatureToggle { + /// Whether or not swaps are enabled pub withdrawals_enabled: bool, + /// Whether or not deposits are enabled pub deposits_enabled: bool, + /// Whether or not swaps are enabled pub swaps_enabled: bool, } -// We define a custom struct for each query response +/// The response for the `SimulateSwapOperations` query. #[cw_serde] pub struct SimulateSwapOperationsResponse { + /// The amount of the final token after the swap operations. pub amount: Uint128, } +/// The response for the `ReverseSimulateSwapOperations` query. #[cw_serde] pub struct ReverseSimulateSwapOperationsResponse { + /// The amount of the initial token needed to get the final token after the swap operations. pub amount: Uint128, } +/// The response for the `SwapRouteCreator` query. #[cw_serde] pub struct SwapRouteCreatorResponse { + /// The creator of the swap route. pub creator: String, }