diff --git a/clean.sh b/clean-container.sh similarity index 53% rename from clean.sh rename to clean-container.sh index cbfb2f7..379ab97 100755 --- a/clean.sh +++ b/clean-container.sh @@ -1,5 +1,5 @@ #!/bin/bash docker-compose down -v -rm -rf build sudo rm -rf data -rm -rf generated \ No newline at end of file +source .env +docker-compose up --force-recreate \ No newline at end of file diff --git a/src/utils/common.ts b/src/utils/common.ts index 89a8413..f771613 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -38,5 +38,9 @@ export function collateralizationAtLup(debt: BigDecimal, collateral: BigDecimal, } export function thresholdPrice(debt: BigDecimal, collateral: BigDecimal): BigDecimal { - return debt.div(collateral) + if (collateral > ZERO_BD) { + return debt.div(collateral) + } else { + return ZERO_BD; + } } diff --git a/subgraph.yaml b/subgraph.yaml index e7d10c8..a836eb9 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -135,6 +135,7 @@ dataSources: source: address: "0xaeB91e664A49829FaBf06BE35d4447938d83A271" abi: GrantFund + startBlock: 8613513 mapping: kind: ethereum/events apiVersion: 0.0.7