Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions contracts/sumtree-orderbook/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> ContractResult<Binary> {
token_out_denom,
swap_fee,
)?)?),
QueryMsg::CalcOutAmtGivenIn {
token_in,
token_out_denom,
swap_fee,
} => Ok(to_json_binary(&query::calc_out_amount_given_in(
deps,
token_in,
token_out_denom,
swap_fee,
)?)?),
QueryMsg::GetTotalPoolLiquidity {} => {
Ok(to_json_binary(&query::total_pool_liquidity(deps)?)?)
}
Expand Down
7 changes: 7 additions & 0 deletions contracts/sumtree-orderbook/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ pub enum QueryMsg {
token_out_denom: String,
swap_fee: Decimal,
},
// Duplicate of the above, but for compatibility CosmWasm Pool module
#[returns(CalcOutAmtGivenInResponse)]
CalcOutAmtGivenIn {
token_in: Coin,
token_out_denom: String,
swap_fee: Decimal,
},
#[returns(GetTotalPoolLiquidityResponse)]
GetTotalPoolLiquidity {},
/// NO-OP QUERY
Expand Down
Loading