Skip to content

Commit

Permalink
Update config
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Dec 19, 2024
1 parent 1bcc1b9 commit 32e0b4b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 40 deletions.
46 changes: 35 additions & 11 deletions bin/check-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { chain, groupBy } from "lodash"
import { chain, groupBy, uniq } from "lodash"
import { addressBook, Chain as AddressBookChain } from "blockchain-addressbook"

type Hex = `0x${string}`
Expand Down Expand Up @@ -270,11 +270,32 @@ async function main() {

const dataFileContentPerChain = {} as any

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// check for missing chains
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const missingChains: string[] = []
const allChains = uniq(allConfigs.map((v) => v.chain))
for (const chain of allChains) {
const fs = require("fs")

// only if the chain has a config file
if (!fs.existsSync(`./config/${chain}.json`)) {
missingChains.push(chain)
}
}
if (missingChains.length > 0) {
console.error(`Missing chains: ${missingChains.join(", ")}`)
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// check for missing holder counts
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const missingHolderCounts: BeefyVault[] = []
for (const vault of allConfigs) {
if (missingChains.includes(vault.chain)) {
continue
}

const subgraphchain = vault.chain === "one" ? "harmony" : vault.chain
dataFileContentPerChain[subgraphchain] = dataFileContentPerChain[subgraphchain] || { no_factory_vaults: [], no_factory_boosts: [] }

Expand Down Expand Up @@ -315,9 +336,9 @@ async function main() {
}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// write data files with missing holder counts
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// // write data files with missing holder counts
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// for (const chain of Object.keys(dataFileContentPerChain)) {
// const fs = require("fs")

Expand All @@ -343,13 +364,16 @@ async function main() {
// fs.writeFileSync(targetFile, JSON.stringify(dataFileContent, null, 2))
// }

// // display top 30 missing TVL to focus on the most important vaults
// missingHolderCounts.sort((a, b) => b.tvl - a.tvl)
// console.error(`\n\nMissing TVL for top 30 vaults:`)
// missingHolderCounts.slice(0, 100).forEach((v) => {
// const level = v.eol ? "ERROR" : "WARN"
// console.error(`${level}: Missing TVL for ${v.chain}:${v.id}:${v.vault_address}: ${v.tvl}`)
// })
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// display top 30 missing TVL to focus on the most important vaults
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// display top 30 missing TVL to focus on the most important vaults
missingHolderCounts.sort((a, b) => b.tvl - a.tvl)
console.error(`\n\nMissing TVL for top 30 vaults:`)
missingHolderCounts.slice(0, 100).forEach((v) => {
const level = v.eol ? "ERROR" : "WARN"
console.error(`${level}: Missing TVL for ${v.chain}:${v.id}:${v.vault_address}: ${v.tvl}`)
})

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// check that the chain config contains all the factory addresses in the addressbook
Expand Down
21 changes: 0 additions & 21 deletions config/_real.json

This file was deleted.

1 change: 1 addition & 0 deletions data/arbitrum_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"0x9b40e357937bce323b1eb3832173b3d028520708",
"0x9dbbbaecacedf53d5caa295b8293c1def2055adc",
"0x9e75f8298e458b76382870982788988a0799195b",
"0xaf570c4bcc42fe7f62e969bb147a639d74d2dad4",
"0xb1bfc21bee2b2dda4728481dbf52edc3b9f5fb79",
"0xb8ff233d024277b0e188a478c18e9263330a1b51",
"0xba5041b1c06e8c9cfb5ddb4b82bdc52e41ea5fc5",
Expand Down
8 changes: 0 additions & 8 deletions data/avax_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
"0x044e87f30bd9bd961c04028ac69155493e1b9ed0",
"0x052b006a2cfb2523042b3041f15adc7fa5356312",
"0x06ee4edd02e9f2513c57bc08a691a8d9f62f075e",
"0x09e38df01e8f362ed0b065ef1ad57ac7c0124be5",
"0x0c89ca08b6831e6b81f9f969f37a966a2c44d3d1",
"0x0d48e4e02ea44003b44360b9045f5a562890b1c6",
"0x10d52685e9f55884a67a88f2b5ed2215d607d0a2",
"0x180a73f4e0a84e4343019529429344cbec21d946",
"0x1b156c5c75e9df4caab2a5cc5999ac58ff4f9090",
"0x1ca786f754d339797bbece959799fba063c22f44",
"0x1d37e81c302f0d0a960242f85c763fb566564369",
"0x22eafb9c7e2858cfda712940896464ddaa83d053",
"0x258e9884c111e2e3e0273372521982bd57ef29bd",
"0x275ef36e6097c68be8765c238100bf061b38a922",
Expand All @@ -24,7 +22,6 @@
"0x2c0e2ec5c2c84346497cc82f5aff72f8a29da835",
"0x2d48d94abfad5a95b5fca0fab9cd37dd722c84a4",
"0x2ebaf60a6d6ae9ffe2c418470df0d2444b996ae9",
"0x2f1c8dab052cccfaa131e303162b75faede28e31",
"0x3094ab4af54f5208b867125b5ccecc94bc17cbb6",
"0x326d4521e4cf78fb2f8693b1ebc4d24ece89de01",
"0x35a338091c2077f33bed09717eb31ba0f02efb2f",
Expand All @@ -43,14 +40,12 @@
"0x4112d114658c8b9a7598e4b588f75e80b2d9b1f4",
"0x41e6612044aeddeb19102304775ca39c204ad030",
"0x42ab5a790e99df1b5d46f1c5c3e61d0cd63d1f6e",
"0x4409339d013a65fa029c2f587ee410dfebcb1c6e",
"0x440f1249349b185748c9aa8dab26f067a515a68f",
"0x4502e2f6802d48578f76920e5d56557459c04b7d",
"0x491e09eb736c0c4cd85df694a22d1c0dec8c4c25",
"0x4c25854f6da3b5848f7b5c71dcb8eee20b292d3e",
"0x4c7cf6ee7afa810028099c2d1d97c6ab33540412",
"0x4e685c0d068cb0af88ff662b89951ad5b3727387",
"0x4ebe6bdef299aa11ee811bd42646c44a52b23d46",
"0x5508222678c5337e76d93a3005dc008056715655",
"0x5526851c271d8b59f6412e3244a7a6db3a13808f",
"0x57c7128a8fba6425f380af712efdcd7688ace332",
Expand Down Expand Up @@ -79,7 +74,6 @@
"0x7e5bc7088ab3da3e7fa1aa7cef1dc73f5b00681c",
"0x808d5f0a62336917da14fa9a10e9575b1040f71c",
"0x813ab5b3fdc59b143c42284665864b24b794c324",
"0x837036a6856ce707c855eb4c5f4f3b86a5c9f0ff",
"0x83e05c8a4adefa875abe0f30a18bb6f9b54b807e",
"0x84cb5ff7f5068ac02a7b0fd4772577c670a5afc6",
"0x865628e18e99ab563405e1f329024c50f7093318",
Expand Down Expand Up @@ -123,7 +117,6 @@
"0xb6ae1f6be8575a44d22af3cd2c5385cc9c293978",
"0xba8284dc76fbedd311f14937340e3bc174b4864c",
"0xbacec852971eb461da6ad8f5c2e37694dca56002",
"0xbb7f25af55da4347960c2ed67dff00263469836f",
"0xbbbe0fa93c8ced0614351baf74979ab1243cf9c8",
"0xbda8bc79705bc60226adca2766e94eb5512949a3",
"0xc040e6221b7fe844681c733adcf1c19f9984272a",
Expand All @@ -147,7 +140,6 @@
"0xd8e92bcbf66a675b2ac45f0bbbb0f285ba607ab7",
"0xda875a511860f2752b891677489d08caedac00ea",
"0xdb054f4978a485bc5d9ae144b487340b141e41db",
"0xdb4d3830b1fbcadb10cb40ab406bfcf953fac014",
"0xdc5e537764f5ad0f51bf52ccf0767083bb4565ec",
"0xdd63306a9792ecbd1cd6baed3f1b18bea638aace",
"0xdf306fbda58527729a8d5185ab8fef96bfa94c7a",
Expand Down

0 comments on commit 32e0b4b

Please sign in to comment.