diff --git a/src/mappings/curation.ts b/src/mappings/curation.ts index d48b9013..aab4a924 100644 --- a/src/mappings/curation.ts +++ b/src/mappings/curation.ts @@ -92,8 +92,6 @@ export function handleSignalled(event: Signalled): void { deployment.signalAmount = deployment.signalAmount.plus(event.params.signal) deployment.pricePerShare = calculatePricePerShare(deployment as SubgraphDeployment) - let curation = Curation.bind(event.address) - deployment.reserveRatio = curation.pools(event.params.subgraphDeploymentID).value1.toI32() deployment.save() // Update epoch diff --git a/src/mappings/helpers.ts b/src/mappings/helpers.ts index da467248..ac327bdc 100644 --- a/src/mappings/helpers.ts +++ b/src/mappings/helpers.ts @@ -749,7 +749,8 @@ export function calculatePricePerShare(deployment: SubgraphDeployment): BigDecim // to implement the actual sell share formula for 1 share. // reserve ratio multiplier = MAX_WEIGHT / reserveRatio = 1M (ppm) / reserveRatio - let reserveRatioMultiplier = 1000000 / deployment.reserveRatio + // HOTFIX for now, if deployment.reserveRatio -> 0, use a known previous default + let reserveRatioMultiplier = deployment.reserveRatio == 0 ? 2 : 1000000 / deployment.reserveRatio let pricePerShare = deployment.signalAmount == BigInt.fromI32(0) ? BigDecimal.fromString('0')