-
Notifications
You must be signed in to change notification settings - Fork 2
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
fix: improve buy limit orders #541
Conversation
Deploy PreviewsTestnetPreview URL: https://6ac33b21-482bd589--duality-xyz-testnet.netlify.app BetaPreview URL: https://6ac33b21-482bd589--duality-xyz-beta.netlify.app |
- wallet is required to use tx simulation for the form
6ac33b2
to
df46b52
Compare
Deploy PreviewsTestnetPreview URL: https://df46b525-5f77dfb6--duality-xyz-testnet.netlify.app BetaPreview URL: https://df46b525-5f77dfb6--duality-xyz-beta.netlify.app |
Closing this issue to instead be the first part of the overall issue PR: #539 |
* #537 feat: use chain simulations for swap estimations * #541 fix: improve buy limit orders * feat: add Order Type help: link to docs * feat: switch pool token order when displaying a pair: tokenB/tokenA * refactor: remove possibility of misaligning order type text values * refactor: read swap amout out from result payload instead of events * feat: add other types of limit orders to be used in inputs * fix: add negative limit price check * fix: price directions are dependent on buy mode and token order * feat: allow indexer stream hooks to include metadata like height * fix: update simulated place limit order on each liquidity movement * fix: improve loading states during continuous limit order simulations * fix: calculate approx non-immediate limit order coin out for previews * Revert "fix: reduce FILL_OR_KILL bugs in simulations temporarily" This reverts commit cb8e7ea. * fix: display insufficient liquidity only when the error is encountered * feat: improve loading state keeping previous preview results * fix: correct the range slider input in buy mode for token out * fix: dropdown click behavior: don't blur when Drawer is clicked * feat: add more gas for limit orders * feat: improve Filled status calculation * fix: remove trade Status column for now * fix: add specific warning for "Swap amount too small" issue * fix: add specific Fill Or Kill warning message * fix: don't persist preview value with 0 input * fix: improve when swap simulation is re-requested * feat: add "Pair is not initialized" Swap warning * feat: add "Insufficient liquidity" Swap warning * feat: add "Swap amount too small" Swap warning * fix: allow setting an initial heartbeat height on a DualDataSet * fix: add better FoK error issue workaround * fix: read real-time price from fetch properly * feat: allow useRealtimePrice to have undefined inputs * feat: use useRealtimePrice for default LimitOrder simulation price * feat: use useRealtimePrice for midpoint of Orderbook list card * fix: errors on buy side were missed, match the input conditions better
this PR builds on
To compare since these PRs: https://github.com/duality-labs/duality-web-app/compare/408-replace-swap-estimation-calculation-with-chain-simulation-data-alt..459-improve-buy-limit-orders-part-2-rebased
To use limit order simulations to predict the behavior of potential Buy and Sell limit orders of various types. The two added here:
FILL_OR_KILL
IMMEDIATE_OR_CANCEL
Are the immediate type orders where immediate results of the potential trade can seen and given to the user for their information . The other time-based orders:
GOOD_TIL_CANCELLED
GOOD_TIL_TIME
JUST_IN_TIME
do not give usable feedback, but we can assume their behavior and add logic for these in a following PR