-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Expected Behavior
Margin call models for crypto future should account for the collateral currency only. For instance, in Binance, margin is calculated separately for each currency available.
Also, we need lean to be able to model margin as crypto exchanges do. There is a difference between the used/available margin and the maintenance margin.
In Binance and Bybit, for instance, the initial margin requirement is the position's used margin and it's deducted from the available margin. The maintenance margin is account wise and has nothing to do with margin used/available.
This is following #9235
Actual Behavior
The default margin call model accounts for the whole portfolio value. See the CryptoFutureMarginModel initial margin calculations.
And Lean uses the maintenance margin to calculate used and remaining margin, which is not accurate for crypto futures.
Potential Solution
Reproducing the Problem
System Information
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- I have provided detailed steps to reproduce the issue