feat: simulate swap as part of quotes (backport #547) #549
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://osmosis-network.slack.com/archives/C079LNKRUCB/p1730651766930679
Implementing
MsgSwapExactAmountIn
quote estimation logic directly into SQS.This will allow to wire SQS integration into Polaris. Ref: https://github.com/polaris-portal/polaris/pull/1011/files
Currently, in Polaris, as we get a quote, we also want to know the pricing for it.
To avoid round trips, we can have an optional query parameter to request SQS to run simulation logic immediately after estimating a quote.
Support
simulationAddress
andsimulationSlippageTolerance
query parametersTesting
Summary by CodeRabbit
Release Notes
New Features
PriceMsgs
method for improved gas estimation and fee calculation in message simulations.QuoteSimulator
interface and aSimulateQuote
method for simulating quotes in token swaps.GetQuoteRequest
to handle simulation parameters, includingSimulatorAddress
andSlippageToleranceMultiplier
.QuoteSimulator
for testing purposes.Improvements
RouterHandler
to utilize the new quote simulation functionality.SetQuotePriceInfo
method to manage quote price data effectively.Bug Fixes
Summary by CodeRabbit
Release Notes
New Features
PriceMsgs
method for improved gas estimation and fee calculation in message simulation.QuoteSimulator
interface andSimulateQuote
method for simulating quotes with slippage tolerance.GetOptimalQuote
method to support quote simulation based on a specified address and slippage tolerance.GetQuoteRequest
to manage simulation parameters.price_info
parameter toQuoteExactAmountInResponse
for additional pricing details.Bug Fixes
Documentation
Tests
This is an automatic backport of pull request #547 done by [Mergify](https://mergify.com).