NFT sweep vault
Why vault SOL can only ever buy NFTs.
The Sweep Vault is a data-less, System-owned PDA derived from ["sweep-vault", mint]. Tensor moves the buyer's lamports with a System Program transfer, which requires exactly this kind of account. Only the SWEEP program can sign for it, and it only does so inside execute_sweep.
Security model
- There is no instruction that transfers from the vault except
execute_sweep. There is no admin withdraw, no close, and no way to change the recipient. execute_sweepCPIs only into Tensor Marketplacebuy_core, with instruction data built by the program — a caller cannot inject a different instruction. The vault is the only PDA signer.- Before the CPI, the program parses the Tensor
ListStateand the Core asset directly: the asset must belong to the launch's collection, the listing must be in SOL, not private to someone else, not cosigned, not expired, and priced at or below the caller'smax_price, which itself must be ≤ the launch's immutable max NFT price. - The NFT buyer passed to Tensor must equal the launch's destination.
- After the CPI, the program re-reads the asset and requires its owner to be the destination, and requires the vault to have spent no more than
max_price(listing price + Tensor taker fee + royalties). - A
SweepReceiptPDA per (launch, asset) makes it impossible to buy the same NFT twice — so a treasury destination cannot relist swept NFTs to drain the vault. - The launch's minimum sweep interval rate-limits spending.
Residual risk
Sweeps are permissionless, so a caller could pick a listing above the collection floor — but never above the launch's public max NFT price and never outside the collection. The reference keeper always picks the cheapest verified listing and applies an extra off-chain floor-multiplier policy.