Skip to content

Cyrpto future used margin vs maintenance margin #9242

@jhonabreul

Description

@jhonabreul

Expected Behavior

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.

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 the used/available margin.

This follows #9235

Actual Behavior

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