Skip to content

Crypto futures margin call account for quote currency #9241

@jhonabreul

Description

@jhonabreul

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.

Image Image

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 master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions