Skip to content

Commit

Permalink
hotfix: daily seed conflict on calc apr
Browse files Browse the repository at this point in the history
  • Loading branch information
luizakp committed Dec 13, 2023
1 parent 0c6d20d commit 852e3b7
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions packages/balancer-apr/src/dailySeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ async function calculateApr() {
console.log("Seeding veBAL APR");
await db.execute(sql`
INSERT INTO vebal_apr (timestamp, value, pool_external_id, external_id)
SELECT DISTINCT
SELECT DISTINCT ON (ps.timestamp, ps.pool_external_id)
ps.timestamp,
CASE
WHEN ps.liquidity = 0 THEN 0
Expand Down Expand Up @@ -1378,7 +1378,7 @@ async function calculateApr() {

await db.execute(sql`
INSERT INTO yield_token_apr (timestamp, token_address, pool_external_id, external_id, value)
SELECT DISTINCT
SELECT DISTINCT ON (pool_snapshots.timestamp, pool_tokens.token_address, pool_snapshots.pool_external_id)
pool_snapshots.timestamp,
pool_tokens.token_address,
pool_snapshots.pool_external_id,
Expand Down Expand Up @@ -1444,7 +1444,7 @@ async function calculateApr() {

await db.execute(sql`
INSERT INTO yield_token_apr (timestamp, token_address, pool_external_id, external_id, value)
SELECT DISTINCT
SELECT DISTINCT ON (pool_snapshots.timestamp, pool_tokens.token_address, pool_snapshots.pool_external_id)
pool_snapshots.timestamp,
pool_tokens.token_address,
pool_snapshots.pool_external_id,
Expand Down Expand Up @@ -1582,21 +1582,21 @@ async function calculateApr() {
export async function runDailyETLs() {
console.log("Starting ETL processes");

await seedCalendar();
await seedVebalRounds();
await seedBalEmission();
await ETLPools();
await ETLSnapshots();
await ETLGauges();
await ETLPoolRewards();
await calculatePoolRewardsSnapshots();
await fetchBalPrices();
await ETLGaugesSnapshot();
await fetchBlocks();
await ETLPoolRateProvider();
await ETLPoolRateProviderSnapshot();
await fetchTokenPrices();
await calculateTokenWeightSnapshots();
// await seedCalendar();
// await seedVebalRounds();
// await seedBalEmission();
// await ETLPools();
// await ETLSnapshots();
// await ETLGauges();
// await ETLPoolRewards();
// await calculatePoolRewardsSnapshots();
// await fetchBalPrices();
// await ETLGaugesSnapshot();
// await fetchBlocks();
// await ETLPoolRateProvider();
// await ETLPoolRateProviderSnapshot();
// await fetchTokenPrices();
// await calculateTokenWeightSnapshots();
await calculateApr();
console.log("Ended ETL processes");
process.exit(0);
Expand Down

0 comments on commit 852e3b7

Please sign in to comment.