Rejected Sell Trades Can Lose 10% Of Your Portfolio... Or More
#3
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.

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.
[Image: attachment.php?aid=331]

The "rejected" trade response came a few seconds after.
[Image: attachment.php?aid=332]

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.


Attached Files
.png   Screen Shot 2019-01-15 at 5.57.38 PM.png (Size: 291.93 KB / Downloads: 162)
.png   Screen Shot 2019-01-15 at 5.58.03 PM.png (Size: 284.69 KB / Downloads: 160)
If it isn't crypto, it isn't worth mining, it isn't worth speculating.
https://www.youtube.com/c/crypto49er
  Reply


Messages In This Thread
RE: Rejected Sell Trades Can Lose 10% Of Your Portfolio... Or More - by crypto49er - 01-15-2019, 11:23 PM

Forum Jump:


Users browsing this thread: