How to run an NFT auction on Solana without a smart contract
An auction that people trust does four things without anyone’s help: it holds the highest bid, refunds whoever is outbid, stretches when a bid lands in the last minutes, and hands over the lot at the end. Here those are fields of one JSON file on loot, a Solana program every project shares.
Devnet by default. Everything on this page runs on Solana devnet, where nothing is real money. The same file runs on mainnet when it says "network": "mainnet", and then it is real money. The program, loot, has not been independently audited. The fees quoted are devnet’s: the player fee is 0.002 SOL there and 0.0005 SOL on mainnet (read from the chain on 2026-11-21; the platform sets it, and the program caps it at 0.01 SOL).
What you need
Node 22 or later. No Rust, no Anchor, no Solana CLI. With an AI coding agent you type a sentence and it runs the commands below; the toolkit’s page has the install lines.
1. Say what you want
“I’m an artist selling a 1 of 1 piece. Highest bid after 24 hours wins it, in SOL, and anyone who is outbid gets their money back automatically. A late bid should give others ten more minutes. Each bid at least 5% over the last, and 10% of the sale goes to my collaborator.”
npx -y @xgamesfun/solana@0.29.3 examples auction for a 1 of 1 artwork2. The spec
{
"version": 2,
"network": "devnet",
"name": "Sunset Auction",
"currency": "sol",
"tokens": [{ "key": "sol", "source": "sol" }],
"collection": { "name": "Sunset Studio", "royaltyPercent": 5 },
"items": [
{ "key": "sunset", "name": "Sunset, 1 of 1", "rarity": "Mythic", "supply": 1, "uri": "<a link to its metadata>" }
],
"auctions": [
{
"key": "sunset",
"name": "Sunset, 1 of 1",
"lot": { "item": "sunset" },
"reserve": 0.5,
"minRaise": 5,
"runs": "24h",
"extendBy": "10m",
"split": [{ "to": "account:<your collaborator's SOL account>", "percent": 10 }]
}
],
"scenario": { "days": 1, "perDay": { "auction:sunset": 12 } }
}lotis one new unit of the item, minted to the winner at the end. For an NFT you already hold, the lot is{ "asset": "<its address>" }: any Metaplex Core NFT in the owner’s wallet.reserveis the least first bid, andminRaisehow much each bid must top the last by, in percent.runsis how long bids stay open, andextendBywhat a late bid adds.splitsends 10% of the winning bid to a collaborator. The rest goes to the treasury.
3. Check it
npx -y @xgamesfun/solana@0.29.3 check xsolana.jsonThis spec is ready, with two warnings. The collaborator’s share goes to the treasury for as long as no SOL account exists at the address you named. And anyone, the seller and the project included, can bid to push the price up: the program cannot tell them apart.
4. See where it ends
npx -y @xgamesfun/solana@0.29.3 simulate xsolana.jsonAuction “Sunset, 1 of 1”: about 12 bids over 1 days at a 5% least raise end near 0.855169679 SOL (from
a reserve of 0.5), of which the split takes 10%; every outbid bidder has their bid back at once.5. Price it
npx -y @xgamesfun/solana@0.29.3 cost xsolana.jsonGoing live takes 3 transactions and about 0.014715646 SOL:
rent 0.01464564 SOL for 8 accounts; program fees 0.00005 SOL; network fees 0.000020006 SOL.
…
bid on “Sunset, 1 of 1” (player): 0.002 SOL fee + 0.000005 SOL network. Nothing to deposit: the bid
waits in the game’s vault, and goes back at once when it is topped.
end “Sunset, 1 of 1” (anyone (the winner, a keeper)): 0.000005 SOL network; 0.0031 SOL for the new
collectible (back: never: it is the collectible’s own rent, paid by whoever ends it). …(… marks where the output is cut.)
6. Read it the way a cheater would
npx -y @xgamesfun/solana@0.29.3 review xsolana.json- auction “Sunset, 1 of 1” (auction:sunset)
Who: any wallet that bids
The program keeps: a reserve of 0.5; each bid 5 over the last; runs 24h; an outbid is paid back at once
Trusts off the chain: nothing
Most one cheater gets: The lot, for the highest bid: nothing free. Anyone, the seller included, can
bid the price up.7. Go live, signed on your own computer
npx -y @xgamesfun/solana@0.29.3 keygen ~/.config/xsolana/auction.json
npx -y @xgamesfun/solana@0.29.3 approve xsolana.json --keypair ~/.config/xsolana/auction.jsonkeygen makes a key file for the project and prints its address, never the key. approve lists every transaction and what it pays, ends with a code, and sends nothing; run it again with --yes and that code to send exactly what it listed. The auction opens when the economy goes live, unless the spec names a later start.
8. Take bids on your page
npm install @xgamesfun/solanaimport { solanaApp, walletStandardSigner } from '@xgamesfun/solana/play';
const spec = await (await fetch('./xsolana.json')).json(); // the live spec, served with the page
const app = solanaApp({ spec, rpcUrl: 'https://api.devnet.solana.com', wallet: walletStandardSigner(wallet, account) });
await app.auctions(); // each auction: high, nextBid, leading, secondsLeft, open, over, waiting (SOL)
await app.bid('sunset', '0.6'); // the bid it tops goes back to its bidder in the same transaction
await app.endAuction('sunset'); // once it is over, anyone: the lot to the winner
await app.unwrap(); // SOL back from a bid that was topped, from wrapped SOL to plain SOLOnce the time is up, anyone may end the auction: the winner’s page, or a keeper of yours. The app reference shows a whole page.
What else an auction can do
- Bids in any token. Your own coin in place of SOL.
- A mystery lot. The winner gets a roll of one of your loot boxes.
- Bids of NFTs. A bid is a bundle of NFTs, and the largest bundle wins.
- A gate. Only holders of a collection, or wallets on a list, may bid.
Other ways to run one
- A marketplace. An NFT marketplace that runs auctions lists your NFT on its own pages, under its fees and rules, in front of its audience. That is not an auction inside your own site or game.
- Your own program. An Anchor program does what you write. The refund of every outbid bidder, the late-bid extension and the hand-over at the end are the parts to get right, and to audit.
- A shared program, as here. The auction runs on your page by rules you can read before you go live. The trade-off: it can only be what the spec can say.
Questions people ask
How do I auction an NFT on Solana without writing a program?
Write an auction in an xsolana spec: the lot, a reserve, the least raise, how long it runs. Run xsolana check, then put it live with a key file on your own computer. Bids come from your own page, and the auction runs on loot, one Solana program that every project shares.
What happens to a bid when someone bids higher?
It goes back to its bidder at once, in the same transaction as the higher bid. Nobody has to claim a refund. A bid in SOL comes back as wrapped SOL, which one call turns into plain SOL again.
Can I stop sniping in the last seconds?
Yes. "extendBy" moves the end: a bid in the last ten minutes, say, pushes the end to ten minutes after that bid. It is on by default at 10 minutes, and 0 turns it off.
What can be the lot?
One new unit of an item the project mints, given to the winner when the auction ends; a Metaplex Core NFT that the owner’s wallet already holds; or a roll of one of the project’s loot boxes, a mystery lot.
Can the seller bid on their own auction to push the price up?
Yes, and the program cannot tell. Anyone can bid, the seller included. The checker says so for every auction. A reserve is the honest way to set a floor, and bidders should be told it is possible.
What does an auction cost?
This one takes 3 transactions and about 0.0147 SOL to put live. Each bid costs a player fee (0.002 SOL on devnet, 0.0005 SOL on mainnet today) and a network fee, with nothing else to deposit. Whoever ends the auction pays about 0.0031 SOL, the new collectible’s own rent.
Can the sale be split with a collaborator, or paid in my own token?
Yes. Up to four shares of the winning bid go where the spec says: a collaborator’s account, a pool, a burn. What they leave goes to the treasury. Bids can be in SOL or in any token.
Does it run on mainnet?
Yes. The same file runs on mainnet when it says "network": "mainnet", and then every bid is real money. The program has not been independently audited, so run an auction on devnet first.
More how-tos
- Make a loot box or gacha: Odds, prizes and a roll nobody can steer, in one JSON file.
- Add NFT staking: Lock tiers and rewards for any collection, one you did not mint too.
- Run an NFT raffle or a lottery: The winner gets the NFT before the seller is paid; a short round refunds.
- Run an airdrop people claim: A list of wallets with an amount each; only its Merkle root goes on chain.
- Pay players token rewards: A server that checks, a voucher it signs, and caps a leaked key cannot pass.
- Add Solana to a browser game: Payments, loot boxes and token rewards in a game you already made.
- Solana MCP servers and plugins, by job: Which one for docs, programs, chain data, NFTs, wallets, trading and economies.
- Host a web game with xcore: A link anyone can play, with sign-in, saves, multiplayer and an economy.
- The whole toolkit: what else it builds, and how to install it in Claude Code, Codex, Cursor or a chat app.
Checked against @xgamesfun/solana 0.29.3 on 2026-11-21.