Skip to content

Commit b4e3645

Browse files
authored
Merge pull request #75 from OriginProtocol/claude/add-entity-postdeploy-v149-8WBym
add ExchangeRateDaily entity to validation script
2 parents 56fb91b + cb80dcb commit b4e3645

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

scripts/generate-validations.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,27 @@ const exchangeRates = () => {
11001100
`)
11011101
}
11021102

1103+
const exchangeRateDailies = () => {
1104+
return gql(`
1105+
exchangeRateDailies: exchangeRateDailies(
1106+
limit: ${LIMIT},
1107+
orderBy: [blockNumber_ASC, id_ASC],
1108+
where: { timestamp_gte: "2025-01-01T00:00:00Z", timestamp_lte: "${twoDaysAgo.toISOString()}" }
1109+
) {
1110+
id
1111+
chainId
1112+
date
1113+
timestamp
1114+
blockNumber
1115+
pair
1116+
base
1117+
quote
1118+
rate
1119+
decimals
1120+
}
1121+
`)
1122+
}
1123+
11031124
const kebabCase = (str: string) => {
11041125
return str
11051126
.replace(/([a-z])([A-Z])/g, '$1-$2')
@@ -1219,6 +1240,7 @@ const main = async () => {
12191240
protocolDailyStatDetails(),
12201241
protocolDailyStats(),
12211242
exchangeRates(),
1243+
exchangeRateDailies(),
12221244
morphoVaultApys(),
12231245
morphoMarketStates(),
12241246
].map((query) => `query Query { ${query} }`)
@@ -1250,7 +1272,7 @@ const main = async () => {
12501272
// If there are fewer than 20 total entries, save them all
12511273
if (rawData.length < 20 || takeAll.includes(key)) {
12521274
validationData = rawData
1253-
} else if (key === 'exchangeRates') {
1275+
} else if (key === 'exchangeRates' || key === 'exchangeRateDailies') {
12541276
// Special handling for exchange rates: ensure at least one of every pair
12551277
validationData = takeExchangeRateValidationEntries(rawData)
12561278
} else {

0 commit comments

Comments
 (0)