Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

fix: updated liquidity of compound borrow contract position helper #566

Merged
merged 2 commits into from
Jun 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ export class CompoundBorrowContractPositionHelper {
const underlyingPrice = appToken.tokens[0].price;
// Liquidity is the total supply of "cash" multiplied by the price of an underlying token
const borrowedPositionliquidity = cashSupply * underlyingPrice;
const borrowLiquidity = underlyingLiquidity - borrowedPositionliquidity;

const dataProps = {
...appToken.dataProps,
liquidity: borrowedPositionliquidity,
liquidity: -borrowLiquidity,
supply: underlyingLiquidity,
// The amount borrowed can be derived simply by substracting the liquidity from the total supply
// of tokens
borrow: underlyingLiquidity - borrowedPositionliquidity,
borrow: borrowLiquidity,
};
const borrowApy = appToken.dataProps.borrowApy;

Expand Down