Skip to content

Commit 32076b6

Browse files
authored
Fix azuro and add timeout in lista-lending (#5800)
* Fix: azuro batch query * add timeout to avoid rate-limit errors * remove console
1 parent dd555ad commit 32076b6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

fees/azuro/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,23 @@ const prefetch = async (options: FetchOptions) => {
4141
SUM(usd_ggr) AS dailyFees
4242
FROM normalized
4343
GROUP BY 1, 2
44-
ORDER BY 1, 2;
44+
ORDER BY 1, 2
4545
`
4646
const results = await queryDuneSql(options, query);
4747
return results;
4848
}
4949

50-
const fetch = async (_a:any, _b:any, options: FetchOptions) => {
50+
const fetch = async (_a: any, _b: any, options: FetchOptions) => {
5151
const dailyFees = options.createBalances();
5252
const dailyRevenue = options.createBalances();
5353
const prefetchResults = options.preFetchedResults || [];
54-
if (options.chain == CHAIN.CHILIZ){
54+
55+
if (options.chain == CHAIN.CHILIZ) {
5556
return { dailyFees, dailyRevenue };
5657
}
5758
if (prefetchResults && prefetchResults.length > 0) {
58-
for (const row of prefetchResults){
59-
if(row.chain_group == options.chain){
59+
for (const row of prefetchResults) {
60+
if (row.chain_group == options.chain) {
6061
dailyFees.addUSDValue(row.dailyFees);
6162
dailyRevenue.addUSDValue(row.dailyRevenue);
6263
}

fees/lista-lending/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ const fetch = async (_a: any, _b: any, options: FetchOptions) => {
106106
dailyRevenue.addCGToken("usd-coin", performanceFee);
107107
}
108108
}
109+
await new Promise(resolve => setTimeout(resolve, 500));
109110
}
110111
const dailyFees = dailyRevenue.clone(0.05);
111112
dailyFees.addBalances(dailySupplySideRevenue);

0 commit comments

Comments
 (0)