From 84468ed8ffa8d9a0b0d0efc04bdd5a82c2ae080e Mon Sep 17 00:00:00 2001 From: Ed Noepel Date: Fri, 28 Apr 2023 07:51:29 -0400 Subject: [PATCH 1/3] fix for div/0 error updating TP after repayment/pull --- src/utils/common.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; + } } From 0b0240021927d93135fa522ae9020dbb51ca7f9e Mon Sep 17 00:00:00 2001 From: Ed Noepel Date: Fri, 28 Apr 2023 07:57:34 -0400 Subject: [PATCH 2/3] prevent deployment from syncing all blocks on chain --- subgraph.yaml | 1 + 1 file changed, 1 insertion(+) 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 From 6cf319d69804a9b57d309444fe7dd4c9d5f84b60 Mon Sep 17 00:00:00 2001 From: Ed Noepel Date: Fri, 28 Apr 2023 08:48:13 -0400 Subject: [PATCH 3/3] refresh environment when recreating container --- clean.sh => clean-container.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename clean.sh => clean-container.sh (53%) 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