Skip to main content

📦 Airdrop

This page documents the Airdrop PDA Account.

📘 Overview

The Airdrop Account defines a token distribution event within the Dropsy protocol.
It stores configuration, timing rules, supply, Merkle-based whitelisting, delegation permissions, and links to related accounts such as the Affiliate, Bitmap, and Vesting Accounts.

This account is a zero-copy PDA, enabling highly efficient on-chain reads.


🔐 PDA Derivation

The AirdropMaster PDA is derived using the following seeds:

  • airdrop → constant seed identifying the airdrop namespace
  • authority → the wallet (or program) that owns & manages the airdrop
  • mint → the mint address (airdropped token)
  • id → a unique identifier that enables multiple airdrops to be created by the same authority for the same token mint, improving flexibility and scalability

Derive Airdrop Pda Example

import {
Address,
getAddressEncoder,
getProgramDerivedAddress,
ProgramDerivedAddressBump,
ReadonlyUint8Array,
} from "@solana/kit";

export type DropsyPda = readonly [Address<string>, ProgramDerivedAddressBump];
type Seed = ReadonlyUint8Array | string;

export async function getAirdropDerivedAddress(
authority: Address,
mint: Address,
id?: number,
): Promise<DropsyPda> {
const seeds = [
AIRDROP_SEED,
getAddressEncoder().encode(authority),
getAddressEncoder().encode(mint),
getU64Encoder().encode(id ?? 0),
];
return await getDropsyDerivedAddress(seeds);
}

🧱 Account Structure

FieldTypeDescription
discriminatorReadonlyUint8ArrayAnchor account identifier (8 bytes).
masterAddressReference to the AirdropMaster account that manages protocol-level settings and fees.
authorityAddressWallet authorized to manage and update the airdrop.
mintAddressToken mint being distributed through the airdrop.
delegateAuthorityAddressOptional delegated authority allowed to perform claim-related actions on behalf of the authority.
merkleRootReadonlyUint8ArrayMerkle root used to verify eligible claimants and claim allocations.
idbigintUnique identifier used in PDA derivation to support multiple airdrops for the same authority and mint.
supplybigintTotal amount of tokens allocated to the airdrop.
boostbigintBoost value applied to the airdrop for rewards, points, or protocol-specific incentive calculations.
startsAtbigintUnix timestamp indicating when claiming becomes available.
endsAtbigintUnix timestamp indicating when the airdrop expires and claiming ends.
bitmapCountnumberNumber of Bitmap accounts associated with this airdrop for claim tracking.
statenumberCurrent lifecycle state of the airdrop (e.g. Active, Paused, Closed).
versionnumberAccount version used for upgrades and backward compatibility.
bumpnumberPDA bump used to derive the Airdrop account.
paddingReadonlyUint8ArrayReserved bytes used for account alignment and future upgrades.

📥 Fetch Airdrop Account

import { address } from "@solana/kit";
import { fetchAirdrop } from "@dropsy/sdk";

// The AirdropMaster PDA you want to fetch
const airdrop_address = address("12354.....abndks");

(async () => {
try {
const airdrop = await fetchAirdrop(rpc, airdrop_address);

console.log("Airdrop Loaded:");
console.log("Authority:", airdrop.authority.toString());
} catch (err) {
console.error("Failed to fetch Airdrop:", err);
}
})();