thibaultyou / tradingview-alerts-processor

Minimalist service designed to execute TradingView webhooks and process them to cryptocurrencies exchanges.
MIT License
79 stars 23 forks source link

FTX position not closed #27

Closed shimuldn closed 2 years ago

shimuldn commented 2 years ago

Log says position closed but in exchange order was cancelled. Verifying the order status filledSize is required.

Screen Shot 2021-09-13 at 9 25 05 pm Screen Shot 2021-09-13 at 9 37 12 pm
- $$$ Closing 6 SECO-PERP of open position / available balance (~ 141.07 $US).
Trade c61a4df0-xxxxxxxxxx-yyyyyyyyyyyyyyy executed in 1259 ms.
leifjones commented 2 years ago

I can't comment on the specific issue you're finding.

But, generally, I can say that, the way things are built at the moment, the "Trade [...] executed ..." message actually just means that TAP received and has begun processing the trade request. The actual processing of the trade happens asynchronously - with the result appearing in the TAP logs.

On that (tangential) point, perhaps we could make a 200 success response dependent on successful completion of trade. That would improve messaging and reduce some need to get on the server itself. @thibaultyou, are there any downsides (aside from potential refactor needs) to making this change?

thibaultyou commented 2 years ago

Hello there, as I understand the issue may be on the exchange side since the tool ensure that the market order is processed.

Seeing that log in the tool is the proof that the exchange returned a success response for this order.

@mrsegen in order to provide the exchange response to the client we have to reconsider using the actual order queue which will break the current async process.

leifjones commented 2 years ago

@thibaultyou That makes sense. Would it make sense to maybe replace "trade has been executed" with "traded has been queued"?