Skip to content

Incorrect liquidation price calculation #6

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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