From ac8ff66f8225677e53d2f2df43276e90b9d50b42 Mon Sep 17 00:00:00 2001 From: Brandon Weng <18161326+BrandonWeng@users.noreply.github.com> Date: Wed, 23 Nov 2022 15:22:40 -0500 Subject: [PATCH] Fix tick size (#54) --- contracts/sei-tester/tests/sei_tester_integration_tests.rs | 3 ++- packages/sei-cosmwasm/src/proto_structs.rs | 3 ++- packages/sei-integration-tests/src/module.rs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/contracts/sei-tester/tests/sei_tester_integration_tests.rs b/contracts/sei-tester/tests/sei_tester_integration_tests.rs index ed4eb44..6986a80 100644 --- a/contracts/sei-tester/tests/sei_tester_integration_tests.rs +++ b/contracts/sei-tester/tests/sei_tester_integration_tests.rs @@ -887,7 +887,8 @@ fn test_dex_module_query_dex_twap() { pair: DexPair { price_denom: "USDC".to_string(), asset_denom: "ATOM".to_string(), - tick_size: Decimal::from_ratio(1u128, 10000u128), + price_tick_size: Decimal::from_ratio(1u128, 10000u128), + quantity_tick_size: Decimal::from_ratio(1u128, 10000u128), }, twap: Decimal::raw(433), lookback_seconds: 6, diff --git a/packages/sei-cosmwasm/src/proto_structs.rs b/packages/sei-cosmwasm/src/proto_structs.rs index 9eee90e..457f3f6 100644 --- a/packages/sei-cosmwasm/src/proto_structs.rs +++ b/packages/sei-cosmwasm/src/proto_structs.rs @@ -28,7 +28,8 @@ pub struct OracleTwap { pub struct DexPair { pub price_denom: String, pub asset_denom: String, - pub tick_size: Decimal, + pub price_tick_size: Decimal, + pub quantity_tick_size: Decimal, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] diff --git a/packages/sei-integration-tests/src/module.rs b/packages/sei-integration-tests/src/module.rs index 8417892..9245b79 100644 --- a/packages/sei-integration-tests/src/module.rs +++ b/packages/sei-integration-tests/src/module.rs @@ -544,7 +544,8 @@ fn get_dex_twaps( pair: DexPair { asset_denom: key.0.clone(), price_denom: key.1.clone(), - tick_size: Decimal::from_ratio(1u128, 10000u128), + price_tick_size: Decimal::from_ratio(1u128, 10000u128), + quantity_tick_size: Decimal::from_ratio(1u128, 10000u128), }, twap: sum.div(Decimal::from_ratio(lookback_seconds, 1u64)), lookback_seconds: lookback_seconds,