Skip to content

Commit

Permalink
feat: take rate
Browse files Browse the repository at this point in the history
  • Loading branch information
kerber0x authored Jan 24, 2025
1 parent 41105a1 commit f423770
Show file tree
Hide file tree
Showing 16 changed files with 828 additions and 57 deletions.
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ prost = { version = "0.11.9", default-features = false, features = [
prost-types = { version = "0.11.9", default-features = false }
# for local development
#white-whale-std = { path = "packages/white-whale-std" }
white-whale-std = { version = "1.1.5" }
white-whale-std = { version = "1.2.6" }
white-whale-testing = { path = "./packages/white-whale-testing" }
cw-multi-test = { version = "0.16.5" }
uint = "0.9.5"
Expand Down
2 changes: 1 addition & 1 deletion contracts/liquidity_hub/fee_collector/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fee_collector"
version = "1.1.7"
version = "1.2.0"
authors = ["Kerber0x <[email protected]>"]
edition.workspace = true
description = "Contract to collect the fees accrued by the pools and vaults in the liquidity hub"
Expand Down
42 changes: 42 additions & 0 deletions contracts/liquidity_hub/fee_collector/schema/fee_collector.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@
"null"
]
},
"is_take_rate_active": {
"type": [
"boolean",
"null"
]
},
"owner": {
"type": [
"string",
Expand All @@ -116,6 +122,22 @@
"null"
]
},
"take_rate": {
"anyOf": [
{
"$ref": "#/definitions/Decimal"
},
{
"type": "null"
}
]
},
"take_rate_dao_address": {
"type": [
"string",
"null"
]
},
"vault_factory": {
"type": [
"string",
Expand Down Expand Up @@ -241,6 +263,10 @@
}
]
},
"Decimal": {
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
"type": "string"
},
"Epoch": {
"type": "object",
"required": [
Expand Down Expand Up @@ -760,15 +786,21 @@
"type": "object",
"required": [
"fee_distributor",
"is_take_rate_active",
"owner",
"pool_factory",
"pool_router",
"take_rate",
"take_rate_dao_address",
"vault_factory"
],
"properties": {
"fee_distributor": {
"$ref": "#/definitions/Addr"
},
"is_take_rate_active": {
"type": "boolean"
},
"owner": {
"$ref": "#/definitions/Addr"
},
Expand All @@ -778,6 +810,12 @@
"pool_router": {
"$ref": "#/definitions/Addr"
},
"take_rate": {
"$ref": "#/definitions/Decimal"
},
"take_rate_dao_address": {
"$ref": "#/definitions/Addr"
},
"vault_factory": {
"$ref": "#/definitions/Addr"
}
Expand All @@ -787,6 +825,10 @@
"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"
},
"Decimal": {
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
"type": "string"
}
}
},
Expand Down
26 changes: 26 additions & 0 deletions contracts/liquidity_hub/fee_collector/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@
"null"
]
},
"is_take_rate_active": {
"type": [
"boolean",
"null"
]
},
"owner": {
"type": [
"string",
Expand All @@ -106,6 +112,22 @@
"null"
]
},
"take_rate": {
"anyOf": [
{
"$ref": "#/definitions/Decimal"
},
{
"type": "null"
}
]
},
"take_rate_dao_address": {
"type": [
"string",
"null"
]
},
"vault_factory": {
"type": [
"string",
Expand Down Expand Up @@ -231,6 +253,10 @@
}
]
},
"Decimal": {
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
"type": "string"
},
"Epoch": {
"type": "object",
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
"type": "object",
"required": [
"fee_distributor",
"is_take_rate_active",
"owner",
"pool_factory",
"pool_router",
"take_rate",
"take_rate_dao_address",
"vault_factory"
],
"properties": {
"fee_distributor": {
"$ref": "#/definitions/Addr"
},
"is_take_rate_active": {
"type": "boolean"
},
"owner": {
"$ref": "#/definitions/Addr"
},
Expand All @@ -22,6 +28,12 @@
"pool_router": {
"$ref": "#/definitions/Addr"
},
"take_rate": {
"$ref": "#/definitions/Decimal"
},
"take_rate_dao_address": {
"$ref": "#/definitions/Addr"
},
"vault_factory": {
"$ref": "#/definitions/Addr"
}
Expand All @@ -31,6 +43,10 @@
"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"
},
"Decimal": {
"description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)",
"type": "string"
}
}
}
Loading

0 comments on commit f423770

Please sign in to comment.