Skip to content

Commit

Permalink
chore(schemas): update pool-manager schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
kaimen-sano committed Apr 14, 2024
1 parent 7d29f3c commit 9986f8a
Show file tree
Hide file tree
Showing 5 changed files with 424 additions and 16 deletions.
220 changes: 212 additions & 8 deletions contracts/liquidity_hub/pool-manager/schema/pool-manager.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,58 @@
},
"additionalProperties": false
},
{
"description": "Updates the configuration of the contract. If a field is not specified (i.e., set to `None`), it will not be modified.",
"type": "object",
"required": [
"update_config"
],
"properties": {
"update_config": {
"type": "object",
"properties": {
"feature_toggle": {
"description": "The new feature toggles of the contract, allowing fine-tuned control over which operations are allowed.",
"anyOf": [
{
"$ref": "#/definitions/FeatureToggle"
},
{
"type": "null"
}
]
},
"owner_addr": {
"description": "The new owner address of the contract, which is allowed to update configuration.",
"type": [
"string",
"null"
]
},
"pool_creation_fee": {
"description": "The new fee that must be paid when a pool is created.",
"anyOf": [
{
"$ref": "#/definitions/Coin"
},
{
"type": "null"
}
]
},
"whale_lair_addr": {
"description": "The new whale-lair contract address.",
"type": [
"string",
"null"
]
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Update the contract's ownership. The `action` to be provided can be either to propose transferring ownership to an account, accept a pending ownership transfer, or renounce the ownership permanently.",
"type": "object",
Expand Down Expand Up @@ -442,6 +494,27 @@
}
]
},
"FeatureToggle": {
"description": "Pool feature toggle",
"type": "object",
"required": [
"deposits_enabled",
"swaps_enabled",
"withdrawals_enabled"
],
"properties": {
"deposits_enabled": {
"type": "boolean"
},
"swaps_enabled": {
"type": "boolean"
},
"withdrawals_enabled": {
"type": "boolean"
}
},
"additionalProperties": false
},
"Fee": {
"type": "object",
"required": [
Expand Down Expand Up @@ -489,22 +562,45 @@
]
},
"PoolFee": {
"description": "Fees used by the pools on the pool network",
"description": "Represents the fee structure for transactions within a pool.\n\n# Fields - `protocol_fee`: The fee percentage charged by the protocol on each transaction to support operational and developmental needs. - `swap_fee`: The fee percentage allocated to liquidity providers as a reward for supplying liquidity to the pool, incentivizing participation and ensuring pool health. - `burn_fee`: A fee percentage that is burned on each transaction, helping manage the token economy by reducing supply over time, potentially increasing token value. - `osmosis_fee` (optional): Specific to the Osmosis feature, this fee is charged on each transaction when the Osmosis feature is enabled, supporting specific ecosystem requirements. - `extra_fees`: A vector of custom fees allowing for extensible and adaptable fee structures to meet diverse and evolving needs. Validation ensures that the total of all fees does not exceed 100%, maintaining fairness and avoiding overcharging.\n\n# Features - `osmosis`: Enables the `osmosis_fee` field, integrating specific fee requirements for the Osmosis protocol within the pool's fee structure.",
"type": "object",
"required": [
"burn_fee",
"extra_fees",
"protocol_fee",
"swap_fee"
],
"properties": {
"burn_fee": {
"$ref": "#/definitions/Fee"
"description": "Fee percentage that is burned on each transaction. Burning a portion of the transaction fee helps in reducing the overall token supply.",
"allOf": [
{
"$ref": "#/definitions/Fee"
}
]
},
"extra_fees": {
"description": "A list of custom, additional fees that can be defined for specific use cases or additional functionalities. This vector enables the flexibility to introduce new fees without altering the core fee structure. Total of all fees, including custom ones, is validated to not exceed 100%, ensuring a balanced and fair fee distribution.",
"type": "array",
"items": {
"$ref": "#/definitions/Fee"
}
},
"protocol_fee": {
"$ref": "#/definitions/Fee"
"description": "Fee percentage charged on each transaction for the protocol's benefit.",
"allOf": [
{
"$ref": "#/definitions/Fee"
}
]
},
"swap_fee": {
"$ref": "#/definitions/Fee"
"description": "Fee percentage allocated to liquidity providers on each swap.",
"allOf": [
{
"$ref": "#/definitions/Fee"
}
]
}
},
"additionalProperties": false
Expand Down Expand Up @@ -587,6 +683,19 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "QueryMsg",
"oneOf": [
{
"type": "object",
"required": [
"config"
],
"properties": {
"config": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
{
"description": "Retrieves the decimals for the given native or ibc denom.",
"type": "object",
Expand Down Expand Up @@ -776,6 +885,78 @@
},
"sudo": null,
"responses": {
"config": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Config",
"type": "object",
"required": [
"feature_toggle",
"owner",
"pool_creation_fee",
"whale_lair_addr"
],
"properties": {
"feature_toggle": {
"$ref": "#/definitions/FeatureToggle"
},
"owner": {
"$ref": "#/definitions/Addr"
},
"pool_creation_fee": {
"$ref": "#/definitions/Coin"
},
"whale_lair_addr": {
"$ref": "#/definitions/Addr"
}
},
"additionalProperties": false,
"definitions": {
"Addr": {
"description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.",
"type": "string"
},
"Coin": {
"type": "object",
"required": [
"amount",
"denom"
],
"properties": {
"amount": {
"$ref": "#/definitions/Uint128"
},
"denom": {
"type": "string"
}
}
},
"FeatureToggle": {
"description": "Pool feature toggle",
"type": "object",
"required": [
"deposits_enabled",
"swaps_enabled",
"withdrawals_enabled"
],
"properties": {
"deposits_enabled": {
"type": "boolean"
},
"swaps_enabled": {
"type": "boolean"
},
"withdrawals_enabled": {
"type": "boolean"
}
},
"additionalProperties": false
},
"Uint128": {
"description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```",
"type": "string"
}
}
},
"native_token_decimals": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "NativeTokenDecimalsResponse",
Expand Down Expand Up @@ -998,22 +1179,45 @@
]
},
"PoolFee": {
"description": "Fees used by the pools on the pool network",
"description": "Represents the fee structure for transactions within a pool.\n\n# Fields - `protocol_fee`: The fee percentage charged by the protocol on each transaction to support operational and developmental needs. - `swap_fee`: The fee percentage allocated to liquidity providers as a reward for supplying liquidity to the pool, incentivizing participation and ensuring pool health. - `burn_fee`: A fee percentage that is burned on each transaction, helping manage the token economy by reducing supply over time, potentially increasing token value. - `osmosis_fee` (optional): Specific to the Osmosis feature, this fee is charged on each transaction when the Osmosis feature is enabled, supporting specific ecosystem requirements. - `extra_fees`: A vector of custom fees allowing for extensible and adaptable fee structures to meet diverse and evolving needs. Validation ensures that the total of all fees does not exceed 100%, maintaining fairness and avoiding overcharging.\n\n# Features - `osmosis`: Enables the `osmosis_fee` field, integrating specific fee requirements for the Osmosis protocol within the pool's fee structure.",
"type": "object",
"required": [
"burn_fee",
"extra_fees",
"protocol_fee",
"swap_fee"
],
"properties": {
"burn_fee": {
"$ref": "#/definitions/Fee"
"description": "Fee percentage that is burned on each transaction. Burning a portion of the transaction fee helps in reducing the overall token supply.",
"allOf": [
{
"$ref": "#/definitions/Fee"
}
]
},
"extra_fees": {
"description": "A list of custom, additional fees that can be defined for specific use cases or additional functionalities. This vector enables the flexibility to introduce new fees without altering the core fee structure. Total of all fees, including custom ones, is validated to not exceed 100%, ensuring a balanced and fair fee distribution.",
"type": "array",
"items": {
"$ref": "#/definitions/Fee"
}
},
"protocol_fee": {
"$ref": "#/definitions/Fee"
"description": "Fee percentage charged on each transaction for the protocol's benefit.",
"allOf": [
{
"$ref": "#/definitions/Fee"
}
]
},
"swap_fee": {
"$ref": "#/definitions/Fee"
"description": "Fee percentage allocated to liquidity providers on each swap.",
"allOf": [
{
"$ref": "#/definitions/Fee"
}
]
}
},
"additionalProperties": false
Expand Down
Loading

0 comments on commit 9986f8a

Please sign in to comment.