From 922e75104770b042afc6bd467bbd5c09b901b44a Mon Sep 17 00:00:00 2001 From: Kerber0x Date: Mon, 15 Apr 2024 14:52:30 +0100 Subject: [PATCH] refactor: add SimulationResponse and ReverseSimulationResponse to the pool_manager package --- packages/white-whale-std/src/pool_manager.rs | 32 +++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/packages/white-whale-std/src/pool_manager.rs b/packages/white-whale-std/src/pool_manager.rs index 518e08e1..79060103 100644 --- a/packages/white-whale-std/src/pool_manager.rs +++ b/packages/white-whale-std/src/pool_manager.rs @@ -1,12 +1,6 @@ use std::fmt; -use crate::{ - fee::PoolFee, - pool_network::{ - asset::PairType, - pair::{ReverseSimulationResponse, SimulationResponse}, - }, -}; +use crate::{fee::PoolFee, pool_network::asset::PairType}; use cosmwasm_schema::{cw_serde, QueryResponses}; use cosmwasm_std::{Coin, Decimal, Uint128}; use cw_ownable::{cw_ownable_execute, cw_ownable_query}; @@ -250,3 +244,27 @@ pub struct AssetDecimalsResponse { /// The decimals for the requested denom. pub decimals: u8, } + +/// SimulationResponse returns swap simulation response +#[cw_serde] +pub struct SimulationResponse { + pub return_amount: Uint128, + pub spread_amount: Uint128, + pub swap_fee_amount: Uint128, + pub protocol_fee_amount: Uint128, + pub burn_fee_amount: Uint128, + #[cfg(feature = "osmosis")] + pub osmosis_fee_amount: Uint128, +} + +/// ReverseSimulationResponse returns reverse swap simulation response +#[cw_serde] +pub struct ReverseSimulationResponse { + pub offer_amount: Uint128, + pub spread_amount: Uint128, + pub swap_fee_amount: Uint128, + pub protocol_fee_amount: Uint128, + pub burn_fee_amount: Uint128, + #[cfg(feature = "osmosis")] + pub osmosis_fee_amount: Uint128, +}