-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fix Pricing Bug when Using Default Exchange #207
Conversation
I did a quick dirty test with these code changes and believe I still see 1 week prices. |
Can you post the warning messages you are getting? When anything bigger than a 1m candle is used for pricing, warning messages should be sent to stdout. If you could post those, it might help to find the issue. |
Sure! And thanks for looking into this @macanudo527 I didn't see any WARN or WARNING logs in my log file but I did run it with LOG_LEVEL=DEBUG so I got the following DEBUG statements that maybe relevant. Note, for this test, I only let one transaction from the plugins to be sent to the transaction_resolver so that way I can control the logic easier since the list size is always one and I know what gets sent to the transaction_resolver can only be the single transaction and as such can ascertain what the values should be (i.e., spot_price). P.S. Curious could you explain what this line in the log means? If I only I have one transaction how come there are numerous logs regarding graph snapshots?
|
It makes snapshots for the week including your first transaction until the present no matter how many transactions you have.
I think this is the problem. It is attempting to pull the data from Kraken directly and bypassing the CSV reader. It's strange that it is optimizing from 2023-08-24 though. Is this a BTCUSD transaction at 2019-10-20 17:11:44+00:00 (ms 1571591504000) on Kraken? I'll spoof that transaction on my local setup and see what I can see. |
Interesting so that means from 2019-10-20 to today, it will generate weekly snapshots and add it to the AVL Tree?
Correct. I also think I saw it use Coinbase Pro's fetchOHCLV() function when I was in the debugger FYI. That diagnosis was using the code from main. |
This is what I get spoofing the transaction:
You made this transaction on Kraken, correct? Not on another exchange? It's a little hard to find, but it retrieved the 1m candle as expected. |
Is it getting confused because its BTCUSD on my end but XBTUSD on your end? |
It's BTC on my end, too. For Kraken CSV files, BTC is labeled XBT so the Kraken CSV reader has an alias built in for BTC/XBT. All logger messages for BTC from Kraken CSV will use the XBT ticker. |
@ndopencode are you having further issues? Can we review and merge this? |
I took a quick look and it seems good to me: when the tests pass I'll review it one more time. |
@eprbell Something strange is happening. These tests fail on the main branch, too. Something changed in the last week that broke fiat. I'm guessing the exchangerates.host changed format or something. I'll have to investigate. |
I have a brief break from my day job, I'll take a look at this this week! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Sorry for taking so long... I've been snowed under lately.
What?
When the default Kraken exchange was assigned to another exchange the Kraken CSV reader was not being used. This would cause prices with longer timeframes to be used for prices further in the past.
This PR fixes that bug and prevents double instantiation of the CSV reader.
Also included in this PR are some minor formatting fixes to previously submitted code.