Skip to content

Commit

Permalink
more protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebruce0x committed Jun 21, 2023
1 parent 0bffa87 commit d710565
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 10 deletions.
23 changes: 15 additions & 8 deletions adapters/manual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const manualLog = (
amount: number,
periodLength: number,
percentDecreasePerPeriod: number,
converging: boolean = true,
percentInFirstPeriod: number | undefined = undefined,
dateFormat: string | undefined = undefined,
): LinearAdapterResult[] => {
let sections: LinearAdapterResult[] = [];
Expand All @@ -56,21 +58,26 @@ export const manualLog = (
let sum: number = 0;

for (let i = 1; i < periods; i++) {
const thisQty: number = workingQty * (1 - percentDecreasePerPeriod / 100);
const thisQty: number =
percentInFirstPeriod && i == 1
? amount * (percentInFirstPeriod / 100)
: workingQty * (1 - percentDecreasePerPeriod / 100);
sections.push(manualLinear(thisStart, thisStart + periodLength, thisQty));

sum += thisQty;
workingQty = thisQty;
thisStart += periodLength;
}

const factor: number = amount / sum;
sections = sections.map((s: LinearAdapterResult) => ({
type: s.type,
start: s.start,
end: s.end,
amount: (s.amount *= factor),
}));
if (converging) {
const factor: number = amount / sum;
sections = sections.map((s: LinearAdapterResult) => ({
type: s.type,
start: s.start,
end: s.end,
amount: (s.amount *= factor),
}));
}

return sections;
};
62 changes: 62 additions & 0 deletions protocols/clev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import {
manualCliff,
manualLinear,
manualLog,
manualStep,
} from "../adapters/manual";
import { LinearAdapterResult, Protocol } from "../types/adapters";
import { periodToSeconds } from "../utils/time";

const start = 1665529200;
const qty = 2e6;
const token = "0x72953a5c32413614d24c29c84a66ae4b59581bbf";
const chain = "ethereum";

const clev: Protocol = {
"Liquidity Incentives": manualLog(
start,
start + periodToSeconds.year * 10,
qty * 0.4825,
periodToSeconds.year,
10,
false,
5,
),
"Community Contributors": manualStep(
start,
periodToSeconds.month,
24,
(qty * 0.04) / 24,
),
"Treasury Reserve": manualLinear(start, periodToSeconds.year * 2, qty * 0.05),
IDO: manualCliff(start, qty * 0.05),
Airdrop: manualLinear(start, start + periodToSeconds.year, qty * 0.05),
AlladinDAO: manualLinear(start, start + periodToSeconds.year * 2, qty * 0.3),
"Initial Liquidity": manualCliff(start, qty * 0.01),
"Strategic Partnerships": manualLinear(
bribes,
bribes + periodToSeconds.month * 3,
qty * 0.015,
),
"Beta bonus": manualCliff(start, 0.0025),
meta: {
token: `${chain}:${token}`,
sources: [
"https://medium.com/@0xC_Lever/a-clever-token-offering-2d775943e23c",
],
protocolIds: ["1707"],
},
categories: {
insiders: [
"Strategic Partnerships",
"AlladinDAO",
"Community Contributors",
],
farming: ["Liquidity Incentives"],
airdrop: ["Airdrop", "Beta bonus"],
publicSale: ["Initial Liquidity", "IDO"],
noncirculating: ["Treasury Reserve"],
},
};

export default clev;
2 changes: 1 addition & 1 deletion protocols/onchain-trade.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { manualCliff, manualLinear, manualLog } from "../adapters/manual";
import { manualCliff, manualLinear } from "../adapters/manual";
import { Protocol } from "../types/adapters";
import { periodToSeconds } from "../utils/time";

Expand Down
47 changes: 47 additions & 0 deletions protocols/penpie.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { manualCliff, manualLinear } from "../adapters/manual";
import { Protocol } from "../types/adapters";
import { periodToSeconds } from "../utils/time";

const start: number = 1687302000;
const qty: number = 10e6;

const penpie: Protocol = {
"Liquidity mining": [
manualCliff(start, qty * 0.35 * 0.2),
manualLinear(start, start + periodToSeconds.year * 4, qty * 0.35 * 0.8),
],
IDO: [
manualCliff(start, qty * 0.2 * 0.3),
manualLinear(start, start + periodToSeconds.year, qty * 0.2 * 0.3),
],
"Magpie Treasury": manualLinear(
start,
start + periodToSeconds.year * 2,
qty * 0.2,
),
"Pendle Treasury": manualLinear(
start,
start + periodToSeconds.year,
qty * 0.1,
),
"Initial Liquidity": manualCliff(start, 0.07),
"Marketing & BD": [
manualCliff(start, qty * 0.05 * 0.2),
manualLinear(start, start + periodToSeconds.year * 2, qty * 0.05 * 0.8),
],
"PENDLE Rush": [
manualCliff(start, qty * 0.03 * 0.3),
manualLinear(start, start + periodToSeconds.year, qty * 0.03 * 0.7),
],
meta: {
sources: ["https://docs.penpiexyz.io/tokens/pnp-token/pnp-distribution"],
token: "ethereum:0x7dedbce5a2e31e4c75f87fea60bf796c17718715",
protocolIds: ["3083"],
},
categories: {
insiders: ["Magpie Treasury", "Pendle Treasury", "Marketing & BD"],
farming: ["Liquidity mining"],
publicSale: ["Initial Liquidity", "PENDLE Rush", "IDO"],
},
};
export default penpie;
2 changes: 1 addition & 1 deletion protocols/premia.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { manualCliff, manualLinear, manualLog } from "../adapters/manual";
import { manualCliff, manualLinear } from "../adapters/manual";
import { Protocol } from "../types/adapters";
import { periodToSeconds } from "../utils/time";

Expand Down
55 changes: 55 additions & 0 deletions protocols/superrare.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { balance } from "../adapters/balance";
import { manualCliff, manualLinear, manualStep } from "../adapters/manual";
import { Protocol } from "../types/adapters";
import { periodToSeconds } from "../utils/time";

const start = 1629154800;
const qty = 1e9;
const token = "0xba5bde662c17e2adff1075610382b9b691296350";
const chain = "ethereum";

const clev: Protocol = {
"Retroactive airdrop": manualCliff(
start + periodToSeconds.day * 90,
qty * 0.15,
),
"Community treasury": [
manualCliff(start, qty * 0.4 * 0.25),
manualStep(start, periodToSeconds.month, 96, (qty * 0.4 * 0.75) / 96),
],
// Team: manualLinear(
// start + periodToSeconds.year,
// start + periodToSeconds.year * 4,
// qty * 0.255,
// ),
// Investors: [
// manualCliff(start, qty * 0.145 * 0.25),
// manualLinear(
// start + periodToSeconds.year,
// start + periodToSeconds.year * 4,
// qty * 0.145 * 0.75,
// ),
// ],
"Team, Investors, Strategic Partners & Future Contributors": balance(
["0x860a80d33E85e97888F1f0C75c6e5BBD60b48DA9"],
token,
chain,
"looksrare",
start + periodToSeconds.day,
),
meta: {
token: `coingecko:superrare`,
sources: [
`https://docs.superrare.com/whitepapers/master/the-rare-token/token-distribution`,
`https://discord.com/channels/666318003972997136/868174870389878865/950417363801624626`,
],
protocolIds: ["1707"],
},
categories: {
insiders: ["Team, Investors, Strategic Partners & Future Contributors"],
noncirculating: ["Community treasury"],
airdrop: ["Retroactive airdrop"],
},
};

export default clev;

0 comments on commit d710565

Please sign in to comment.