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

Get listed on nomics.com #16

Closed
sschiessl-bcp opened this issue Jul 23, 2019 · 21 comments
Closed

Get listed on nomics.com #16

sschiessl-bcp opened this issue Jul 23, 2019 · 21 comments
Labels
contacted Message has been sent to the party in question.

Comments

@sschiessl-bcp
Copy link
Collaborator

@sschiessl-bcp sschiessl-bcp added the contacted Message has been sent to the party in question. label Jul 23, 2019
@sschiessl-bcp
Copy link
Collaborator Author

A bit about our integration program may be found here: nomicsintegration.com

Our spec may be found here: https://github.com/nomics-crypto/nomics-platform/blob/master/doc/cryptocurrency-api-exchange-integration.md

@oxarbitrage
Copy link
Member

I am sorry to insist with the same but i think this can be done in the context of https://github.com/bitshares/bitshares-explorer-api by providing optional dedicated endpoints. For example someone having the api explorer:

https://explorer.bitshares-kibana.info/apidocs/

already haves dedicated ES functions like:
https://explorer.bitshares-kibana.info/es/is_alive

Additionally in this case we can have dedicated optional endpoints to serve nomics like:
https://explorer.bitshares-kibana.info/nomics/info
https://explorer.bitshares-kibana.info/nomics/markets
...

I think is our faster way to get started with this integrations while we bump a tool that was created for the purpose instead of making separated integrations with different technologies for it.

Bitshares Explorer api is mainly python, pretty easy to work with once you understand how the stuff is organized, it is not only me who haves knowledgable in the subject but also @Zapata (bitshares witness) that had collaborated massively and i am sure he will like to do more.

Bitshares explorer connects to ES to get some results however the ES server can be remote or bitshares-eplorer-api can work without those ES calls and just use a normal node, what i mean is that ES is not an impediment anymore to run bitshares-explorer-api as public ES servers can be used for the purpose.

I think the same should be done for CMC and others #12

If we go forward that way, i think we should open an issue to add the nomics calls here:
https://github.com/bitshares/bitshares-explorer-api/issues

@sschiessl-bcp
Copy link
Collaborator Author

I am sorry to insist

Don't be sorry. Did anyone say it won't be in there? I am mainly waiting to hear back from nomics on couple detail questions on the API, then I would have pinged you. If you want, please go ahead and integrate this API. Changes would be marginal if any derived from feedback

@sschiessl-bcp
Copy link
Collaborator Author

@oxarbitrage
Copy link
Member

oxarbitrage commented Aug 9, 2019

I created a pull request and updated the current code so we can go over it, there a few issues to solve/ask.

http://185.208.208.184:5001/apidocs/#/nomics

First, the typical node will save just 3 days of trade data.

Second, the way they want the trades to be sorted and the functionality of the since field(https://github.com/nomics-crypto/nomics-platform/blob/master/doc/cryptocurrency-api-exchange-integration.md#trades---historical-executed-trades---preferred) make this hard to achieve our side to use good use of node api calls(get_trade_history and get_trade_history_by_sequence) in order to iterate the trades nicely and with high performance.

So right now the /nomics/trades endpoint will get all trades available for the market each, not a big deal in the case of USD_BTS as there are around 500 trades in the last 3 days but it will take more time in the case of http://185.208.208.184:5001/nomics/trades?market=CNY_BTS

Cache was added to the trades call so it will help but it can be an issue if they present this data in real time to the user.

Open for comments. Thanks.

@sschiessl-bcp
Copy link
Collaborator Author

On markets:

Zapata was nice to make this for me
https://bitshares-kibana.info/app/kibana#/visualize/edit/fdbface0-b6f9-11e9-9920-939380b0fe7b?_g=(refreshInterval%3A(display%3AOff%2Cpause%3A!f%2Cvalue%3A0)%2Ctime%3A(from%3Anow-4h%2Cmode%3Aquick%2Cto%3Anow))

How is the behavior of the node regarding same market? Is BTS/CNY CNY/BTS grouped?

@sschiessl-bcp
Copy link
Collaborator Author

On the pagination:

What kind of pagination could we offer that is inline with our backend nodes?

@oxarbitrage
Copy link
Member

What kind of pagination could we offer that is inline with our backend nodes?

Our pagination is backwards from what they want. The sequence number we use in get_trade_history_by_sequence is to get that number and below while they need a pagination from that number and above.

We iterate the trades from the last trade and go back, they need the iteration to get the most older trades first and go up in time with the since field.

@sschiessl-bcp
Copy link
Collaborator Author

What kind of pagination could we offer that is inline with our backend nodes?

Our pagination is backwards from what they want. The sequence number we use in get_trade_history_by_sequence is to get that number and below while they need a pagination from that number and above.

We iterate the trades from the last trade and go back, they need the iteration to get the most older trades first and go up in time with the since field.

Would that be a problem is we use ES for that query? Would be preferable anyways because then we have access to the full trade history?

@oxarbitrage
Copy link
Member

Would that be a problem is we use ES for that query? Would be preferable anyways because then we have access to the full trade history?

The approach with ES will be totally different, we dont have trade data so we need to go over the fill orders. Still, it will just be a matter to do the right ES queries. We should not have performance or pagination issues with ES.

@oxarbitrage
Copy link
Member

How is the behavior of the node regarding same market? Is BTS/CNY CNY/BTS grouped?

They are grouped. The get_top_markets use the market_ticker_objects where the base and the quote are always in the same order: https://github.com/bitshares/bitshares-core/blob/master/libraries/plugins/market_history/market_history_plugin.cpp#L96

@Zapata
Copy link
Member

Zapata commented Aug 9, 2019

Open for comments. Thanks.

My comments are in the pull request.

@oxarbitrage
Copy link
Member

oxarbitrage commented Aug 9, 2019

Updated live version with the last commits(http://185.208.208.184:5001/apidocs/#!/nomics/api_nomics_info). By now some better data added to info and change of the market ids from _ to - as suggested.

@sschiessl-bcp
Copy link
Collaborator Author

Should we offer an API with full history, or start with the normal market history that a node provides?

@oxarbitrage
Copy link
Member

oxarbitrage commented Aug 26, 2019

I updated the trades call to get full history from ES. Please point nomics people to http://185.208.208.184:5001/apidocs/#/nomics for testing.

Thank you.

@sschiessl-bcp
Copy link
Collaborator Author

Forwarded

@oxarbitrage
Copy link
Member

Thank you @sschiessl-bcp

@sschiessl-bcp and I are in a telegram group with nomics for integration. We had to make a few small changes to what we have, mainly some type responses issues that should be numbers/string at some cases and that we had wrong. Easy stuff.

But the most significant change is in the market calls. I hardcoded the markets we are displaying into just a few to keep moving the integration but we are not limited to just this:

        {"id": "CNY-BTS", "base": "CNY", "quote": "BTS"},
        {"id": "USD-BTS", "base": "USD", "quote": "BTS"},
        {"id": "CNY-USD", "base": "CNY", "quote": "USD"},
        {"id": "EUR-BTS", "base": "EUR", "quote": "BTS"},
        {"id": "RUBLE-BTS", "base": "RUBLE", "quote": "BTS"},
        {"id": "SILVER-BTS", "base": "SILVER", "quote": "BTS"},
        {"id": "GOLD-BTS", "base": "GOLD", "quote": "BTS"}

The problem is they consider for example OPEN.BTC/BTS, BRIDGE.BTC/BTS, GDEX.BTC/BTS, etc to be the same market while in bitshares they are different.

We can display this markets, but only 1, they will remove the prefix, so for example for bitcoin we maybe use OPEN.BTC/BTS but BRIDGE.LTC/BTS for litecoin.

This haves to be discussed and decided(what gateway we use for each coin we want to show in nomics website).

I hardcoded the markets as i think it will be the easier, added just a few markets with smart assets that we know and want to be there but more markets should be added to the list.
Integration of new added markets is automatic so it is our decision to show the pairs we want only considering there can not be what they consider duplicates.

@sschiessl-bcp
Copy link
Collaborator Author

sschiessl-bcp commented Sep 6, 2019

@oxarbitrage completed the integration (awesome, and thanks!), and nomics has validated it already.

@dls-cipher can you please make the nomics endpoints of https://explorer.bitshares-kibana.info/apidocs/#/ available under api.bitshares.org (or similar name)? Such that I can do api.bitshares.org/nomics/info and such

Once the infrastructure ES cluster is synced, we can install the bitshares explorer api as well and use them for the domain to not overload Alfredo's server

@sschiessl-bcp
Copy link
Collaborator Author

@abitmore
Copy link
Member

abitmore commented Oct 31, 2019

Is there a summary about what APIs we have provided to nomics? Are they using our public API endpoints, or have their own nodes and API nodes?

I'd like to have a document listing all typical APIs which are interested by similar platforms to guide other platforms to add us. The https://explorer.bitshares-kibana.info/apidocs/#/ site is huge, but with no description, doesn't help much for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contacted Message has been sent to the party in question.
Projects
None yet
Development

No branches or pull requests

4 participants