polkadot-cloud/polkadot-staking-dashboard

Why `fundsFree` calculation deducts `feeReserve` twice?

Closed this issue · 1 comments

https://github.com/paritytech/polkadot-staking-dashboard/blob/main/src/pages/Overview/BalanceChart.tsx#L115

let fundsReserved = planckToUnit(edReserved.plus(feeReserve), units);

  const fundsFree = planckToUnit(
    BigNumber.max(
      allTransferOptions.freeBalance
        .minus(fundsReserved)
        .minus(feeReserve)
        .minus(fundsLockedPlank),
      0
    ),
    units
  );

Looks like it deducts feeReserve twice.

fundsReserved = edReserved + feeReserve

fundsFree = freeBalance - fundsReserved - feeReserve
          = freeBalance - (edReserved + feeReserve) - feeReserve

Anyone can help me to understand why we deduct feeReserve twice?

Best regards,

Addressed in 84926a2