Merge pull request #602 from Luis-Fernando-Molina/develop

Contribution: Guide to help users debug Exchange Raw Data when their Favorite Exchange is not Working
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-03-01 11:16:17 +01:00
commit 5816bb3cef
7 files changed
+281

No files matched your search

@@ -0,0 +1,66 @@
{
"topic": "How To Debug Exchange Raw Data Sensor Bot",
"pageNumber": "1",
"type": "Exchange Raw Data - Your Favorite Exchange Is Not Working",
"definition": {
"text": "This is not really a surprise, since there are hundreds of exchanges and if noone tried to put the one you like most to work before, it will most likely don't work with the default configuration.",
"updated": 1614590122351
},
"paragraphs": [
{
"style": "Title",
"text": "CCXT Library",
"updated": 1614590456998
},
{
"style": "Text",
"text": "CCXT is a popular open source library that acts as a gateway to exchanges API. It's goal is to standarize the access to diverse APIs so that software built using CCXT does not need to know the special dealings of each exchange. Even though it does a pretty good job, it is not perfect and there are still special configurations that needs to be applied to different exchanges."
},
{
"style": "Text",
"text": "The root of this problems is that there is no starndard at all across the industry and each exchange invents it's own way to deal with each functionality."
},
{
"style": "Link",
"text": "CCXT at Github->https://github.com/ccxt/ccxt",
"updated": 1614590739125
},
{
"style": "Title",
"text": "Tested on Binance"
},
{
"style": "Text",
"text": "Superalgos a system develops fast but it leaves to its users te fine details and setups, and this is the most common case. We testes only Binance just because it is the most popular exchange as of today. It did not work by itself with the default configuration so a special setting was done and it is at the config of the Binance Crypto Exchange node."
},
{
"style": "Subtitle",
"text": "Biance Config"
},
{
"style": "Json",
"text": "{\n \"codeName\": \"binance\",\n \"API\": [\n {\n \"method\": \"fetchTrades\",\n \"fetchType\": \"by Id\",\n \"fetchTradesMethod\": \"publicGetHistoricalTrades\",\n \"firstId\": \"f\"\n }\n ]\n}",
"updated": 1614590679126
},
{
"style": "Title",
"text": "Other Exchanges"
},
{
"style": "Text",
"text": "Over time some users tested Binanceus, which works with the same config as Binance and some other users ventured into others with unknown results. If you manage to put an exhange to work please let us know with which config so that we can move that exchange to the Tested Exchanges branch of the Crypto Ecosystem."
},
{
"style": "Title",
"text": "Getting Started"
},
{
"style": "Text",
"text": "We will assume for the rest of this guide, that you are currently at the Getting Started worksace that comes as a Plugin. If you are not, please load that workpace and close the tutorial that auto starts."
},
{
"style": "Text",
"text": ""
}
]
}
@@ -0,0 +1,67 @@
{
"topic": "How To Debug Exchange Raw Data Sensor Bot",
"pageNumber": "2",
"type": "Exchange Raw Data - Research Your Exchange",
"definition": {
"text": "Before trying to debug this Sensor Bot, you need to do some research about your favorite Exchange.",
"updated": 1614590821269
},
"paragraphs": [
{
"style": "Text",
"text": "This is what I would do and in this order:",
"updated": 1614591197910
},
{
"style": "Title",
"text": "1. Ask Developers "
},
{
"style": "Text",
"text": "Ask at the Develop Telegram Group if anyone already tried to connect to your favorite exchange. Maybe someone already tried and can save you time."
},
{
"style": "Title",
"text": "2. Check the Untested "
},
{
"style": "Text",
"text": "There is a Crypto Exchanges node called Untested at the Crypto Ecosystem which has many exchanges waiting for someone to test them. If your exchange is at that list, it is a good sign, since at least is has the features needed, like for example providing historical data in the form of OHLCVs. Believe it or not, some exchanges do not provide even this info.",
"updated": 1614591690750
},
{
"style": "Text",
"text": "Other reasons for not being there could be:"
},
{
"style": "List",
"text": "Not providing 1 minute candles (which is currently a requirement). Some exchanges starts at 5 minutes for instance)"
},
{
"style": "List",
"text": "Not providing a list of markets. This is required to let you later Install a Market.",
"updated": 1614591314612
},
{
"style": "Title",
"text": "3. Check CCXT Docs"
},
{
"style": "Text",
"text": "Look for any information there related to your favorite exchange. You will probably need to undestand also the different types of parameters you can send to CCXT in order to adapt its behaviour at the specific command of fetching OHLCVs objects.",
"updated": 1614591710131
},
{
"style": "Link",
"text": "CCXT at Github->https://github.com/ccxt/ccxt"
},
{
"style": "Title",
"text": "4. Check your Exchange Docs"
},
{
"style": "Text",
"text": "Look specifically for information related to retrieving historical data, how much data they provide, which are the limits on the amount of time you can request data, and things like this."
}
]
}
@@ -0,0 +1,16 @@
{
"topic": "How To Debug Exchange Raw Data Sensor Bot",
"pageNumber": "3",
"type": "Exchange Raw Data - Get VS Code",
"definition": {
"text": "In fact you can use any IDE you like, but if you don't have a favorite yet, we recommend you to use VS Code, which is free and open source.",
"updated": 1614591577862
},
"paragraphs": [
{
"style": "Text",
"text": "Go ahead an install VS Code.",
"updated": 1614591630235
}
]
}
@@ -0,0 +1,56 @@
{
"topic": "How To Debug Exchange Raw Data Sensor Bot",
"pageNumber": "4",
"type": "Exchange Raw Data - Locate The Sensor Bot Code",
"definition": {
"text": "Open with VS Code the Task Server Folder and inmediatelly after that, add the Projects Folder to the VS Code workspace.",
"updated": 1614591834868
},
"paragraphs": [
{
"style": "Text",
"text": "Locate within VS Code the file ",
"updated": 1614592018514
},
{
"style": "Json",
"text": "HistoricOHLCVs.js"
},
{
"style": "Text",
"text": "which can be found at this path:"
},
{
"style": "Json",
"text": "Projects\\Superalgos\\TS\\Bot-Modules\\Sensor-Bot\\Exchange-Raw-Data"
},
{
"style": "Success",
"text": "This is the single code that is executed to extract candles and volumen in 1 minute time frame from any exchange via the CCXT library. Now you can set a breakpoint anywhere in the code to start debugging from there."
},
{
"style": "Title",
"text": "Setup Crypto Exchange Node"
},
{
"style": "Text",
"text": "At this point it is a good idea to rename your workspace with something like Exchange XXX Test, so that you can come back later. You do this by changing the name of the Workspace Node."
},
{
"style": "Text",
"text": "Now you can rename the currently Binance Crypto Exchange Node with the name of your Favorite Exchange, without forgetting to edit it's config with the correct Exchange ID at the codeName property. "
},
{
"style": "Text",
"text": "The Exchange Id is the Id assigned to this exchange at the CCXT Library. Check their docs for that."
},
{
"style": "Text",
"text": ""
},
{
"style": "Text",
"text": ""
}
]
}
@@ -0,0 +1,20 @@
{
"topic": "How To Debug Exchange Raw Data Sensor Bot",
"pageNumber": "5",
"type": "Exchange Raw Data - Start Debugging",
"definition": {
"text": "The procedure to debug this sensor bot is fairly simple. Just run VS Code with your breakpoint set, go to the UI and start the Sensor Bot Task with the menu option DEBUG.",
"updated": 1614592297685
},
"paragraphs": [
{
"style": "Text",
"text": "Almost instantaneously you will see that VS Code stops at the breakpoint you set. From there you can go step by step checking any of the variable values. If you let the code to run, you will notice that a single execution will try to fetch all the missing objects since the last time it ran until present time. ",
"updated": 1614592493363
},
{
"style": "Text",
"text": "When it finishes, the Sensor Bot will go to sleep for 60 seconds and them it will try to do the same stuff again, and again. "
}
]
}
@@ -0,0 +1,16 @@
{
"topic": "How To Debug Exchange Raw Data Sensor Bot",
"pageNumber": "6",
"type": "Exchange Raw Data - Find Out Why Is Not Working",
"definition": {
"text": "With the intelligence you gathered at Exchange Raw Data - Research Your Exchange combined with the insight provided by debuging the code step by step, you might have figure out how why it is not working.",
"updated": 1614592591570
},
"paragraphs": [
{
"style": "Text",
"text": "In the process you might wat to try different configurations. For this just remember that you need to re-run the Task after any changes at the Crypto Exchange config.",
"updated": 1614593148805
}
]
}
@@ -0,0 +1,40 @@
{
"topic": "How To Debug Exchange Raw Data Sensor Bot",
"pageNumber": "7",
"type": "Exchange Raw Data - Fix The Problem",
"definition": {
"text": "At this point you will probably know if it is possible or not to extact historical information from your Favorite Exchange or not.",
"updated": 1614593270288
},
"paragraphs": [
{
"style": "Text",
"text": "If you managed to make it work, the rest of the community will be happy to learn how to do it too.",
"updated": 1614593581507
},
{
"style": "Title",
"text": "New Config"
},
{
"style": "Text",
"text": "If you found that your Favorite Exchange works with some special config, please contac the Team so that is can include that config in the next release and move the exchange to the branch of Tested exchanges."
},
{
"style": "Title",
"text": "Changes In Code"
},
{
"style": "Text",
"text": "If you managed to make it work by modifying the Sensor Bot's code, please submit a PR with your changes."
},
{
"style": "Title",
"text": "Changes in Docs"
},
{
"style": "Text",
"text": "If you found that this guide is incomplete or needed more info, please update the docs and send it as a contribution with the app.contribute command. That will help others follow this process with less pain. "
}
]
}