Skip to content

Commit aa1681a

Browse files
committed
hacky way to get bitcoin n solana emissions not to be counted as unlock events
1 parent 958463e commit aa1681a

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

protocols/bitcoin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const miningRewardsDune = async (): Promise<{ data: CliffAdapterResult[]; lastTi
2121
type: "cliff",
2222
start: Number(row.timestamp),
2323
amount: Number(row.btc_mined),
24+
isUnlock: false,
2425
}));
2526
const lastTimestamp = Math.max(...duneData.map((row: any) => Number(row.timestamp)));
2627
return { data: filtered, lastTimestamp };

protocols/solana.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const stakingRewardsDune = async (): Promise<{ data: CliffAdapterResult[]; lastT
1919
type: "cliff",
2020
start: Number(row.timestamp),
2121
amount: Number(row.sol_reward),
22+
isUnlock: false,
2223
}));
2324
const lastTimestamp = Math.max(...duneData.map((row: any) => Number(row.timestamp)));
2425
return { data: filtered, lastTimestamp };

utils/events.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export function addResultToEvents(
3030
cliffs.map((c: CliffAdapterResult) => {
3131
if (!metadata.events) metadata.events = [];
3232
if (c.amount.toFixed(2) == "0.00") return;
33+
// Skip cliff events that are explicitly marked as not unlocks
34+
if (c.isUnlock === false) return;
3335
metadata.events.push({
3436
description: `A cliff of {tokens[0]} tokens ${
3537
isFuture(c.start) ? "will" : "was"
@@ -104,6 +106,8 @@ export function addResultToEvents(
104106

105107
cliffs.forEach((c: CliffAdapterResult) => {
106108
if (c.amount.toFixed(2) == "0.00") return;
109+
// Skip cliff events that are explicitly marked as not unlocks
110+
if (c.isUnlock === false) return;
107111
cliffAllocations.push({
108112
recipient: section,
109113
category: sectionToCategory[section] || 'Uncategorized',

0 commit comments

Comments
 (0)