diff --git a/wipProtocols/raydium.ts b/wipProtocols/raydium.ts index 7228a96..c2b262e 100644 --- a/wipProtocols/raydium.ts +++ b/wipProtocols/raydium.ts @@ -1,29 +1,42 @@ import { Protocol } from "../types/adapters"; -import { manualLinear } from "../adapters/manual"; +import { manualLinear, manualCliff } from "../adapters/manual"; import { periodToSeconds } from "../utils/time"; -const totalSupply = 555_000_000; // Total RAY Supply -const RAY_TGE = 1613865600; // RAY token TGE in UNIX timestamp +const totalSupply = 555_000_000; +const RAY_TGE = 1613865600; // Sunday, February 21, 2021 // Allocations -const miningReserveAllocation = totalSupply * 0.34; // 34% +const miningReserveTotalAllocation = totalSupply * 0.34; // 34% const partnershipEcosystemAllocation = totalSupply * 0.30; // 30% const teamAllocation = totalSupply * 0.20; // 20% const liquidityAllocation = totalSupply * 0.08; // 8% const communitySeedAllocation = totalSupply * 0.06; // 6% const advisorsAllocation = totalSupply * 0.02; // 2% +// Custom function for Mining Reserve with halving +function miningReserveVesting() { + let vestingSchedules = []; + let remainingAllocation = miningReserveTotalAllocation; + let currentStart = RAY_TGE; + const halvingPeriod = periodToSeconds.month * 6; + + for (let i = 0; i < 6; i++) { // 6 periods of 6 months each + let periodAllocation = remainingAllocation / (6 - i); // Dividing remaining allocation equally among remaining periods + vestingSchedules.push(manualLinear(currentStart, currentStart + halvingPeriod, periodAllocation)); + + currentStart += halvingPeriod; + remainingAllocation -= periodAllocation; + } + + return vestingSchedules; +} + const raydium: Protocol = { - "Liquidity": manualLinear( + "Liquidity": manualCliff( RAY_TGE, - RAY_TGE + periodToSeconds.year * 3, liquidityAllocation ), - "Mining Reserve": manualLinear( - RAY_TGE, - RAY_TGE + periodToSeconds.year * 3, - miningReserveAllocation - ), + "Mining Reserve": miningReserveVesting(), "Partnership & Ecosystem": manualLinear( RAY_TGE, RAY_TGE + periodToSeconds.year * 3, @@ -44,16 +57,15 @@ const raydium: Protocol = { RAY_TGE + periodToSeconds.year * 3, advisorsAllocation ), - meta: { - token: "solana:4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R", // RAY Solana SPL address + token: "solana:4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R", sources: [ "https://docs.raydium.io/raydium/ray_token/the-ray-token" ], protocolIds: ["214"], }, categories: { - insiders: ["Advisors", "Community & Seed", "Team"], + insiders: ["Team", "Advisors", "Community & Seed"], noncirculating: ["Partnership & Ecosystem"], farming: ["Mining Reserve"], liquidity: ["Liquidity"]