Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions protocols/cloud.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CliffAdapterResult, Protocol } from "../types/adapters";
import { manualCliff, manualLinear } from "../adapters/manual";
import { periodToSeconds } from "../utils/time";
import { queryDune } from "../utils/dune";
import { queryDuneSQLCached } from "../utils/dune";

const start = 1721260800;
const totalSupply = 1_000_000_000; // 1B total supply
Expand All @@ -19,17 +19,15 @@ const initialAirdrop = launchLiquidity * 0.5; // 10% of total supply
const launchPool = launchLiquidity * 0.5; // 10% of total supply

const communityReserve = async (): Promise<CliffAdapterResult[]> => {
const result: CliffAdapterResult[] = [];
const issuanceData = await queryDune("5189738", true)

for (let i = 0; i < issuanceData.length; i++) {
result.push({
type: "cliff",
start: new Date(issuanceData[i].block_date).getTime() / 1000,
amount: issuanceData[i].amount / 1e9
});
}
return result;
return await queryDuneSQLCached(`
SELECT
to_unixtime(block_date) AS date,
amount_display AS amount
FROM tokens_solana.transfers
WHERE from_token_account IN ('Ay1sXM9gG1ZFARXr1TowweUyhbZrj3BMcX5Zb4HgbcKr', '9uyCjS84BfeF56WbANu2xHFtrjTe7GsSpLzMJ4adWNXY')
AND block_date >= START
ORDER BY block_date
`, 1721174400, {protocolSlug: "sanctum", allocation: "Community Reserve"})
}

const cloud: Protocol = {
Expand Down
Loading