-
Notifications
You must be signed in to change notification settings - Fork 102
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
multi: market overview and price feed #1232
Conversation
53cc9dc
to
d67c15e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and tests well.
Will leave it up for a day for others.
} | ||
case 'spots': { | ||
const xc = this.user.exchanges[note.host] | ||
for (const [mktName, spot] of Object.entries(note.spots)) xc.markets[mktName].spot = spot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another place this can come in handy is when showing lot sizes during registration. For display purposes only, especially if they are paying their fees in a market's quote asset, we could show them a conversion based on the current price without needing to subscribe to the market order book.
If anyone else looking at this on the simnet harness, I'll note that testing is a pain because we interpret our 24 hour change from the 5-minute candles, so even if you put some action on the books immediately, it can take 5 minutes before you see a non-zero change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. My review items are resolved. Leaving open for other reviews for a day or two longer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in #1238 |
Resolves #941
Add new
price_feed
subscription. The response to the subscription request contains the spot prices for all known markets. Subscribers will then receive an update to the spot price for every market at the end of every epoch.server/market
BookRouter
handles the subscriptions. The spot price is passed byMarket
as part of thesigDataEpochReport
. It was already being generated by(*DataAPI).ReportEpoch
, but we were discarding it.dex/candles
(*Cache).Delta
method updated to ignore leading and trailing zeros. Zeros occur when the book is empty.client/core
Subscribe to the price feed right after fetching configuration, including after reconnect. Populate the new
Market.Spot
field. Send updates as notifications.front-end
Display 24-hour percent change and current rate in the list on the left side of the markets view.