Skip to content

Commit

Permalink
Merge pull request #3 from White-Whale-Defi-Platform/fix/spotprice-query
Browse files Browse the repository at this point in the history
fix: spotprice query
  • Loading branch information
Sen-Com authored Mar 14, 2024
2 parents 679a59b + 9b894cb commit 13d3738
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion osmosis-cw-pool/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 osmosis-cw-pool/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "osmosis-cw-pool"
version = "1.0.1"
version = "1.0.2"
authors = ["Kerber0x <kerber0x@protonmail.com>"]
description = "Osmosis Pool interface implementation to hook Osmosis with White Whale pools"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion osmosis-cw-pool/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub(crate) fn spot_price(
.ok_or_else(|| StdError::generic_err("Base asset not found"))?;

Ok(SpotPriceResponse {
spot_price: Decimal::from_ratio(base_asset_amount, quote_asset_amount),
spot_price: Decimal::from_ratio(quote_asset_amount, base_asset_amount),
})
}

Expand Down
10 changes: 5 additions & 5 deletions osmosis-cw-pool/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ fn check_queries() {
res,
SpotPriceResponse {
spot_price: Decimal::from_ratio(
Uint128::from(10_010_000u128),
Uint128::from(9_990_019u128)
Uint128::from(9_990_019u128),
Uint128::from(10_010_000u128)
)
}
);
Expand All @@ -591,8 +591,8 @@ fn check_queries() {
res,
SpotPriceResponse {
spot_price: Decimal::from_ratio(
Uint128::from(9_990_019u128),
Uint128::from(10_010_000u128)
Uint128::from(10_010_000u128),
Uint128::from(9_990_019u128)
)
}
);
Expand All @@ -615,7 +615,7 @@ fn check_queries() {
assert_eq!(
res,
Config {
white_whale_pool: ww_pool.clone()
white_whale_pool: ww_pool.clone(),
}
);
},
Expand Down
Binary file modified osmosis-cw-pool/tests/test_artifacts/osmosis_cw_pool.wasm
Binary file not shown.
Binary file not shown.

0 comments on commit 13d3738

Please sign in to comment.