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

exp/ticker: create an orderbook scraper to compute stats #1089

Closed
7 tasks done
accordeiro opened this issue Apr 2, 2019 · 2 comments · Fixed by #1193
Closed
7 tasks done

exp/ticker: create an orderbook scraper to compute stats #1089

accordeiro opened this issue Apr 2, 2019 · 2 comments · Fixed by #1193
Assignees

Comments

@accordeiro
Copy link
Member

accordeiro commented Apr 2, 2019

Create a script that scrapes orderbooks to compute spreads and other stats.

Tasks:

  • Adapt db models
  • Create scripts
  • Write tests
  • Adapt the market data aggregator to also include the stats
  • Adapt the JSON exporter to also provide the computed stats on markets.json
  • Add GraphQL support
  • Add cron job to refresh orderbook stats
@accordeiro accordeiro changed the title services/ticker: create an orderbook scraper to compute stats exp/ticker: create an orderbook scraper to compute stats Apr 5, 2019
@accordeiro accordeiro self-assigned this Apr 10, 2019
@accordeiro accordeiro added ticker and removed ticker labels Apr 10, 2019
@accordeiro
Copy link
Member Author

Closing this, as the functionality would be identical to what is already provided by the Horizon Orderbook Details Endpoint [CC @tomquisel].

@tomquisel
Copy link
Contributor

@accordeiro I think the idea of this scraper is to add orderbook stats to the ticker, so a site can quickly look at the spreads on all markets without making many requests to the Horizon orderbook endpoint.

In the StellarX GraphQL schema, the OrderBookStats struct is included for each market:

type OrderbookStats {
  nBids: Int!
  bidVolume: String!
  bidMax: String!
  nAsks: Int!
  askVolume: String!
  askMin: String!
  spread: String
  spreadMidPoint: String
}

I think you can provide all this information even in markets.json, but you'd have to be clever about aggregating across markets since bidMax and askMin could potentially cross.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants