From 428cc21c1c59950590b6770d1235ad1699d69728 Mon Sep 17 00:00:00 2001 From: Majorfi Date: Fri, 24 Nov 2023 12:58:51 +0100 Subject: [PATCH] fix: default perf fee for v3 --- data/meta/strategies/137.json | 30 ++++++++++++++--------------- data/meta/tokens/137.json | 2 +- data/meta/vaults/137.json | 36 +++++++++++++++++------------------ internal/fetcher/helper.go | 7 ++++++- 4 files changed, 40 insertions(+), 35 deletions(-) diff --git a/data/meta/strategies/137.json b/data/meta/strategies/137.json index 8cf278c1..17859c3a 100644 --- a/data/meta/strategies/137.json +++ b/data/meta/strategies/137.json @@ -1,9 +1,9 @@ { - "lastUpdate": "2023-11-22T13:04:48.940779+01:00", + "lastUpdate": "2023-11-24T12:50:44.563902+01:00", "version": { "major": 0, "minor": 1, - "patch": 4 + "patch": 8 }, "shouldRefresh": false, "strategies": { @@ -26,7 +26,7 @@ "lastPerformanceFee": "500", "lastReport": "1700336003", "lastDebtRatio": "2500", - "lastEstimatedTotalAssets": "656984402917460083437", + "lastEstimatedTotalAssets": "657028220783943094576", "isRetired": true, "displayName": "", "description": "", @@ -51,7 +51,7 @@ "lastPerformanceFee": "1000", "lastReport": "1700581296", "lastDebtRatio": "5000", - "lastEstimatedTotalAssets": "1313968800830791033895", + "lastEstimatedTotalAssets": "1314156426526262412957", "isRetired": true, "displayName": "", "description": "", @@ -76,7 +76,7 @@ "lastPerformanceFee": "1000", "lastReport": "1700581296", "lastDebtRatio": "3500", - "lastEstimatedTotalAssets": "588186985022747189", + "lastEstimatedTotalAssets": "588273988224583438", "isRetired": true, "displayName": "", "description": "", @@ -101,7 +101,7 @@ "lastPerformanceFee": "1000", "lastReport": "1700581296", "lastDebtRatio": "2500", - "lastEstimatedTotalAssets": "707154371940333735144", + "lastEstimatedTotalAssets": "708475445676647760132", "isRetired": true, "displayName": "", "description": "", @@ -126,7 +126,7 @@ "lastPerformanceFee": "1000", "lastReport": "1700581296", "lastDebtRatio": "4000", - "lastEstimatedTotalAssets": "682228791885217540", + "lastEstimatedTotalAssets": "683984278784720842", "isRetired": true, "displayName": "", "description": "", @@ -145,13 +145,13 @@ "keepCRV": null, "keepCRVPercent": null, "keepCVX": null, - "lastTotalDebt": "5038000956", + "lastTotalDebt": "5041279649", "lastTotalLoss": "0", "lastTotalGain": "0", "lastPerformanceFee": "1000", - "lastReport": "1700412668", - "lastDebtRatio": "5000", - "lastEstimatedTotalAssets": "5118126698", + "lastReport": "1700758301", + "lastDebtRatio": "5001", + "lastEstimatedTotalAssets": "5121718190", "isRetired": true, "displayName": "", "description": "", @@ -195,13 +195,13 @@ "keepCRV": null, "keepCRVPercent": null, "keepCVX": null, - "lastTotalDebt": "5037493272", + "lastTotalDebt": "5040054844", "lastTotalLoss": "0", "lastTotalGain": "0", "lastPerformanceFee": "500", - "lastReport": "1700412642", - "lastDebtRatio": "5000", - "lastEstimatedTotalAssets": "5040887114", + "lastReport": "1700758281", + "lastDebtRatio": "4999", + "lastEstimatedTotalAssets": "5044129476", "isRetired": true, "displayName": "", "description": "", diff --git a/data/meta/tokens/137.json b/data/meta/tokens/137.json index 28319bc2..77a649f9 100644 --- a/data/meta/tokens/137.json +++ b/data/meta/tokens/137.json @@ -1,5 +1,5 @@ { - "lastUpdate": "2023-11-22T13:04:48.784614+01:00", + "lastUpdate": "2023-11-24T12:50:44.432368+01:00", "version": { "major": 0, "minor": 1, diff --git a/data/meta/vaults/137.json b/data/meta/vaults/137.json index 28c57c2d..752f6387 100644 --- a/data/meta/vaults/137.json +++ b/data/meta/vaults/137.json @@ -1,9 +1,9 @@ { - "lastUpdate": "2023-11-22T13:04:47.711224+01:00", + "lastUpdate": "2023-11-24T12:50:43.423936+01:00", "version": { "major": 0, "minor": 1, - "patch": 5 + "patch": 9 }, "shouldRefresh": false, "vaults": { @@ -20,8 +20,8 @@ "managementFee": 0, "emergencyShutdown": false, "lastActiveStrategies": [], - "lastPricePerShare": "1000000006757151678", - "lastTotalAssets": "656984402917460083437", + "lastPricePerShare": "1000033280764243459", + "lastTotalAssets": "657028220783943094576", "isRetired": false, "isHidden": false, "migration": { @@ -80,8 +80,8 @@ "managementFee": 0, "emergencyShutdown": false, "lastActiveStrategies": [], - "lastPricePerShare": "1000000000000000000", - "lastTotalAssets": "1313968800830791033895", + "lastPricePerShare": "1000019729423519543", + "lastTotalAssets": "1314156426526262412957", "isRetired": false, "isHidden": false, "migration": { @@ -140,8 +140,8 @@ "managementFee": 0, "emergencyShutdown": false, "lastActiveStrategies": [], - "lastPricePerShare": "1000000000000000000", - "lastTotalAssets": "588186985022747189", + "lastPricePerShare": "1000020325674957065", + "lastTotalAssets": "588273988224583438", "isRetired": false, "isHidden": false, "migration": { @@ -168,8 +168,8 @@ "managementFee": 0, "emergencyShutdown": false, "lastActiveStrategies": [], - "lastPricePerShare": "1001103196016140334", - "lastTotalAssets": "707154371940333735144", + "lastPricePerShare": "1002750157253569445", + "lastTotalAssets": "708475445676647760132", "isRetired": false, "isHidden": false, "migration": { @@ -196,8 +196,8 @@ "managementFee": 0, "emergencyShutdown": false, "lastActiveStrategies": [], - "lastPricePerShare": "1000116566308938822", - "lastTotalAssets": "682228791885217540", + "lastPricePerShare": "1002446048716463358", + "lastTotalAssets": "683984278784720842", "isRetired": false, "isHidden": false, "migration": { @@ -227,8 +227,8 @@ "0xdb92b89ca415c0dab40dc96e99fc411c08f20780", "0xb1403908f772e4374bb151f7c67e88761a0eb4f1" ], - "lastPricePerShare": "1002856", - "lastTotalAssets": "10075494228", + "lastPricePerShare": "1003041", + "lastTotalAssets": "10081334493", "isRetired": false, "isHidden": false, "migration": { @@ -255,8 +255,8 @@ "managementFee": 0, "emergencyShutdown": false, "lastActiveStrategies": [], - "lastPricePerShare": "1004605", - "lastTotalAssets": "5118126698", + "lastPricePerShare": "1005001", + "lastTotalAssets": "5121718190", "isRetired": false, "isHidden": false, "migration": { @@ -311,8 +311,8 @@ "managementFee": 0, "emergencyShutdown": false, "lastActiveStrategies": [], - "lastPricePerShare": "1004689", - "lastTotalAssets": "5040887114", + "lastPricePerShare": "1004968", + "lastTotalAssets": "5044129476", "isRetired": false, "isHidden": false, "migration": { diff --git a/internal/fetcher/helper.go b/internal/fetcher/helper.go index 3ea590c3..701921bf 100755 --- a/internal/fetcher/helper.go +++ b/internal/fetcher/helper.go @@ -317,7 +317,12 @@ func handleV3StrategyCalls(strat models.TStrategy, response map[string][]interfa rawPerformanceFee := response[strat.Address.Hex()+`performanceFee`] strat.LastEstimatedTotalAssets = helpers.DecodeBigInt(rawEstimatedTotalAssets) - strat.LastPerformanceFee = helpers.DecodeBigInt(rawPerformanceFee) + + if (len(rawPerformanceFee) > 0) && (len(rawStrategies) > 0) { + strat.LastPerformanceFee = helpers.DecodeBigInt(rawPerformanceFee) + } else { + strat.LastPerformanceFee = bigNumber.NewInt(1000) // Default to 1000, aka 10% + } strat.LastTotalDebt = bigNumber.SetInt(rawStrategies[0].(typeOfRawStrategies).CurrentDebt) strat.TimeActivated = bigNumber.SetInt(rawStrategies[0].(typeOfRawStrategies).Activation) strat.LastReport = bigNumber.SetInt(rawStrategies[0].(typeOfRawStrategies).LastReport)