01-15-2019, 11:23 PM
(This post was last modified: 01-16-2019, 03:42 PM by crypto49er.)
Hey Mark,
I did notice from your Pastebin that you're using Kraken. It's unfortunate Kraken isn't available where I live (NY), so I can't test this.
I did run this multiple times in Coinbase Pro and was able to get the "rejected" error every time. Although I thought it was pointless to constantly get this error and that's why I ended up modifying the test code to trigger the "rejected" error only if it didn't get the error previously. This is what I modified in sticky.js.
I also modified the ticker.ask section similarly.
***I changed the price difference from 0.03 to 10% to account for trade pairs that have a larger spread than 0.03.***
I'm not sure if this modification has any affect on the implicit string conversion that you mentioned. But I ran this in VS Code to see what is stored inside the variable and it correctly stored 4.38 instead of "4.35000001.03" as the price of ETC on Coinbase Pro is $4.35 when the trade was sent to Coinbase Pro.
The "rejected" trade response came a few seconds after.
I'm guessing Coinbase Pro sends the ticker information differently than Kraken. Maybe Kraken's ticker info is sent as a string in which case you probably have to convert it to a float, add the 0.03, then convert it back to a string so Kraken accepts the modified price. But that's all guesswork since I don't have access to Kraken.
I did notice from your Pastebin that you're using Kraken. It's unfortunate Kraken isn't available where I live (NY), so I can't test this.
I did run this multiple times in Coinbase Pro and was able to get the "rejected" error every time. Although I thought it was pointless to constantly get this error and that's why I ended up modifying the test code to trigger the "rejected" error only if it didn't get the error previously. This is what I modified in sticky.js.
Code:
if(!this.outbid) {
var moddedBid = config.IssueState.rejected ? ticker.bid : ticker.bid * 1.1;
return r(moddedBid);
}
I also modified the ticker.ask section similarly.
Code:
if(!this.outbid) {
var moddedAsk = config.IssueState.rejected ? ticker.ask : ticker.ask * 0.9;
return r(moddedAsk);
}
***I changed the price difference from 0.03 to 10% to account for trade pairs that have a larger spread than 0.03.***
I'm not sure if this modification has any affect on the implicit string conversion that you mentioned. But I ran this in VS Code to see what is stored inside the variable and it correctly stored 4.38 instead of "4.35000001.03" as the price of ETC on Coinbase Pro is $4.35 when the trade was sent to Coinbase Pro.
The "rejected" trade response came a few seconds after.
I'm guessing Coinbase Pro sends the ticker information differently than Kraken. Maybe Kraken's ticker info is sent as a string in which case you probably have to convert it to a float, add the 0.03, then convert it back to a string so Kraken accepts the modified price. But that's all guesswork since I don't have access to Kraken.
If it isn't crypto, it isn't worth mining, it isn't worth speculating.
https://www.youtube.com/c/crypto49er
https://www.youtube.com/c/crypto49er