Skip to content

Incorrect liquidation price calculation #6

@Drizzle210

Description

@Drizzle210
  1. Wrong floatSide in correction calculation
    LiquidationPx.tsx#L182

floatSide should be derived from the updated position, not the old one:

const floatSide = updatedPosSideFloat;

  1. AccountValue should be isolated margin LiquidationPx.tsx#L186

For isolated positions, AccountValue should be the isolated margin per docs.

Using rawUsd is incorrect because it's still mark-price dependent

This can be simplified to:

const isolatedMargin = totalNtlPos / leverage.value;

Please let me know if im mistaken!

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