Skip to content

Commit

Permalink
Merge branch 'add-marginTrading-interface' of github.com:burrowHQ/bur…
Browse files Browse the repository at this point in the history
…row-cash into add-marginTrading-interface
  • Loading branch information
lq0-github committed Jan 3, 2025
2 parents 432b71a + 5bbc22a commit 2920e59
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions screens/Trading/components/ClosePositionMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,12 @@ const ClosePositionMobile: React.FC<IClosePositionMobileProps> = ({
}, [estimateData]);

const Fee = useMemo(() => {
const uahpi: any = shrinkToken((assets as any).data[item.token_p_id]?.uahpi, 18) ?? 0;
const uahpi: any =
shrinkToken((assets as any).data[item.token_d_info.token_id]?.uahpi, 18) ?? 0;
const uahpi_at_open: any = shrinkToken(marginAccountList[itemKey]?.uahpi_at_open ?? 0, 18) ?? 0;
const { debt_cap } = item;
return {
HPFee: +shrinkToken(debt_cap, decimalsD) * priceD * (uahpi * priceD - uahpi_at_open * priceD),
HPFee: +shrinkToken(debt_cap, decimalsD) * priceD * (uahpi - uahpi_at_open),
swapFee:
((estimateData?.fee ?? 0) / 10000) *
+shrinkToken(tokenInAmount || "0", assetP.metadata.decimals) *
Expand Down

0 comments on commit 2920e59

Please sign in to comment.