QuantConnect / Lean.Brokerages.ByBit

ByBit Brokerage Integration to LEAN
4 stars 5 forks source link

Exception during funding when running live #7

Closed arodus closed 8 months ago

arodus commented 8 months ago

When running live and there is an open position when funding happens an exception is thrown and the algo stops. Apparently, I never had a trade open during funding when I was initially testing this brokerage 🙈

Expected Behavior

The brokerage handles the funding ws message properly.

Actual Behavior

A serialization exception is thrown cause there is no OrderType which equals UNKNOWN

Potential Solution

Add UNKNOWN to the OrderType enum and handle the funding message properly. @Martin-Molinero do we need to submit an order update when funding occurs?

Reproducing the Problem

Having an open order when funding occurs. I unfortunately don't have the exact log anymore.

Checklist

Martin-Molinero commented 8 months ago

Hey @arodus! Thanks for the report

do we need to submit an order update when funding occurs?

No 👍 believe it should be ignored for now. Any cash difference are settled daily by the cash diff