Skip to content

Commit 98be87f

Browse files
committed
track litecoin
1 parent a6f5644 commit 98be87f

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

protocols/litecoin.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { manualLinear } from "../adapters/manual";
2+
import { LinearAdapterResult, Protocol } from "../types/adapters";
3+
4+
const initialReward: number = 50;
5+
const halveningDates: string[] = [
6+
"2011/10/07", // Genesis Block
7+
"2015/08/25", // 840k
8+
"2019/08/05", // 1,680k
9+
"2023/08/02", // 2,520k
10+
"2027/07/27", // 3,360k projected
11+
];
12+
13+
function rewards(): LinearAdapterResult[] {
14+
const sections: LinearAdapterResult[] = [];
15+
let reward: number = initialReward;
16+
17+
for (let i = 0; i < halveningDates.length - 1; i++) {
18+
const qty = reward * 840000; // LTC uses 840k blocks per halving period
19+
sections.push(manualLinear(halveningDates[i], halveningDates[i + 1], qty));
20+
reward /= 2;
21+
}
22+
23+
return sections;
24+
}
25+
26+
const litecoin: Protocol = {
27+
"Mining rewards": rewards(),
28+
meta: {
29+
sources: [
30+
"https://litecoin.org",
31+
"https://www.litecoinhalving.com/",
32+
],
33+
token: "coingecko:litecoin",
34+
protocolIds: [],
35+
notes: [
36+
`Future halvenings have at a specified block height, therefore the dates shown are an estimate only.`,
37+
],
38+
},
39+
categories: {
40+
farming: ["Mining rewards"],
41+
},
42+
};
43+
44+
export default litecoin;

0 commit comments

Comments
 (0)