Skip to content

Commit 36b1f6f

Browse files
committed
blackhole
1 parent 4bb7fe7 commit 36b1f6f

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

no-emissions/incentives.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ export const protocolsIncentives:string[] = [
4545
"parent#euler", //euler
4646
"parent#ramses-exchange", //ramses
4747
"parent#spark", //spark
48+
"parent#blackhole", //blackhole
4849
]

protocols/blackhole.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { manualCliff, manualLinear } from "../adapters/manual";
2+
import { CliffAdapterResult, Protocol } from "../types/adapters";
3+
import { queryCustom } from "../utils/queries";
4+
import { readableToSeconds } from "../utils/time";
5+
6+
const rewards = async (): Promise<CliffAdapterResult[]> => {
7+
const result: CliffAdapterResult[] = [];
8+
const data = await queryCustom(`
9+
SELECT
10+
toStartOfDay(timestamp) AS date,
11+
SUM(reinterpretAsUInt256(reverse(unhex(substring(data, 3))))) / 1e18 AS amount
12+
FROM evm_indexer.logs
13+
PREWHERE chain = '43114'
14+
AND topic0 = '0xc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba'
15+
AND address IN (
16+
SELECT concat('0x', substr(topic1,-40)) as gauge
17+
FROM evm_indexer.logs
18+
PREWHERE chain = '43114'
19+
WHERE address = '0x59aa177312ff6bdf39c8af6f46dae217bf76cbf6'
20+
AND topic0 = '0xa4d97e9e7c65249b4cd01acb82add613adea98af32daf092366982f0a0d4e453'
21+
)
22+
GROUP BY date
23+
ORDER BY date DESC;`, {})
24+
25+
for (let i = 0; i < data.length; i++) {
26+
result.push({
27+
type: "cliff",
28+
start: readableToSeconds(data[i].date),
29+
amount: Number(data[i].amount)
30+
});
31+
}
32+
return result;
33+
}
34+
35+
const blackhole: Protocol = {
36+
Rewards: rewards,
37+
meta: {
38+
sources: [
39+
],
40+
token: "coingecko:blackhole",
41+
protocolIds: ["parent#blackhole"],
42+
notes: ["Rewards data are calculated from gauges claim events"]
43+
},
44+
categories: {
45+
farming: ["Rewards"],
46+
},
47+
};
48+
49+
export default blackhole;

0 commit comments

Comments
 (0)