Skip to content

Commit

Permalink
refactor: add SimulationResponse and ReverseSimulationResponse to the…
Browse files Browse the repository at this point in the history
… pool_manager package
  • Loading branch information
kerber0x committed Apr 16, 2024
1 parent 787e589 commit 922e751
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions packages/white-whale-std/src/pool_manager.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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,
}

0 comments on commit 922e751

Please sign in to comment.