Skip to content

Commit a6a5bc0

Browse files
committed
fix: base
1 parent f3e23c5 commit a6a5bc0

File tree

6 files changed

+34
-46
lines changed

6 files changed

+34
-46
lines changed

common/bigNumber/float.go

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package bigNumber
33
import (
44
"encoding/json"
55
"fmt"
6+
"math"
67
"math/big"
78
)
89

@@ -421,6 +422,9 @@ func (b *Float) MarshalJSON() ([]byte, error) {
421422
if b == nil {
422423
return json.Marshal(big.NewFloat(0).String())
423424
}
425+
if b.IsInf() {
426+
return json.Marshal(math.MaxFloat64)
427+
}
424428
toFloat64, _ := b.Float64()
425429
return json.Marshal(toFloat64)
426430
}
@@ -441,6 +445,10 @@ func (b *Float) UnmarshalJSON(p []byte) error {
441445
if !ok {
442446
return fmt.Errorf("not a valid big integer: %s", p)
443447
}
448+
if z.IsInf() {
449+
b.Float = *big.NewFloat(math.MaxFloat64)
450+
return nil
451+
}
444452
b.Float = z
445453
return nil
446454
}

data/meta/strategies/8453.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"lastUpdate": "2025-04-10T14:53:35.902199+02:00",
2+
"lastUpdate": "2025-04-10T15:19:14.139682+02:00",
33
"version": {
44
"major": 0,
55
"minor": 79,
6-
"patch": 181
6+
"patch": 289
77
},
88
"shouldRefresh": false,
99
"strategies": {
@@ -786,7 +786,7 @@
786786
"lastPerformanceFee": "1000",
787787
"lastReport": "1744054503",
788788
"lastDebtRatio": "10000",
789-
"netAPR": 0.05188344499782449,
789+
"netAPR": 0.05181480145663997,
790790
"aprType": "forward",
791791
"protocols": null
792792
},
@@ -1461,7 +1461,7 @@
14611461
"lastPerformanceFee": "1000",
14621462
"lastReport": "1744206281",
14631463
"lastDebtRatio": "2101",
1464-
"netAPR": 0.005418516747512925,
1464+
"netAPR": 0.005418518273958561,
14651465
"aprType": "forward",
14661466
"protocols": null
14671467
},
@@ -1704,7 +1704,7 @@
17041704
"lastPerformanceFee": "1000",
17051705
"lastReport": "1744237503",
17061706
"lastDebtRatio": "5003",
1707-
"netAPR": 0.04790197205768454,
1707+
"netAPR": 0.04906744875350366,
17081708
"aprType": "forward",
17091709
"protocols": null
17101710
},
@@ -1839,7 +1839,7 @@
18391839
"lastPerformanceFee": "0",
18401840
"lastReport": "1743516603",
18411841
"lastDebtRatio": "5000",
1842-
"netAPR": 0.05130433431923542,
1842+
"netAPR": 0.05130446310310788,
18431843
"aprType": "forward",
18441844
"protocols": null
18451845
},
@@ -1947,7 +1947,7 @@
19471947
"lastPerformanceFee": "0",
19481948
"lastReport": "1744237491",
19491949
"lastDebtRatio": "4997",
1950-
"netAPR": 0.05130433431923542,
1950+
"netAPR": 0.05130446310310788,
19511951
"aprType": "forward",
19521952
"protocols": null
19531953
},

data/meta/tokens/8453.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"lastUpdate": "2025-04-10T14:53:31.970709+02:00",
2+
"lastUpdate": "2025-04-10T15:19:13.660287+02:00",
33
"version": {
44
"major": 0,
55
"minor": 24,

data/meta/vaults/8453.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"lastUpdate": "2025-04-10T14:53:26.332376+02:00",
2+
"lastUpdate": "2025-04-10T15:19:10.036541+02:00",
33
"version": {
44
"major": 1,
55
"minor": 44,
6-
"patch": 250
6+
"patch": 348
77
},
88
"shouldRefresh": false,
99
"vaults": {
@@ -90,7 +90,7 @@
9090
"managementFee": 0,
9191
"emergencyShutdown": false,
9292
"lastActiveStrategies": [],
93-
"lastPricePerShare": "102130006",
93+
"lastPricePerShare": "102130085",
9494
"lastTotalAssets": "50190424",
9595
"metadata": {
9696
"isRetired": false,
@@ -1476,7 +1476,7 @@
14761476
"lastActiveStrategies": [
14771477
"0x4161255639d94ee0a1d4c27fe0f863293f6a9798"
14781478
],
1479-
"lastPricePerShare": "1485703706796590678",
1479+
"lastPricePerShare": "1485707977435061224",
14801480
"lastTotalAssets": "619186012870016298419589",
14811481
"metadata": {
14821482
"isRetired": false,
@@ -1617,7 +1617,7 @@
16171617
"0x7c0fa3905b38d44c0f29150fd61f182d1e097ec2",
16181618
"0x8436027a799ac6c8b512e68b4d3852217c63647d"
16191619
],
1620-
"lastPricePerShare": "1019607838087780129",
1620+
"lastPricePerShare": "1019609330805999174",
16211621
"lastTotalAssets": "35017101257941212",
16221622
"metadata": {
16231623
"isRetired": false,
@@ -1965,7 +1965,7 @@
19651965
"0x5f6511489c9e770a07fb1ae2969abe350a3d2cf4",
19661966
"0x4b5c90dc6bc08a10a24487726e614e9d148362e1"
19671967
],
1968-
"lastPricePerShare": "1086755",
1968+
"lastPricePerShare": "1089475",
19691969
"lastTotalAssets": "702069",
19701970
"metadata": {
19711971
"isRetired": false,
@@ -2173,7 +2173,7 @@
21732173
"lastActiveStrategies": [
21742174
"0x81bdd5e8fbde5a85a2d38761d03d2307fe69a329"
21752175
],
2176-
"lastPricePerShare": "1001124037457768173",
2176+
"lastPricePerShare": "1001124042551634581",
21772177
"lastTotalAssets": "47667339946790407",
21782178
"metadata": {
21792179
"isRetired": false,
@@ -2720,7 +2720,7 @@
27202720
"managementFee": 0,
27212721
"emergencyShutdown": false,
27222722
"lastActiveStrategies": [],
2723-
"lastPricePerShare": "1027551568686440526",
2723+
"lastPricePerShare": "1027553828481746301",
27242724
"lastTotalAssets": "50863147397658117793",
27252725
"metadata": {
27262726
"isRetired": false,
@@ -3677,7 +3677,7 @@
36773677
"managementFee": 0,
36783678
"emergencyShutdown": false,
36793679
"lastActiveStrategies": [],
3680-
"lastPricePerShare": "1020051",
3680+
"lastPricePerShare": "1020053",
36813681
"lastTotalAssets": "5688245891",
36823682
"metadata": {
36833683
"isRetired": false,
@@ -3818,7 +3818,7 @@
38183818
"0xdd120ded7c1c9e4978f92847bcb24847a9dbb071",
38193819
"0xd89a4f020c8d256a2a4b0dc40b36ee0b27680776"
38203820
],
3821-
"lastPricePerShare": "1009780180007351272",
3821+
"lastPricePerShare": "1009780267325835664",
38223822
"lastTotalAssets": "43183844734102496",
38233823
"metadata": {
38243824
"isRetired": false,
@@ -4648,7 +4648,7 @@
46484648
"0x945df73d55557ea23c0c35cd350d8de3b745287e",
46494649
"0x0ace53f57a14acfd4d43c7d4c46be4b4a5347eff"
46504650
],
4651-
"lastPricePerShare": "1017150",
4651+
"lastPricePerShare": "1017151",
46524652
"lastTotalAssets": "214889698",
46534653
"metadata": {
46544654
"isRetired": false,
@@ -4789,7 +4789,7 @@
47894789
"0xe9f2a5f9f3c846f29066d7fb3564f8e6b6b2d65b",
47904790
"0xd5428b889621eee8060fc105aa0ab0fa2e344468"
47914791
],
4792-
"lastPricePerShare": "1000809",
4792+
"lastPricePerShare": "1000813",
47934793
"lastTotalAssets": "50797751",
47944794
"metadata": {
47954795
"isRetired": false,
@@ -4856,7 +4856,7 @@
48564856
"managementFee": 0,
48574857
"emergencyShutdown": false,
48584858
"lastActiveStrategies": [],
4859-
"lastPricePerShare": "1052664",
4859+
"lastPricePerShare": "1052668",
48604860
"lastTotalAssets": "21735050662",
48614861
"metadata": {
48624862
"isRetired": false,
@@ -4926,7 +4926,7 @@
49264926
"lastActiveStrategies": [
49274927
"0xb3f14e3fda2147fa7574fd003ba40df266e0b90c"
49284928
],
4929-
"lastPricePerShare": "1005652",
4929+
"lastPricePerShare": "1005653",
49304930
"lastTotalAssets": "17835337",
49314931
"metadata": {
49324932
"isRetired": false,
@@ -4993,7 +4993,7 @@
49934993
"managementFee": 0,
49944994
"emergencyShutdown": false,
49954995
"lastActiveStrategies": [],
4996-
"lastPricePerShare": "1011763282781059036",
4996+
"lastPricePerShare": "1011763419348393313",
49974997
"lastTotalAssets": "30700345628337992",
49984998
"metadata": {
49994999
"isRetired": false,
@@ -5264,7 +5264,7 @@
52645264
"managementFee": 0,
52655265
"emergencyShutdown": false,
52665266
"lastActiveStrategies": [],
5267-
"lastPricePerShare": "1653145947816692707",
5267+
"lastPricePerShare": "1653437339639597642",
52685268
"lastTotalAssets": "514918011242083",
52695269
"metadata": {
52705270
"isRetired": false,
@@ -5537,7 +5537,7 @@
55375537
"managementFee": 0,
55385538
"emergencyShutdown": false,
55395539
"lastActiveStrategies": [],
5540-
"lastPricePerShare": "1027757",
5540+
"lastPricePerShare": "1027760",
55415541
"lastTotalAssets": "58488386015",
55425542
"metadata": {
55435543
"isRetired": false,

external/vaults/route.vaults.one.simplified.go

-20
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,6 @@ func (y Controller) GetSimplifiedVault(c *gin.Context) {
149149

150150
// Process strategies with context awareness
151151
for _, strategy := range vaultStrategies {
152-
// Check for context timeout
153-
select {
154-
case <-ctx.Done():
155-
handleError(c, fmt.Errorf("operation timed out while processing strategies"),
156-
http.StatusGatewayTimeout, "Request processing timed out", "GetSimplifiedVault")
157-
return
158-
default:
159-
// Continue processing
160-
}
161-
162152
// Try to convert the strategy, capturing any errors
163153
var strategyWithDetails TExternalStrategy
164154
func() {
@@ -186,16 +176,6 @@ func (y Controller) GetSimplifiedVault(c *gin.Context) {
186176
newVault.Strategies = append(newVault.Strategies, strategyWithDetails)
187177
}
188178

189-
// Verify context is still valid before proceeding to response
190-
select {
191-
case <-ctx.Done():
192-
handleError(c, fmt.Errorf("request timed out before sending response"),
193-
http.StatusGatewayTimeout, "Request processing timed out", "GetSimplifiedVault")
194-
return
195-
default:
196-
// Continue to response
197-
}
198-
199179
// Special handling for vaults that are also registered as strategies
200180
if vaultAsStrategy, ok := storage.GuessStrategy(newVault.ChainID, common.HexToAddress(newVault.Address)); ok {
201181
simplified := toSimplifiedVersion(newVault, vaultAsStrategy)

internal/fetcher/strategies.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func assignStrategy(chainID uint64, strategy models.TStrategy, response map[stri
226226
if err == nil {
227227
netAPRFloat, _ := netAPR.Float64()
228228
if math.IsInf(netAPRFloat, 0) {
229-
netAPRFloat = 0
229+
netAPRFloat = math.MaxFloat64
230230
}
231231
newStrategy.NetAPR = netAPRFloat
232232
newStrategy.APRType = aprType

0 commit comments

Comments
 (0)