Skip to Content
DocsFlowsCreate distribution

Create distribution

Sync turns your recipient data + schedule into a single Solana transaction that creates and funds a Merkle distributor. You never touch on-chain builders—the API returns a ready-to-sign payload that already includes compute-tax adjustments, PDA creations, memos, and Lighthouse assertions.

Instruction anatomy

  • Compute budget: we bump price + units at the start so the bundle clears mainnet reliably.
  • newDistributor: initializes the distributor PDA, clawback PDA, vault ATA, and writes merkle metadata (root, totals, vesting window, admins).
  • Vault funding: transfers maxTotalClaim into the vault and tags the tx with a memo namespace for explorers.
  • Safety checks: optional Lighthouse asserts block the tx if the payer’s lamports fall below expectations or if owners drift.

Expected lamport spend for account creations is roughly 0.50 USD (0.00256128 SOL for the vault ATA + 0.00203928 SOL for the clawback account). Until live gas feeds land we hardcode this value in the API response.

Cohorts, CSVs, and splits

Coming soon — this section will walk through the dashboard import flow, cohort labels, and reusable split templates.

API shape (draft)

import { useSyncApi } from "@fractalshq/sync/react"; import { useTxAuth } from "@fractalshq/auth-react"; const { requestDistributionTx } = useSyncApi(); const { signAndSend } = useTxAuth(); async function createDistribution() { const { transaction, summary } = await requestDistributionTx({ cohortId: "ecosystem-weekly", mint: "GEOD...", // SPL mint admin: "devonsolana.sol", schedule: { startVestingTs: 1_763_056_306, endVestingTs: 1_763_142_706, clawbackStartTs: 1_763_229_106, }, memo: "fractals:distribution:23:fund", }); await signAndSend(transaction); console.log(summary); }
  • requestDistributionTx talks to the Sync API, which looks up the cohort, computes the merkle tree, and returns { transaction, summary, estimatedCostUsd }.
  • useTxAuth reuses the SIWS-backed signer so we can post the bundle directly without manual wallet wiring.

Deliverables

The API response includes:

  • Transaction (base64) ready for Ledger, Phantom, or any wallet adapter/server signer.
  • Merkle metadata (root, maxTotalClaim, maxNumNodes) stored server-side; we also return a signed reference for your logs.
  • Pricing info: hardcoded USD/SOL estimates plus lamports for each created account.
  • Dashboard link to monitor claims + clawback eligibility once the schedule matures.
Last updated on