diff --git a/Cargo.toml b/Cargo.toml index 013aeb68..c673c970 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,7 +70,6 @@ fee-distributor-mock = { path = "./contracts/liquidity_hub/fee-distributor-mock" incentive-factory = { path = "./contracts/liquidity_hub/pool-network/incentive_factory" } terraswap-token = { path = "./contracts/liquidity_hub/pool-network/terraswap_token" } terraswap-pair = { path = "./contracts/liquidity_hub/pool-network/terraswap_pair" } -epoch-manager = { path = "./contracts/liquidity_hub/epoch-manager" } incentive-manager = { path = "./contracts/liquidity_hub/incentive-manager" } [workspace.metadata.dylint] diff --git a/contracts/liquidity_hub/bonding-manager/schema/bonding-manager.json b/contracts/liquidity_hub/bonding-manager/schema/bonding-manager.json index f1cffa39..cdfa3a35 100644 --- a/contracts/liquidity_hub/bonding-manager/schema/bonding-manager.json +++ b/contracts/liquidity_hub/bonding-manager/schema/bonding-manager.json @@ -8,6 +8,7 @@ "type": "object", "required": [ "bonding_assets", + "distribution_denom", "grace_period", "growth_rate", "unbonding_period" @@ -20,6 +21,10 @@ "type": "string" } }, + "distribution_denom": { + "description": "Denom to be swapped to and rewarded", + "type": "string" + }, "grace_period": { "description": "Grace period the maximum age of a bucket before fees are forwarded from it", "allOf": [ @@ -145,6 +150,12 @@ "null" ] }, + "pool_manager_addr": { + "type": [ + "string", + "null" + ] + }, "unbonding_period": { "anyOf": [ { @@ -910,9 +921,11 @@ "type": "object", "required": [ "bonding_assets", + "distribution_denom", "grace_period", "growth_rate", "owner", + "pool_manager_addr", "unbonding_period" ], "properties": { @@ -923,6 +936,10 @@ "type": "string" } }, + "distribution_denom": { + "description": "Distribution denom for the rewards", + "type": "string" + }, "grace_period": { "description": "The duration of the grace period in epochs, i.e. how many expired epochs can be claimed", "allOf": [ @@ -947,6 +964,14 @@ } ] }, + "pool_manager_addr": { + "description": "Pool Manager contract address for swapping", + "allOf": [ + { + "$ref": "#/definitions/Addr" + } + ] + }, "unbonding_period": { "description": "Unbonding period in nanoseconds.", "allOf": [ diff --git a/contracts/liquidity_hub/bonding-manager/schema/raw/execute.json b/contracts/liquidity_hub/bonding-manager/schema/raw/execute.json index cc422597..77b99cb6 100644 --- a/contracts/liquidity_hub/bonding-manager/schema/raw/execute.json +++ b/contracts/liquidity_hub/bonding-manager/schema/raw/execute.json @@ -86,6 +86,12 @@ "null" ] }, + "pool_manager_addr": { + "type": [ + "string", + "null" + ] + }, "unbonding_period": { "anyOf": [ { diff --git a/contracts/liquidity_hub/bonding-manager/schema/raw/instantiate.json b/contracts/liquidity_hub/bonding-manager/schema/raw/instantiate.json index e0a5734f..3ffb9879 100644 --- a/contracts/liquidity_hub/bonding-manager/schema/raw/instantiate.json +++ b/contracts/liquidity_hub/bonding-manager/schema/raw/instantiate.json @@ -4,6 +4,7 @@ "type": "object", "required": [ "bonding_assets", + "distribution_denom", "grace_period", "growth_rate", "unbonding_period" @@ -16,6 +17,10 @@ "type": "string" } }, + "distribution_denom": { + "description": "Denom to be swapped to and rewarded", + "type": "string" + }, "grace_period": { "description": "Grace period the maximum age of a bucket before fees are forwarded from it", "allOf": [ diff --git a/contracts/liquidity_hub/bonding-manager/schema/raw/response_to_config.json b/contracts/liquidity_hub/bonding-manager/schema/raw/response_to_config.json index 11b21679..2ef8b2bc 100644 --- a/contracts/liquidity_hub/bonding-manager/schema/raw/response_to_config.json +++ b/contracts/liquidity_hub/bonding-manager/schema/raw/response_to_config.json @@ -4,9 +4,11 @@ "type": "object", "required": [ "bonding_assets", + "distribution_denom", "grace_period", "growth_rate", "owner", + "pool_manager_addr", "unbonding_period" ], "properties": { @@ -17,6 +19,10 @@ "type": "string" } }, + "distribution_denom": { + "description": "Distribution denom for the rewards", + "type": "string" + }, "grace_period": { "description": "The duration of the grace period in epochs, i.e. how many expired epochs can be claimed", "allOf": [ @@ -41,6 +47,14 @@ } ] }, + "pool_manager_addr": { + "description": "Pool Manager contract address for swapping", + "allOf": [ + { + "$ref": "#/definitions/Addr" + } + ] + }, "unbonding_period": { "description": "Unbonding period in nanoseconds.", "allOf": [ diff --git a/contracts/liquidity_hub/bonding-manager/src/tests/robot.rs b/contracts/liquidity_hub/bonding-manager/src/tests/robot.rs index 57a04abc..30d8b4e1 100644 --- a/contracts/liquidity_hub/bonding-manager/src/tests/robot.rs +++ b/contracts/liquidity_hub/bonding-manager/src/tests/robot.rs @@ -206,7 +206,8 @@ impl TestingRobot { .unwrap(); let msg = white_whale_std::pool_manager::InstantiateMsg { - fee_collector_addr: bonding_manager_addr.clone().to_string(), + bonding_manager_addr: bonding_manager_addr.clone().to_string(), + incentive_manager_addr: bonding_manager_addr.clone().to_string(), pool_creation_fee: Coin { amount: Uint128::from(1_000u128), denom: "uwhale".to_string(), @@ -611,6 +612,8 @@ impl TestingRobot { pair_identifier, slippage_tolerance: None, receiver: None, + lock_position_identifier: None, + unlocking_duration: None, }; result( diff --git a/contracts/liquidity_hub/pool-manager/src/router/commands.rs b/contracts/liquidity_hub/pool-manager/src/router/commands.rs index c91013f3..231f7c30 100644 --- a/contracts/liquidity_hub/pool-manager/src/router/commands.rs +++ b/contracts/liquidity_hub/pool-manager/src/router/commands.rs @@ -119,8 +119,7 @@ pub fn execute_swap_operations( if !swap_result.protocol_fee_asset.amount.is_zero() { fee_messages.push(CosmosMsg::Wasm(WasmMsg::Execute { contract_addr: config.bonding_manager_addr.to_string(), - msg: to_json_binary(&whale_lair::ExecuteMsg::FillRewardsCoin { - })?, + msg: to_json_binary(&whale_lair::ExecuteMsg::FillRewardsCoin {})?, funds: vec![swap_result.protocol_fee_asset.clone()], })); } diff --git a/contracts/liquidity_hub/pool-manager/src/swap/commands.rs b/contracts/liquidity_hub/pool-manager/src/swap/commands.rs index 5d952b52..a415f9d8 100644 --- a/contracts/liquidity_hub/pool-manager/src/swap/commands.rs +++ b/contracts/liquidity_hub/pool-manager/src/swap/commands.rs @@ -64,8 +64,7 @@ pub fn swap( if !swap_result.protocol_fee_asset.amount.is_zero() { messages.push(CosmosMsg::Wasm(WasmMsg::Execute { contract_addr: config.bonding_manager_addr.to_string(), - msg: to_json_binary(&whale_lair::ExecuteMsg::FillRewardsCoin { - })?, + msg: to_json_binary(&whale_lair::ExecuteMsg::FillRewardsCoin {})?, funds: vec![swap_result.protocol_fee_asset.clone()], })); } diff --git a/packages/white-whale-std/src/bonding_manager.rs b/packages/white-whale-std/src/bonding_manager.rs index 8ec81782..728d1f31 100644 --- a/packages/white-whale-std/src/bonding_manager.rs +++ b/packages/white-whale-std/src/bonding_manager.rs @@ -82,7 +82,7 @@ pub struct GlobalIndex { #[cw_serde] pub struct InstantiateMsg { - /// Denom to be swapped to and rewarded + /// Denom to be swapped to and rewarded pub distribution_denom: String, /// Unbonding period in nanoseconds. pub unbonding_period: Uint64, diff --git a/packages/white-whale-std/src/pool_manager.rs b/packages/white-whale-std/src/pool_manager.rs index 9e715379..d4d0bc05 100644 --- a/packages/white-whale-std/src/pool_manager.rs +++ b/packages/white-whale-std/src/pool_manager.rs @@ -32,7 +32,9 @@ impl SwapOperation { pub fn get_pool_identifer(&self) -> String { match self { - SwapOperation::WhaleSwap { pool_identifier, .. } => pool_identifier.clone(), + SwapOperation::WhaleSwap { + pool_identifier, .. + } => pool_identifier.clone(), } } }