Skip to content

Commit

Permalink
fix: missing strategies in response
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Nov 17, 2023
1 parent 18dd042 commit 032f652
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 144 deletions.
10 changes: 5 additions & 5 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ func NewRouter() *gin.Engine {
{
c := vaults.Controller{}
// Retrieve the vaults for all chains
router.GET(`vaults`, c.GetAllVaultsForAllChainsSimplified)
router.GET(`vaults/retired`, c.GetAllRetiredVaultsForAllChainsSimplified)
router.GET(`vaults`, c.GetAllVaultsForAllChainsSimplified) // Migrated to simplified ✅
router.GET(`vaults/retired`, c.GetAllRetiredVaultsForAllChainsSimplified) // Migrated to simplified ✅
router.GET(`vaults/all`, c.GetAllVaultsForAllChainsSimplified) // Migrated to simplified ✅

router.GET(`vaults/all`, c.GetAllVaultsForAllChains)
router.GET(`vaults/tvl`, c.GetAllVaultsTVL)

// Retrieve the vaults for a specific chainID
router.GET(`:chainID/vaults/tvl`, c.GetVaultsTVL)
router.GET(`:chainID/vaults/all`, c.GetAllVaults)
router.GET(`:chainID/vaults/retired`, c.GetRetiredVaults)
router.GET(`:chainID/vaults/:address`, c.GetVault)
router.GET(`:chainID/vault/:address`, c.GetVault)
router.GET(`:chainID/vaults/:address`, c.GetSimplifiedVault) // Migrated to simplified ✅
router.GET(`:chainID/vault/:address`, c.GetSimplifiedVault) // Migrated to simplified ✅

router.GET(`info/vaults/blacklisted`, c.GetBlacklistedVaults)

Expand Down
158 changes: 79 additions & 79 deletions data/meta/strategies/1.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/meta/tokens/1.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lastUpdate": "2023-11-16T10:41:36.055213+01:00",
"lastUpdate": "2023-11-17T10:53:28.926903+01:00",
"version": {
"major": 0,
"minor": 1,
Expand Down
96 changes: 48 additions & 48 deletions data/meta/vaults/1.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"lastUpdate": "2023-11-16T10:41:21.516162+01:00",
"lastUpdate": "2023-11-17T10:53:18.351265+01:00",
"version": {
"major": 0,
"minor": 0,
"patch": 1290
"patch": 1293
},
"shouldRefresh": false,
"vaults": {
Expand Down Expand Up @@ -185,7 +185,7 @@
"0x11829e810afcca3e28b0c7d9e560a3f3e1294ba3",
"0xccb0da3e219de478a0975599d9c362e724a6dff9"
],
"lastPricePerShare": "1189024199751777546",
"lastPricePerShare": "1189078559708431693",
"lastTotalAssets": "47840643232341007562393",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -346,8 +346,8 @@
"lastActiveStrategies": [
"0x478085739ea884f38add4d36872acd8333b5d4d6"
],
"lastPricePerShare": "1014671760111476344",
"lastTotalAssets": "196863335761347150250054",
"lastPricePerShare": "1014816565169750011",
"lastTotalAssets": "197277635316983208036196",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -659,7 +659,7 @@
"lastActiveStrategies": [
"0x2fa2e992bb5c68a8b61cbfa995431afbd0a4db11"
],
"lastPricePerShare": "1258906156075322495",
"lastPricePerShare": "1260408194807542294",
"lastTotalAssets": "1711144059957161454445",
"isRetired": false,
"isHidden": true,
Expand Down Expand Up @@ -1164,8 +1164,8 @@
"0xa991652b995c4fb3c87d165311bd77e139297cce",
"0xb458c556ded7b59b12f3fea188b01ad06f30c7f3"
],
"lastPricePerShare": "1034242090343275930",
"lastTotalAssets": "296330263257732409973900",
"lastPricePerShare": "1043421679873663352",
"lastTotalAssets": "224223911924497910895074",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -1228,8 +1228,8 @@
"lastActiveStrategies": [
"0x23724d764d8b3d26852ba20d3bc2578093d2b022"
],
"lastPricePerShare": "1387545384883843235",
"lastTotalAssets": "42368275326922175070137330",
"lastPricePerShare": "1388624431701167985",
"lastTotalAssets": "42408381656847305343697126",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -2022,8 +2022,8 @@
"0x24788d1468eebb6a57ab8ab94a307f8b31bb2e81",
"0x961082de19e9cf87bb4850f6f347407be89d9ebb"
],
"lastPricePerShare": "1094939761465437883",
"lastTotalAssets": "376496752616555197012730",
"lastPricePerShare": "1095598358939002948",
"lastTotalAssets": "341490935113062844514008",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -2371,7 +2371,7 @@
"0xc3715e4a6eb545d8a1d82e7e5b727831c0058be6"
],
"lastPricePerShare": "1051510797247707056",
"lastTotalAssets": "11262649327463808517953",
"lastTotalAssets": "11293236028130620191739",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -3265,8 +3265,8 @@
"0x472f4e5533fb8f7fee97dacd3dbae9d83867ab07",
"0x0a94d79e811793141a04106fa797fb6d61163102"
],
"lastPricePerShare": "1004974536786643141",
"lastTotalAssets": "1538246366440382285770",
"lastPricePerShare": "1005091268729446975",
"lastTotalAssets": "1766458436616517510350",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -3517,7 +3517,7 @@
"0x3e55bf8882d7f908b4ada67055be14a0ab14622b",
"0xabec96ac9cdc6863446657431dd32f73445e80b1"
],
"lastPricePerShare": "1004650700141326698",
"lastPricePerShare": "1004673270282257972",
"lastTotalAssets": "10677494745876283643841",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -4200,8 +4200,8 @@
"0x734d102a18a3c0ae16f5ae1df62fc4373e306ad8",
"0x8dcf2ff7f2ab5fc16ef51cc04d6f65f2535745a2"
],
"lastPricePerShare": "1212529321097670610",
"lastTotalAssets": "301777571113280411068534",
"lastPricePerShare": "1214037891805409254",
"lastTotalAssets": "300761400223025399984403",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -4358,7 +4358,7 @@
"0xb6abbd5594b344f17af8d9a83869c3660ea9a6bd"
],
"lastPricePerShare": "1108843479845848667",
"lastTotalAssets": "111720554909664094216410",
"lastTotalAssets": "111586254442947618965290",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -4388,8 +4388,8 @@
"0xda64d669b3fd915f58d4cac799a57aeae0593ae7",
"0x9004d433d710194a033c15041bacd134fc9ba50f"
],
"lastPricePerShare": "1044033058616413014",
"lastTotalAssets": "5230661727878992538302076",
"lastPricePerShare": "1044358050433229647",
"lastTotalAssets": "5165504767736949034989760",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -4873,8 +4873,8 @@
"0xf7461f158bbc6337f63747c3a861cfbfc039022a",
"0x83cb8461e0f7f27a5921f7b5f9235211eaa30d59"
],
"lastPricePerShare": "1069438711281393686",
"lastTotalAssets": "66988553845900179253237",
"lastPricePerShare": "1069549809339271212",
"lastTotalAssets": "67055757395065828353666",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -5289,8 +5289,8 @@
"0x398c51c68989c5c0c193f17c387acd6a5e8e3a80",
"0x9d7cd0041abd91f281e282db3fba7a9db9e4cc8b"
],
"lastPricePerShare": "1073897510484152613",
"lastTotalAssets": "1291394842406189067875",
"lastPricePerShare": "1074042937638017581",
"lastTotalAssets": "1290320874896538355535",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -5354,7 +5354,7 @@
"0xd7c355c78ba2716b5d52065c3e0735badf046b8c",
"0x1492011cf0523f61d02ac541c3d1958756c8a383"
],
"lastPricePerShare": "1010288282142529077",
"lastPricePerShare": "1011326955669299715",
"lastTotalAssets": "1006901778724857010499735",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -5484,7 +5484,7 @@
"0xdbcaa49bbeeedfd63a12908956c6e3a8b07c3fba"
],
"lastPricePerShare": "1065833558882898310",
"lastTotalAssets": "143271431086549524267",
"lastTotalAssets": "143703284093403498620",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -6216,7 +6216,7 @@
"0x967f222172627044e7bba2329655168a17e4642c",
"0xc18207dc4dbc366a8fed62e438c173c47e57f096"
],
"lastPricePerShare": "1125643209482330659",
"lastPricePerShare": "1126584276513518324",
"lastTotalAssets": "275220229239982713540463",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -6250,7 +6250,7 @@
"0x64e4779bff8588ccdca9f290b9bc346a798f5277"
],
"lastPricePerShare": "1047134654648682156",
"lastTotalAssets": "57872552290095792478465",
"lastTotalAssets": "57861220125219374463002",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -6311,8 +6311,8 @@
"0x97d868b5c2937355bf89c5e5463d52016240fe86",
"0x0fd45d4fb70d1ec95264da30934095443dc6af6a"
],
"lastPricePerShare": "1048095",
"lastTotalAssets": "21473987395886",
"lastPricePerShare": "1048243",
"lastTotalAssets": "21256259105349",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -6372,7 +6372,7 @@
"0xf4b4464d03c1f3226c23fe58407b558489510dab",
"0x9430a2501e5f2cd66741375baabb9576e8fb5f48"
],
"lastPricePerShare": "1051329559250426438",
"lastPricePerShare": "1052576134812727137",
"lastTotalAssets": "1269236547492099679323471",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -6471,8 +6471,8 @@
"0x9e9a2a86eeff52ffd13fc724801a4259b2b1a949",
"0x1e93cd1e6766e7fcb459092e160f876dda650415"
],
"lastPricePerShare": "102333861",
"lastTotalAssets": "7721683201",
"lastPricePerShare": "102333862",
"lastTotalAssets": "7678093115",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -6667,7 +6667,7 @@
"0x0472d09b1eecea082245b88c22b2a52e8892b018",
"0xf36c83f6bf4cf656172f6dbc1220af6785362f0f"
],
"lastPricePerShare": "1036517449385506981",
"lastPricePerShare": "1036856171077825461",
"lastTotalAssets": "4182209966795845181384",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -6760,7 +6760,7 @@
"0xb60362fa811c576d4c220c0834ebda9bfe68888c",
"0xe5b3b12b6c93b725484736628a22dbcd130574d7"
],
"lastPricePerShare": "1005127014238377364",
"lastPricePerShare": "1005191467464960688",
"lastTotalAssets": "1256700132628904553185559",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -7211,7 +7211,7 @@
"0x8a6bd845e58edaaa7c2285701013d1b0004d98fd"
],
"lastPricePerShare": "1000000000000000000",
"lastTotalAssets": "0",
"lastTotalAssets": "92475168258390937636121",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -8041,7 +8041,7 @@
"0xf65b3981127c3dd59798bc54dfed0205c5e9c686"
],
"lastPricePerShare": "1000000000000000000",
"lastTotalAssets": "125531076520963589027",
"lastTotalAssets": "114209747896880676096",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -8769,8 +8769,8 @@
"0x3280499298ace3fd3cd9c2558e9e8746ace3e52d",
"0x01d127d90513ccb6071f83efe15611c4d9890668"
],
"lastPricePerShare": "1075421238552388386",
"lastTotalAssets": "23493739998312745877772513",
"lastPricePerShare": "1075593630647922051",
"lastTotalAssets": "23337964681134053356102159",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -8839,7 +8839,7 @@
"0xf06b5c192d1413e7a4db1b2a9640500fdd83f1b2"
],
"lastPricePerShare": "1013228104132560108",
"lastTotalAssets": "238986926862763750979",
"lastTotalAssets": "238959613801815674331",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -8903,7 +8903,7 @@
"0x9084b5a98e3b4b257affd82ae4a1753f87906dce"
],
"lastPricePerShare": "1098425989399406290",
"lastTotalAssets": "6730825409083211806544",
"lastTotalAssets": "6736492537261842909401",
"isRetired": false,
"isHidden": true,
"migration": {
Expand Down Expand Up @@ -9155,7 +9155,7 @@
"0xc771d3fe9699a5aac0e6be661c5eee3ed1f9a285",
"0xde2b8a0cba4f6996b526a4bc784532d7aeba4e33"
],
"lastPricePerShare": "1070630583729280983",
"lastPricePerShare": "1073356687015509111",
"lastTotalAssets": "156221364960113662336",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -9311,7 +9311,7 @@
"0x337957ebbeaba34f4fc0520f1b1b54fd5fc352cf",
"0xe359def55cf9e310aef759dc0ef7dbfc584f27bf"
],
"lastPricePerShare": "1123681937727385849",
"lastPricePerShare": "1124619863135749188",
"lastTotalAssets": "152362608028831679132577",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -9731,7 +9731,7 @@
"0xe47e864e4eedc4d63703a2ab3a8a8f5e17516726"
],
"lastPricePerShare": "1017969992733175935",
"lastTotalAssets": "33728860648237431469070",
"lastTotalAssets": "156210287897289107921",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -9763,7 +9763,7 @@
"0xc9c5b887e984bb4914574755d12c997e4ae2d88f",
"0x9bd0d6c7a1f770d513dd9b7dde45e56c8ed81002"
],
"lastPricePerShare": "1044930307805355137",
"lastPricePerShare": "1047227740603469463",
"lastTotalAssets": "2159392925282837754",
"isRetired": false,
"isHidden": false,
Expand Down Expand Up @@ -9828,7 +9828,7 @@
"0xd9008eae1cd4b25d87ca844bd936609c1433dfa2"
],
"lastPricePerShare": "1000000000000000000",
"lastTotalAssets": "9119850491129311910",
"lastTotalAssets": "9800405302561082012",
"isRetired": false,
"isHidden": false,
"migration": {
Expand Down Expand Up @@ -9922,7 +9922,7 @@
"0x97d4ee49ee15e8223f0bac1c925f9db75918e7b3",
"0x44fbf9b2dce6890b75dc988bd1e204e87dcebd93"
],
"lastPricePerShare": "1013648678392500978",
"lastPricePerShare": "1014956487818987654",
"lastTotalAssets": "305188826692600471301701",
"isRetired": false,
"isHidden": false,
Expand Down
1 change: 1 addition & 0 deletions external/vaults/prepare.vaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func toSimplifiedVersion(vault TExternalVault) TSimplifiedExternalVault {
TVL: vault.TVL.TVL,
Price: vault.TVL.Price,
},
Strategies: vault.Strategies,
Staking: TStakingData{
Address: stakingData.StackingPoolAddress.Hex(),
Available: hasStakingPool,
Expand Down
12 changes: 1 addition & 11 deletions external/vaults/route.vaults.allchains.simplified.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,7 @@ func (y Controller) GetAllVaultsForAllChainsSimplified(c *gin.Context) {
** c. It checks if the strategy should be included based on the 'strategiesCondition'. If not,
** it skips the current iteration of the loop.
**
** d. If 'withStrategiesDetails' is true, it assigns the strategy with details to
** 'externalStrategy' and assigns a risk score to it. Otherwise, it assigns a new 'TStrategy'
** object with the address, name, display name, and description of the current strategy to
** 'externalStrategy'.
**
** e. It appends 'externalStrategy' to the 'Strategies' field of 'currentVault'.
**
** 4. If 'withStrategiesDetails' is true, it computes the risk score for the current vault and
** assigns it to the 'RiskScore' field of 'currentVault'.
**
** 5. It appends the current vault to the 'data' slice.
** 4. It appends the current vault to the 'data' slice.
**
** This loop effectively populates the 'Strategies' field of each vault in 'allVaults' with the
** appropriate strategies and computes the risk score for each vault if 'withStrategiesDetails' is
Expand Down
Loading

0 comments on commit 032f652

Please sign in to comment.