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

fix: improve buy limit orders #541

Closed
wants to merge 29 commits into from

Conversation

dib542
Copy link
Collaborator

@dib542 dib542 commented Mar 14, 2024

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

@dib542 dib542 marked this pull request as ready for review March 14, 2024 15:04
dib542 added a commit that referenced this pull request Mar 14, 2024
dib542 added 26 commits April 4, 2024 20:10
    - wallet is required to use tx simulation for the form
dib542 added a commit that referenced this pull request Apr 7, 2024
dib542 added a commit that referenced this pull request Apr 9, 2024
@dib542
Copy link
Collaborator Author

dib542 commented Apr 9, 2024

Closing this issue to instead be the first part of the overall issue PR: #539

@dib542 dib542 closed this Apr 9, 2024
dib542 added a commit that referenced this pull request Apr 9, 2024
* #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
dib542 pushed a commit that referenced this pull request Apr 9, 2024
## [2.6.0](v2.5.0...v2.6.0) (2024-04-09)

### Features

* improve Orderbook UI and buy/sell orders ([#539](#539)) ([6139e1d](6139e1d)), closes [#537](#537) [#541](#541)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants