Skip to main content
Donate.gg uses a config-driven donation pipeline. You interact with our on-chain program using metadata from Donation configs: the configId returned by the API is the on-chain routing key. For EVM chains, see EVM.

How it works

1

Create a config via the API

Use the Configs endpoint to create a config that defines your charity beneficiaries and weights. You receive a configId (32-byte identifier) that routes donations to the correct destinations on each chain.
2

Submit the Solana transaction

Call donate_v1 or donate_pubkey_config_id_v1 on the Donation Relay program with the accounts and arguments below.

The Donation Relay program accepts SPL Token and Token-2022 transfers into a per-config, per-mint debouncer account. Donations are accumulated per epoch; the relayer closes epochs and runs distribution (not callable by integrators).

Program ID and IDL

ItemValue
Program IDRLAYHr9TRFcKB2ubYQhspcnXiaGpaVzNQvHytt47RZu
On-chain IDLSolana Explorer (IDL)
The contract has been audited by Halborn and has gone through multiple rounds of review.

Mapping configId from the API

The API returns configId as a bytes32 hex string (often with a 0x prefix). For Solana:
  • donate_v1: pass the 32 bytes as [u8; 32] in the same byte order as the hex literal (left to right after removing 0x).
  • donate_pubkey_config_id_v1: the same 32 bytes interpreted as a Pubkey (convenient when your stack already uses PublicKey types).

Instructions (integrators)

You integrate using one of these two instructions; they share the same account layout and semantics. The only difference is how config_id is encoded in the instruction data.
Instructionconfig_id in argsWhen to use
donate_v1[u8; 32]Matches EVM-style raw bytes from your backend.
donate_pubkey_config_id_v1pubkey (32 bytes)Same logic, ergonomic for Solana PublicKey / Explorer-style tooling.
Both instructions:
  • Transfer amount (base units of mint) from the donor’s token account into the debouncer’s vault for the (config_id, mint) pair.
  • Take tip_bps (0–10000; basis points on the transferred amount, 10000 = 100%).
  • Take message (UTF-8 string; max 255 bytes, not necessarily 255 characters).
  • Take credited_to (pubkey credited for the donation; often the donor’s wallet).
They return / emit DonationMadeV1Event (see Events).

Account metas (order)

Pass accounts in this order (matches the IDL). Several PDAs use init_if_needed; the donor (from) pays rent when accounts or ATAs are created.
#AccountNotes
1epoch_trackerPDA: seeds epoch_tracker_v1 · config_id (32 bytes) · mint.
2debouncerPDA: seeds debouncer_v1 · config_id (32 bytes) · mint.
3debouncer_token_accountATA: debouncer authority, mint, correct token program.
4mintSPL or Token-2022 mint (must pass program mint policy).
5from_token_accountDonor’s ATA for mint (authority = from).
6fromDonor signer; also payer for init_if_needed.
7mint_whitelistPDA: single seed mint_whitelist_v1 (global whitelist account).
8associated_token_programAssociated Token program: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL.
9token_programSPL Token or Token-2022 program, matching mint and accounts.
10system_programSystem program.
11event_authorityPDA: seed __event_authority (Anchor event CPI).
12programDonation Relay program ID (self).
PDAs are derived with the relay program ID as the program id. config_id in seeds is always the 32-byte config identifier (for donate_pubkey_config_id_v1, the same bytes as the Pubkey argument).

Native SOL

The program uses transfer_checked on SPL-style token accounts. There is no direct native-SOL instruction. To donate SOL, use wrapped SOL (WSOL): ensure the donor has a WSOL associated token account with sufficient balance (wrap SOL first if needed), then call donate_v1 / donate_pubkey_config_id_v1 with the WSOL mint.

Mint policy

Mints must either appear on the on-chain mint whitelist PDA or satisfy strict safety checks (for example, no active mint/freeze authority; Token-2022 extensions such as transfer fee, transfer hook, and others are validated). Unsupported or unsafe mints fail with errors such as InvalidMint. If you need a mint allowlisted, coordinate with Donate.gg; updating the whitelist is upsert_mint_whitelist_v1 (relayer-only).

Events

After a successful donation, observe DonationMadeV1Event:
FieldTypeMeaning
daas_event_discriminatorenumEvent family discriminator.
config_id[u8; 32]Config the donation applied to.
mintpubkeyDonated mint.
epochu128Epoch when the donation was recorded.
gross_amountu64Total amount transferred in (base units).
tipu64Tip portion from tip_bps.
messagestringDonor message.
credited_topubkeyCredited party.

Relayer-only instructions (do not integrate)

These require the relayer signer and are not for end-user wallets:
  • close_donation_epoch_v1
  • distribute_non_swap_output_mint_v1
  • swap_then_distribute_v1
  • upsert_mint_whitelist_v1