Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API-2954] Drop - Do not simulate getting out of bonded denom #130

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

mattac21
Copy link
Contributor

@mattac21 mattac21 commented Aug 12, 2024

For SimulateSwapExactAssetIn simulations, do not allow for simulations where the AssetIn is the bonded_denom. For SimulateSwapExactAssetOut simulations, do not allow for simulations where the AssetOut is the remote_denom.

…bonded denom, not the other way around

for SwapExactIn queries, only allow for users to simulate swaps starting
from the remote denom and going to the bonded denom. for SwapExactOut
queries, only allow for users to simulate getting the bonded denom out,
meaning they would be starting from the remote denom for the swap
@mattac21 mattac21 requested a review from NotJeremyLiu August 12, 2024 15:47
@mattac21 mattac21 changed the title dont simulate going from bonded_denom to remote_denom [API-2954] Drop - Do not simulate getting out of bonded denom Aug 12, 2024
@mattac21 mattac21 requested a review from a team August 12, 2024 15:50
match denom_in {
// if doing an 'in' query, only allow for simulating putting the remote denom in
denom_in if denom_in == remote_denom => Ok(bonded_denom.to_string()),
denom_in if denom_in == bonded_denom => Err(ContractError::UnsupportedDenom),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if they're trying to simulate a swap where the input is the bonded denom, fail

match denom_out {
// if doing an 'out' query, only allow for simulating getting the bonded denom out
denom_out if denom_out == remote_denom => Err(ContractError::UnsupportedDenom),
denom_out if denom_out == bonded_denom => Ok(remote_denom.to_string()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if they're trying to simulate a swap where where the output would be the remote denom (i.e. swapping the bonded denom to the remote denom), fail

@mattac21 mattac21 merged commit aa375c4 into main Aug 12, 2024
5 checks passed
@mattac21 mattac21 deleted the ma/drop-no-bonded branch August 12, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants