Skip to content

Commit

Permalink
position handling adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
piekczyk committed Aug 23, 2024
1 parent 7a016c1 commit a5a29ff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/dma-library/src/views/maker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ export async function getMakerPosition(
// cumulatives,
// }

const collateralAmount = new BigNumber(position.collateral)
const debtAmount = new BigNumber(position.normalizedDebt).times(position.ilk.rate)
const collateralAmount = position.collateral ? new BigNumber(position.collateral) : ZERO
const debtAmount = position.normalizedDebt
? new BigNumber(position.normalizedDebt).times(position.ilk.rate)
: ZERO
const rate = new BigNumber(Number(position.ilk.stabilityFee) - 1)

return new MakerPosition(
proxyAddress,
Expand All @@ -111,7 +114,7 @@ export async function getMakerPosition(
osmNextCollateralPriceUSD,
quotePriceUSD,
osmCurrentCollateralPriceUSD.div(quotePriceUSD),
new BigNumber(Number(position.ilk.stabilityFee) - 1),
rate,
{
withFees: ZERO,
withoutFees: ZERO,
Expand Down

0 comments on commit a5a29ff

Please sign in to comment.