Skip to content

ROE% Calculation Mismatch with aster.dex #66

@cj4c0b1

Description

@cj4c0b1

Issue: ROE% Calculation Mismatch with aster.dex

Description

There's a significant discrepancy in how Return on Equity (ROE%) is calculated between lik hunter and aster.dex for the same position. The ROE% in lik hunter is much lower than what's shown in aster.dex.

Position Details

  • Symbol: BNBUSDT
  • Position Size: 0.12 BNB
  • Entry Price: 1,113.75 USDT
  • Mark Price: 1,158.474 USDT
  • Leverage: 25x
  • Position Value: ~139.02 USDT (0.12 * 1,158.474)
Image Image

Observed Values

Platform PNL (USDT) ROE% Calculation Base
aster.dex +5.37 96.57% Based on margin (5.56 USDT)
lik hunter ~5.37 ~3.86% Based on position value

Analysis

  1. Dollar Amounts:

    • Both platforms show approximately the same PNL in USDT (~5.37 USDT)
  2. Percentage Calculation:

    • aster.dex (96.57%):

      • Margin = Position Value / Leverage = 139.02 / 25 = 5.56 USDT
      • ROE = (5.37 / 5.56) * 100 ≈ 96.57%
      • This is the industry standard for leveraged trading (PNL/margin)
    • lik hunter (~3.86%):

      • Appears to be calculating as (5.37 / 139.02) * 100 ≈ 3.86%
      • This is incorrect as it uses position value instead of margin

Expected Behavior

The ROE% in lik hunter should match aster.dex's calculation:

ROE% = (Unrealized PNL / Margin) * 100 = (5.37 / 5.56) * 100 ≈ 96.57%

Impact

  • Misleading ROE% could lead to incorrect risk assessment
  • Inconsistent with standard trading platform behavior
  • May cause confusion in performance evaluation

Request

  1. Update the ROE% calculation to use margin as the base (like aster.dex)
  2. Consider renaming to "ROE%" to be explicit about the calculation
  3. Add a tooltip explaining the calculation method
  4. Add tests to ensure consistency with exchange calculations

Additional Context

  • The dollar PNL amounts match between platforms
  • The issue is specifically with the percentage calculation
  • The correct calculation should use margin (position value / leverage) as the base

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions