Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebruce0x committed Sep 28, 2023
2 parents efa01f1 + f14e830 commit 4d55b82
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 5 deletions.
41 changes: 41 additions & 0 deletions protocols/ens.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { manualCliff, manualLinear, manualStep } from "../adapters/manual";
import { Protocol } from "../types/adapters";
import { periodToSeconds } from "../utils/time";

const start = 1636329600; // 8 November 2021 00:00:00
const qty = 100000000; //100m

const ens: Protocol = {
"Airdrop": manualCliff(start, qty * 0.25),
"Core Contributors": manualLinear(
start, start + 4 * periodToSeconds.year,
0.1954 * qty,
),
"Other contributors": manualLinear(
start, start + 4 * periodToSeconds.year,
0.0546 * qty,
),
"DAO Community Treasury": [
manualCliff(start, 5000000), // 5m tokens release at start
manualStep(
start,
periodToSeconds.month,
48,
(45000000) / 48,
), // monthly steps for the next 48 months
],
meta: {
notes: [
`Tokens for core contributors and launch advisors will have a four year lock-up and vesting schedule.`,
],
token: "ethereum:0xc18360217d8f7ab5e7c516566761ea12ce7f9d72",
sources: ["https://ens.mirror.xyz/-eaqMv7XPikvXhvjbjzzPNLS4wzcQ8vdOgi9eNXeUuY"],
protocolIds: ["2519"],
},
categories: {
insiders: ["Other contributors", "Core Contributors", "DAO Community Treasury"],
publicSale: [],
airdrop: ["Airdrop"]
},
};
export default ens;
39 changes: 34 additions & 5 deletions utils/convertToChartData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
IncompleteSection,
ApiChartData,
} from "../types/adapters";
import { PromisePool } from "@supercharge/promise-pool";
import fetch from "node-fetch";
import {
RESOLUTION_SECONDS,
Expand Down Expand Up @@ -384,14 +385,42 @@ function discreet(raw: RawResult, config: ChartConfig): ChartData {
return { timestamps, unlocked, apiData, isContinuous: false };
}

export function mapToServerData(testData: ChartSection[]) {
export async function mapToServerData(
testData: ChartSection[],
token: string
) {
const allTimestamps = [
...new Set(
testData
.map((s: ChartSection) => {
return s.data.timestamps;
})
.flat()
),
];
const prices: Record<string, number> = {};

await PromisePool.withConcurrency(20)
.for(allTimestamps)
.process(async (ts: string) => {
const res = await fetch(
`https://coins.llama.fi/prices/historical/${ts}/${token}`
)
.then((r: any) => r.json())
.catch(() => null);
const price = res ? res?.coins[token]?.price : 0;
prices[ts] = price;
});
const serverData: any[] = testData.map((s: ChartSection) => {
const label = s.section;

const data = s.data.timestamps.map((timestamp: number, i: number) => ({
timestamp,
unlocked: s.data.unlocked[i],
}));
const data = s.data.timestamps.map(
(timestamp: number, i: number) => ({
timestamp,
unlocked: s.data.unlocked[i],
price: prices[timestamp] ?? 0,
})
);

return { label, data };
});
Expand Down
65 changes: 65 additions & 0 deletions wipProtocols/celestia.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { manualCliff, manualLinear, manualStep } from "../adapters/manual";
import { Protocol } from "../types/adapters";
import { periodToSeconds } from "../utils/time";

const start = 1697500800; // 17 oct?!
const qty = 1000000000; //1b
const qtyEcosystem = 268000000
const qtyCORE = 176000000
const qtySEED = 159000000
const qtyAB = 197000000

const celestia: Protocol = {
"Public Allocation": manualCliff(start, qty * 0.2),
"R&D & Ecosystem": [
manualCliff(start, qtyEcosystem * 0.25), // 25%
manualStep(
start + periodToSeconds.year,
periodToSeconds.day,
1095,
(qtyEcosystem * 0.75) / 1095,
), //
],
"Initial Core Contributors": [
manualCliff(start + periodToSeconds.year, qtyCORE * 0.33), // 33%
manualStep(
start + periodToSeconds.year,
periodToSeconds.day,
1095,
(qtyCORE * 0.67) / 1095,
), //
],
"Early Backers Seed": [
manualCliff(start + periodToSeconds.year, qtySEED * 0.33), // 33%
manualStep(
start + periodToSeconds.year,
periodToSeconds.day,
365,
(qtySEED * 0.67) / 365,
), //
],
"Early Backers Series A&B": [
manualCliff(start + periodToSeconds.year, qtyAB * 0.33), // 25%
manualStep(
start + periodToSeconds.year,
periodToSeconds.day,
365,
(qtyAB * 0.67) / 365,
), // monthly steps for the next 3 years
],
meta: {
notes: [
`Celestia’s 1 billion TIA supply at genesis will be subject to several different unlock schedules. All tokens, locked or unlocked, may be staked, but staking rewards are unlocked upon receipt.`,
],
token: "ethereum:-",
sources: ["https://docs.celestia.org/learn/staking-governance-supply/"],
protocolIds: ["3562"], //add correct id
},
categories: {
insiders: ["Initial Core Contributors", "Early Backers Seed", "Early Backers Series A&B"],
publicSale: [],
airdrop: ["Public Allocation"],
farming: ["R&D & Ecosystem"]
},
};
export default celestia;

0 comments on commit 4d55b82

Please sign in to comment.