Author Topic: Is there an easy way to get all the tickers for all assets with just one call?  (Read 778 times)

0 Members and 1 Guest are viewing this topic.

Offline btswolf

I'm trying to get BitShares listed on http://www.exchangewar.info but need some technical assistance for the admin there.

"I was looking into the API and it's confusing:
http://docs.bitshares.org/api/
For example, to get all assets, I'd use get_assets, but it's limited to 100 assets. Is there an easy way to get all the tickers for all assets with just one call?"

https://disqus.com/home/discussion/exchangewar/exchange_war_list_of_crypto_exchanges_60/#comment-3331130193

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12914
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Is there an easy way to get all the tickers for all assets with just one call?"
Erm, an asset doesn't not have a ticker. A market does and requires TWO assets to be paired. with N assets available, you'd end up with N * N-1 pairs/markets.
Since that "doesn't scale", such a call isn't available (it would literally eat all the resources of the backend server).
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline fluxer555

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
The number of pairs with non-empty orderbooks is, in practice, a small fraction of N * N-1, right? What does an efficient implementation of finding all non-empty orderbooks that include a single symbol look like?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12914
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
The number of pairs with non-empty orderbooks is, in practice, a small fraction of N * N-1, right? What does an efficient implementation of finding all non-empty orderbooks that include a single symbol look like?
You'd need to go through all (open or filled) orders and sort them into the markets accordingly. With that, you build a list of 'active' markets.
However, that thing potentially grows quickly aswell ...
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH