forked from decred/dcrdex
-
Notifications
You must be signed in to change notification settings - Fork 0
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
ui: markets page rework #25
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
728ee3c
to
7a6a0ef
Compare
2f75b77
to
c0a9128
Compare
6422729
to
a321067
Compare
6cea86b
to
b55b0f0
Compare
3422c6f
to
02f0afe
Compare
… overview view background distinct from created bot configurations
…s some quirks of current implementation
…ger being relevant (eg. order in submitting status)
…it fully symmetric
…t (for simpler readability) and only show recent (24h in the past) matches; also rework order-book mid-section
…overed), adjust profit threshold
…rs previuosly); add completed orders views (and extend order filtering API to support the use-case of fetching trully relevant orders); format quantities on open/completed views to lot size; finally, minor adjustments to relevant html/css have been made
2afafdb
to
62dad15
Compare
03aeed8
to
aa6ede6
Compare
518c812
to
114610a
Compare
… (also display fiat rate alongside); improve the way stuck EVM transactions are handled so that fee-bumps actually work; respects user-configured MaxFee estimate for redeems
114610a
to
adb9438
Compare
Merging since this functionality is mostly done, minor adjustments/fixes that follow can go directly to master |
norwnd
added a commit
that referenced
this pull request
Jan 18, 2025
* ui: markets page rework (mainly order-form) * fix rate conversion(s), get rid of swap options views (and rework showVerify), get rid of translations as unnecessary burden * fix decimal number inputs (getting rid of number in favor of text + additional js validation) * turn off selection history for order-forms * handle balance update notes properly * rework market list * minor visual adjustments (margins and such) * add reference fiat rate in orange * move order-forms under candle chart * fix scaling with browser zoom * fix total calculation for buy/sell forms * order-form: resolve some edge-cases around invalid inputs * refactor number parsing for rate/qty fields, allow for comma * rework active orders section to only show active/relevant orders * order-form: optimize buy/sell buttons * refactor out unnecessary delay param * rework slider to make it more vibrant, general order form improvements & bug fixes (element alignment and such) * markets: shrink header a bit, limit order book-side size to 14 so we don't have to scroll UI * improve rate/qty fields parsing * improve slider handling * markets: adding order to book-side should be smooth * markets: rework header, rework spot-price display * minor sell slider fix * minor markets-header adjustments * markets: misc adjustments (mostly header) * order-form default price should be best buy/sell (not mid-gap) * form-label should not affect cursor * rework market header (mostly to simplify code involved), format total in/out properly, make candle-chart scaling/zooming smooth (add more zoom-levels) * get rid of redundant trading limits info, remove what's left of wallet locking in UI, adjust markets header * fix number formatting all across UI * introduce a work-around for insanely high server-configured rate-step * refactor matches table code, swap column order for more clear signal, add asset symbols to clarify what Rate/Size are * refactor qty parsing (order-form) * refactor rate/coin formatting, format qty to lot size (in order-book, matches table) * reverse rate/qty columns in order-book to make qty easier to read * use precise to-lot formatting where it makes sense * rework order-book to highlight order relevance (based on quantity and price) * fix typo/bug with converting floating-point numbers to atomic numbers (which are always integers) * (when formatting decimals in UI) don't show comma since it's confusing when combined with decimal dot * candle chart refactoring/adjustments (mostly related to making scrolling smooth, adjusting paddings, and moving price labels to a separate column on the right); plus minor bug fixes unrelated to candle chart * candle-chart: make scrolling smoother * fix forms formatting * candle-chart: fixes & adjustments (proper life-cycle handling) * variuos adjustments to make things pretty * re-arrange stats on market header (mostly around bison/fiat price), fix the way candles/market is loaded * markets: remove order-acceleration functionality since it doesn't belong on this page (we can accelerate on order-view if necessary), add a bunch of missing await calls * add tooltips for bison/external prices, display external price on the order-book as well * use defined constant instead of hardcoded value (for colors), make MM overview view background distinct from created bot configurations * order-form: make use of change handler for price/qty inputs to address some quirks of current implementation * minor adjustments * handle edge-case related to user order still showing in UI but no longer being relevant (eg. order in submitting status) * adjust the way candlesLoaded notification gets handled in UI to make it fully symmetric * matches table - update Age column to be a timestamp in hh-mm-ss format (for simpler readability) and only show recent (24h in the past) matches; also rework order-book mid-section * use more compact date-time for display on candle chart (when candle is hovered) * rework market page UI colors, minor mics adjustments * update the way order-book looks, add % delta relative to external price * remove last match data from order-book to keep it clean and simple * order-book: periodically update price delta(s) * cut margins for date-time displayed on candle chart (when candle is hovered), adjust profit threshold * display negative price delta with opposite color to make it clearly visible in UI * refactor code around recent matches & open orders (called active orders previuosly); add completed orders views (and extend order filtering API to support the use-case of fetching trully relevant orders); format quantities on open/completed views to lot size; finally, minor adjustments to relevant html/css have been made * update OrderReader.StatusString func to correspond to what we have in JS * properly count/display total/locked wallet balances * fix incorrect fee displayed in UI for user-prompt action to bump fees (also display fiat rate alongside); improve the way stuck EVM transactions are handled so that fee-bumps actually work; respects user-configured MaxFee estimate for redeems --------- Co-authored-by: norwnd <norwnd>
norwnd
added a commit
that referenced
this pull request
Jan 18, 2025
* add build scripts, add work-around for poor order-book sync between client and server, mm bot rework of basic strategy to make it competitive, relax requirements for POL reserved/locked for fees, get rid of depth chart, other UI cleanup * fix typos (introduced when removing depth-chart) * improve order placement (add safety, adjust logs) * allow to configure profit threshold between 0.1 and 4% (from 2% max allowed previously) * mm bot improvements, rework previous solution for displaying own order book orders to be complete * mm bot should make 1-sided placements only, skew mm bot algo to resits (not follow) rapid market price changes * mm bot adjustments * mm bot adjustments * perform Bison mid-gap rate sanity check only when mid-gap rate is available * work-around for annoying bug that Bison wallet doesn't recover from * makefile: make a by default * update fiat rates more frequently * only check for slippage when we can get mid-gap rate * better checks for bad prices from fiat oracles * remove locale artifacts * better validation for oracle volume * revert: update fiat rates more frequently (we can't fetch fiat rates more frequently due to aggressive rate limiting) * disable server-enforced max-fee limit restriction * add Binance as fiat-rate source, disable other fiat-rate sources for now * enforce user-configured max-fee-rate value properly * revert inconsistent change * improve trade validation (keep it powerful, but not intrusive) * have pprof on by default * refuse to use any other rate than wallet-provided * (refactor) refuse to use any other rate than wallet-provided * revert last commit since not every wallet is a FeeRater we still have to fall back to other rate-sources occasionally * update fiat rates more frequently (note, this works with Binance rate source only since other sources have strict rate limits) * btc: better differentiate between transaction types when identifying unknown transaction * align btc implementation with zec * rework slippage warning * mm bot shouldn't rely on Bison book being present (use oracle/fiat rate only as reference point) * fix typo in trade-validation code that results into panic * ui: markets page rework (#25) * ui: markets page rework (mainly order-form) * fix rate conversion(s), get rid of swap options views (and rework showVerify), get rid of translations as unnecessary burden * fix decimal number inputs (getting rid of number in favor of text + additional js validation) * turn off selection history for order-forms * handle balance update notes properly * rework market list * minor visual adjustments (margins and such) * add reference fiat rate in orange * move order-forms under candle chart * fix scaling with browser zoom * fix total calculation for buy/sell forms * order-form: resolve some edge-cases around invalid inputs * refactor number parsing for rate/qty fields, allow for comma * rework active orders section to only show active/relevant orders * order-form: optimize buy/sell buttons * refactor out unnecessary delay param * rework slider to make it more vibrant, general order form improvements & bug fixes (element alignment and such) * markets: shrink header a bit, limit order book-side size to 14 so we don't have to scroll UI * improve rate/qty fields parsing * improve slider handling * markets: adding order to book-side should be smooth * markets: rework header, rework spot-price display * minor sell slider fix * minor markets-header adjustments * markets: misc adjustments (mostly header) * order-form default price should be best buy/sell (not mid-gap) * form-label should not affect cursor * rework market header (mostly to simplify code involved), format total in/out properly, make candle-chart scaling/zooming smooth (add more zoom-levels) * get rid of redundant trading limits info, remove what's left of wallet locking in UI, adjust markets header * fix number formatting all across UI * introduce a work-around for insanely high server-configured rate-step * refactor matches table code, swap column order for more clear signal, add asset symbols to clarify what Rate/Size are * refactor qty parsing (order-form) * refactor rate/coin formatting, format qty to lot size (in order-book, matches table) * reverse rate/qty columns in order-book to make qty easier to read * use precise to-lot formatting where it makes sense * rework order-book to highlight order relevance (based on quantity and price) * fix typo/bug with converting floating-point numbers to atomic numbers (which are always integers) * (when formatting decimals in UI) don't show comma since it's confusing when combined with decimal dot * candle chart refactoring/adjustments (mostly related to making scrolling smooth, adjusting paddings, and moving price labels to a separate column on the right); plus minor bug fixes unrelated to candle chart * candle-chart: make scrolling smoother * fix forms formatting * candle-chart: fixes & adjustments (proper life-cycle handling) * variuos adjustments to make things pretty * re-arrange stats on market header (mostly around bison/fiat price), fix the way candles/market is loaded * markets: remove order-acceleration functionality since it doesn't belong on this page (we can accelerate on order-view if necessary), add a bunch of missing await calls * add tooltips for bison/external prices, display external price on the order-book as well * use defined constant instead of hardcoded value (for colors), make MM overview view background distinct from created bot configurations * order-form: make use of change handler for price/qty inputs to address some quirks of current implementation * minor adjustments * handle edge-case related to user order still showing in UI but no longer being relevant (eg. order in submitting status) * adjust the way candlesLoaded notification gets handled in UI to make it fully symmetric * matches table - update Age column to be a timestamp in hh-mm-ss format (for simpler readability) and only show recent (24h in the past) matches; also rework order-book mid-section * use more compact date-time for display on candle chart (when candle is hovered) * rework market page UI colors, minor mics adjustments * update the way order-book looks, add % delta relative to external price * remove last match data from order-book to keep it clean and simple * order-book: periodically update price delta(s) * cut margins for date-time displayed on candle chart (when candle is hovered), adjust profit threshold * display negative price delta with opposite color to make it clearly visible in UI * refactor code around recent matches & open orders (called active orders previously); add completed orders views (and extend order filtering API to support the use-case of fetching truly relevant orders); format quantities on open/completed views to lot size; finally, minor adjustments to relevant html/css have been made * update OrderReader.StatusString func to correspond to what we have in JS * properly count/display total/locked wallet balances * fix incorrect fee displayed in UI for user-prompt action to bump fees (also display fiat rate alongside); improve the way stuck EVM transactions are handled so that fee-bumps actually work; respects user-configured MaxFee estimate for redeems * mm: enforce oracle/fiat price confluence, add USDT-derived oracle markets, bump HTTP response read limit to allow for fetching oracle rates (for certain markets the amount of data to fetch is just higher) * fix 1d on completed history view, don't show active orders in completed history (these are shown in open orders section) * make duration labels on Candle chart less distracting (by setting opacity below 1) * improve the way immediate-match warning works, prevent MM bot from placing immediately matching orders (as a safety precaution) * mics improvements (mostly adding await & adjusting font sizes), adjust red/green colors on markets page, use Binance-like own order market (orange dot) since it's nice and clean compared to everything else I've tried * put completed orders section right below open orders section * instrument a.sh with pprof everywhere * don't initiate swap if wallet-supported rate is too low when swap needs to happen (it's better than overpaying in fees, or initiating swap and refunding it eventually due to swap tx never being mined) * use 2x fee cap (wallet configuration setting) for Swap transaction type since it's under sever time limit for trade to execute successfully * adjust the way wallets handle fees (swap, max cap, etc.) * filter out inactive orders (open orders section) * set reasonable default fee cap for ETH and POL wallets * adjust wallet readiness checks on buy/sell order forms * increase EVM providers request timeouts so we can better tolerate temporary networking delays (also reducing user notifications spam) * markets page, cancelling order should happen immediately without additional popup * use age instead of time column for recent matches (since time is hard to make sense of when matches aren't happening constantly all the time), but format it slightly differently from how it was * minor fixes & adjustments * update README to describe how this project is different from upstream, as well as how to build & run it from source code * increase eth/pol timeouts some more * add make l - a shortcut for make run * fix typo in buy/sell order form event handlers * adjust font size for fiat rate in the header (markets page) * improve the way order buy/sell forms are initialized (also handling un-synced wallets better) * wallets: better fit for fee estimates * core: initialize with retries (tolerating failure to connect to DEX server on startup on the very first try) * poke notes: remove redundant info * wallets: make sense of fiat price displayed on wallets view * slider adjustments to account for some edge cases
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a port of decred#2043 onto the latest master of https://github.com/norwnd/dcrdex,
but really it's a full rework of
/markets
page (with major code refactoring) because additionally this PR implements order-form even further:but also makes a bunch of changes like:
input
HTML elements (especially those related to type/nodeTypenumber
that results into number changing - which is almost always undesirable behavior to have)