@aurigami/sdk 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.6.2",
2
+ "version": "0.6.4",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
package/src/SDK.ts CHANGED
@@ -239,7 +239,8 @@ export class SdkRead extends BlockchainEntityRead {
239
239
  amount: newBorrowLimit!.toFixed(DECIMAL_PRECISION),
240
240
  currency: "USD"
241
241
  },
242
- newBorrowUtilization: newBorrowValuation!.div(newBorrowLimit!).toNumber()
242
+ newBorrowUtilization: newBorrowLimit.eq(0) ? newBorrowValuation.eq(0) ? 0 : 9999.99
243
+ : newBorrowValuation!.div(newBorrowLimit!).toNumber()
243
244
  }
244
245
  }
245
246
  }
@@ -10,6 +10,7 @@ import IUniswapV2PairABI from './abis/IUniswapV2Pair.json';
10
10
  import AuriLensABI from '@aurigami/contracts/artifacts/contracts/AuriLens.sol/AuriLens.json';
11
11
  import axios from 'axios';
12
12
 
13
+ const hardcodePLYPrice = true;
13
14
  export async function fetchPriceFromCoingeckoAPI(id: string): Promise<BigNumber> {
14
15
  const price = await axios.get(
15
16
  `https://api.coingecko.com/api/v3/simple/price?ids=${id}&vs_currencies=usd`
@@ -94,6 +95,7 @@ export async function fetchUnderlyingTokensPrices(provider: providers.Provider):
94
95
  }
95
96
 
96
97
  export async function fetchPrice(address: Address, provider: providers.Provider): Promise<BigNumber> {
98
+ if (hardcodePLYPrice && isSameAddress(address, networkAddresses.tokens.PLY)) return new BigNumber(0);
97
99
  const matchingAuToken = networkAddresses.auTokens.find((auToken) => {
98
100
  return isSameAddress(auToken.underlying, address)
99
101
  });