Skip to content

Commit

Permalink
Merge pull request #32 from osmosis-labs/boss/enforce-limiter-only-wh…
Browse files Browse the repository at this point in the history
…en-increase

Enforce limiter check only when its associated denom's weight is increasing
  • Loading branch information
iboss-ptk authored Aug 5, 2024
2 parents ef24c04 + dfa6262 commit 952b393
Show file tree
Hide file tree
Showing 5 changed files with 456 additions and 68 deletions.
6 changes: 4 additions & 2 deletions contracts/transmuter/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,8 @@ impl Transmuter<'_> {
swap_fee: Decimal,
) -> Result<CalcOutAmtGivenInResponse, ContractError> {
self.ensure_valid_swap_fee(swap_fee)?;
let (_pool, token_out) = self.out_amt_given_in(deps, token_in, &token_out_denom)?;
let pool = self.pool.load(deps.storage)?;
let (_pool, token_out) = self.out_amt_given_in(deps, pool, token_in, &token_out_denom)?;

Ok(CalcOutAmtGivenInResponse { token_out })
}
Expand All @@ -693,7 +694,8 @@ impl Transmuter<'_> {
swap_fee: Decimal,
) -> Result<CalcInAmtGivenOutResponse, ContractError> {
self.ensure_valid_swap_fee(swap_fee)?;
let (_pool, token_in) = self.in_amt_given_out(deps, token_out, token_in_denom)?;
let pool = self.pool.load(deps.storage)?;
let (_pool, token_in) = self.in_amt_given_out(deps, pool, token_out, token_in_denom)?;

Ok(CalcInAmtGivenOutResponse { token_in })
}
Expand Down
Loading

0 comments on commit 952b393

Please sign in to comment.