The tree vault program
Where the presents live, and the rules nobody can bend
Every present is USDC held by a small Solana program. It has no private key and no admin override.
Only five instructions exist, and before Christmas the only way money leaves is an owner opening their own present.
This page lists every address, every rule and the exact maths, so you can check it all yourself.
Live numbers, read from the chain
What the program guarantees
- The vault has no key. The USDC sits in a token account owned by a program address (a PDA). Nobody holds a private key to it, not the team and not the bot. Only the program's own instructions can move it.
- Before Christmas, the only way out is an owner opening their own present. They must sign with the wallet that owns it, and they get the posted early slice. Nothing else can withdraw.
- The rules are fixed at creation. The dates, the early-opening rates and the $100 per present are written into the tree once. No instruction changes them.
- Every present is paid for on the way in. A present can only be created by moving its full amount of USDC into the vault in the same transaction.
- Adding a present never shrinks anyone else's. A new present starts at exactly $100. It only shares in money left behind by openings that happen after it's under the tree, so nobody (the bot included) can dilute existing presents by adding more.
- Your payout is your present's own value. On Christmas you get exactly what your present is worth: the $100 plus your share of everything left behind while it was wrapped. USDC sent straight to the vault is ignored and swept at the end.
- A present can only be opened once, and only by its owner.
What the bot can and can't do
The bot (the tree's authority) collects creator fees, runs the nice-list draws and puts presents under the tree.
It can
- Add a present for any wallet before Christmas, paying the full $100 into the vault from its own USDC. The new present is worth exactly that, so it takes nothing from anyone else.
- Top up the vault with late fees before Christmas, which grows every present wrapped at that moment (anyone can do this).
- Sweep the vault after the claim deadline (6 January), to re-gift unclaimed presents to holders.
- Sweep the vault from Christmas onwards only if every present has been opened (dust left over from rounding).
It can't
- Withdraw anything before Christmas.
- Open, move or cancel anyone's present.
- Change the dates, the early-opening rates or the present amount.
- Send swept USDC anywhere except its own token account.
- Add presents after Christmas begins.
The maths
A present's value
value = present_amount + (acc_per_present − acc_snapshot) ÷ 10¹²
acc_per_present is a running total on the tree: how much each wrapped present has been given so far by early openings and top-ups. A present records it when it's added (acc_snapshot), so it only counts what happens after it went under the tree. This is the same bookkeeping staking programs use to share out rewards.
Opening early (before 25 Dec 00:00 UTC)
keep_bps = keep_start_bps + (keep_end_bps − keep_start_bps) × elapsed ÷ (christmas − launch)
payout = value × keep_bps ÷ 10,000
left behind = value − payout
acc_per_present += left behind × 10¹² ÷ presents still wrapped
elapsed is the time since launch, clamped between launch and Christmas. With this tree it rises in a straight line from 1% at launch to 50% just before Christmas. All maths is in whole token units, rounded down.
On or after Christmas
payout = value
Every owner gets their own present's value. Presents that waited through more early openings are worth more.
Top-ups
acc_per_present += amount × 10¹² ÷ presents still wrapped
Worked example: openings
| Event | Vault | Wrapped | Each present | Paid out |
| 10 presents added | $1,000.00 | 10 | $100.00 | |
| 5 Dec: one opened (keep 9.16%) | $990.84 | 9 | $110.09 | $9.16 |
| 12 Dec: one opened (keep 23.45%) | $965.02 | 8 | $120.63 | $25.82 |
| 20 Dec: one opened (keep 39.79%) | $917.03 | 7 | $131.00 | $48.00 |
| Christmas: the other 7 claim | $0.00 | 0 | | $131.00 each |
Worked example: a present added late
| Event | Vault | Wrapped | Older presents | New present |
| Mid-December, after some early openings | $950.00 | 5 | $190.00 each | |
| The bot adds a present ($100 in) | $1,050.00 | 6 | $190.00 each | $100.00 |
| Someone opens an older one early, keeping $90 and leaving $100 behind | $960.00 | 5 | $210.00 each | $120.00 |
The first example's numbers come straight from the program's own test suite; the second shows the rule that adding a present never changes anyone else's value, which the suite also tests.
Instructions
The whole program: five instructions, no others.
init_tree
Who: the bot, once. When: before launch.
Creates the tree and its vault, and writes the rules: launch, Christmas and claim-deadline times, the early-opening rates and the amount per present. Rejects bad input: the times must be in order, the rates must satisfy start ≤ end ≤ 100%, and the amount must be above zero.
add_present(owner)
Who: the bot only. When: before 25 Dec 00:00 UTC.
Moves exactly one present's worth of USDC from the bot into the vault and creates the next numbered present for owner. Each present is its own on-chain account, so anyone can list every present and who owns it.
open_present
Who: the present's owner only (their wallet signs). When: until the claim deadline.
Before Christmas, it pays the early slice of this present's value and shares the rest among the presents still wrapped. From Christmas, it pays the present's full value. The USDC goes to the owner's own USDC account, which is created if they don't have one; the owner pays that small rent. The present is marked opened forever.
top_up(amount)
Who: anyone. When: before Christmas, while presents are wrapped.
Adds USDC to the vault and shares it evenly among the presents wrapped at that moment. The bot uses it for fees that arrive after the last draw.
sweep
Who: the bot only. When: after the claim deadline, or from Christmas once every present is opened.
Moves whatever is left in the vault to the bot's own USDC account, to be re-gifted to holders.
Accounts
Tree
PDA seeds: ["tree", authority]
| authority | the bot's wallet |
| usdc_mint | the token presents are paid in (USDC) |
| vault | the token account holding the presents |
| launch_ts · christmas_ts · claim_deadline_ts | the schedule (Unix seconds) |
| keep_start_bps · keep_end_bps | early-opening rates, in basis points |
| present_amount | USDC per present (100 USDC = 100,000,000) |
| present_count · wrapped_count | presents ever added · still wrapped |
| opened_early_count · paid_early | early openings and their total payout |
| acc_per_present | running total given to each wrapped present (× 10¹²) |
| topped_up | total added by top-ups |
Vault
PDA seeds: ["vault", tree]
A USDC token account whose owner is the Tree PDA. Only the program can sign for it.
Present
PDA seeds: ["present", tree, index (u64, little-endian)]
| index | present number, from 0 |
| owner | the only wallet that can open it |
| created_ts | when it went under the tree |
| status | 0 wrapped · 1 opened early · 2 opened at Christmas |
| paid · opened_ts | what it paid and when |
| acc_snapshot | the tree's running total when it was added |
Events and errors
Events
Every instruction emits one, so explorers and indexers can follow the tree:
TreeInitialized: the rules, once
PresentAdded: index, owner, amount, vault balance
PresentOpened: index, owner, early or Christmas, keep rate, value, paid
TreeToppedUp: who, amount, new running total
VaultSwept: amount, presents still wrapped
Errors
| 6000 | InvalidTimes |
| 6001 | InvalidBps |
| 6002 | InvalidPresentAmount |
| 6003 | ChristmasStarted: no new presents |
| 6004 | NotOwner: only the owner can open |
| 6005 | AlreadyOpened |
| 6006 | ClaimWindowClosed |
| 6007 | SweepNotAllowed |
| 6008 | NoWrappedPresents |
| 6009 | MathOverflow |
| 6010 | InvalidTopUpAmount |
Check it yourself
You don't need to trust this page. With the Solana CLI:
Is the program locked?
If it's locked, Authority shows none: nobody can ever change the program again. Solscan shows the same thing as the program's upgrade authority. If the CLI asks for a default signer, add --keypair with any wallet file; it signs nothing.
How much is in the vault?
Every present and its owner
The program's interface
The full interface definition (IDL) is at /idl/xmas_tree.json. Every account and instruction above decodes from it.
Source code
Each draw
Who goes on the nice list is decided off-chain by the bot, from a holder snapshot and a Solana blockhash. Every draw's snapshot is published at /api/draws/<id>/snapshot, so anyone can re-run it and get the same winner.
Limits, stated plainly
- Until the program is locked, its upgrade key could replace it. It gets locked (upgrade key revoked) before real money goes in. The badge at the top of this page and
solana program show tell you which state it's in.
- The draw runs off-chain. The program can't check who the bot puts on the nice list. It can check that every present is paid for, and that nobody but the owner can open it. The published snapshots let anyone audit each draw.
- Older presents end up worth more. Each present only shares in openings that happen while it's wrapped, so a present added on 1 December usually ends up bigger than one added on 20 December. That's deliberate: it stops new presents diluting old ones.
- Unclaimed presents. After the claim deadline the bot can sweep what's left, to re-gift to holders. Open yours before then.
- Rounding. Payouts round down to the smallest USDC unit (0.000001). The leftover dust stays in the vault and is swept at the end.
- No audit yet. The program is small (four instructions) and has a test suite covering every rule above, but it hasn't had an external audit.