Skip to content

Commit

Permalink
Fix tick size (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonWeng authored Nov 23, 2022
1 parent 76fa363 commit ac8ff66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion contracts/sei-tester/tests/sei_tester_integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion packages/sei-cosmwasm/src/proto_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
3 changes: 2 additions & 1 deletion packages/sei-integration-tests/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ac8ff66

Please sign in to comment.