Different pairs have the same folder name that could lead users to trade in the wrong market
9808us opened this issue · comments
Context
Operating System: Not depending on the OS
Software version: Current SA - August 2022
Workspace version: Not depending on workspace
Reproducible: Yes
Explain your issue
1. Explain what the problem seems to be.
There are 2 different main bugs:
1) Different pairs have the same name in SA and then are saved in the same folder.
Consider the screenshot below:
To reproduce the issue follow these steps:
- Crypto Exchanges -> Add Centralized Exchange
- Name the new exchange FTX
- Under Exchange Asset add USD and a token, in my example is AMPL
- Under Exchange Markets -> Add Missing Markets
You will end having 2 pairs.
One pair is AMPL/USD SPOT
One pair is AMPL/USD PERPETUALS
The issue here is that if you install both market, then for SA there is no difference and user will end up trading SPOT and never PERPETUALS
2) Even if markets are correctly installed, users may trade in the wrong market
As a consequence of the previous point 1), what may happen is that a user think to trade on Perpetuals maket when in reality he's placing orders on Spot market....
Have a look at current code in SA, specifically HistoricOHLCV.js and ExchangeAPI.js.
As you can read from the code, at the moment the way SA "sends" the pair to ccxt for connection and ability to trade is in the following FIXED way:
- Pair to use = Base Asset + / + Quoted Asset
This is in contrast with the ccxt Unified API https://docs.ccxt.com/en/latest/manual.html#unified-api
So using the above pair as example, what we will have following ccxt is:
- AMPL/USD is SPOT
- AMPL/USD:USD is PERPETUAL
2. Clearly explain what you wish to accomplish.
On the exchange there can be markets that can use the same pair but for different purposes.
The issue seems to be more related to the way SA store and retrieve data from saved sessions that to ccxt that correctly identify the different markets.
SA should find a way to differentiate the folders about same pairs but with different utility.
As an example in this screesnhot I had to modify the folder name to avoid overwiting it.
In fact in the screenshot the folder "AMPL-USD" is where SPOT candles are saved, while the other renamed by me "AMPL-USD TO KEEP" is where a previous session saved PERPETUALS data. Obviously here users can't have both markets at the same time.
3. Explain, step by step, what you've done to achieve the goal. The Team will follow these steps to reproduce the issue, so be precise.
At the moment there is no solution as I'm not sure we users can modify the way SA constructs the folders to store/retrieve data.
I tried to give different names to the exchanges, i.e. install the same exchange but with a different name (not the codeName!!) but there is no change.
FINAL NOTES
Here a link to Telegram chat where I explained the bug/issue https://t.me/superalgosdevelop/17528
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.