Documentation

How DefiMart works

DefiMart is an on-chain marketplace for event culture — verified merch and collectibles from the Solana events you actually showed up to. This page explains the whole protocol in plain language: where authenticity comes from, how your money is protected, and what each piece does.

Overview

A marketplace where trust is built in

Buying merch from a stranger online is a leap of faith. You send money first and hope the item shows up, hope it's real, hope it's not a knockoff. DefiMart removes the hoping. Three things are guaranteed by code running on Solana rather than by a company's promise:

  • Provenance — every official item ties back to a verified, on-chain event record.
  • Escrow — your payment is locked in a program-owned vault until you confirm the item arrived.
  • Reputation — settled trades are recorded on-chain, so a seller's track record can't be faked.

There's no central account holding everyone's funds and no chargebacks. The rest of this page walks through how that actually works, program by program.

Architecture

The four programs

DefiMart is four small Solana programs, each with one job. They reference each other but stay independent, so each is simple to audit and reason about.

event-registry

The source of truth for events.

Organizers register an event on-chain; the platform then verifies it. Merch points back to this record, so a buyer can prove a drop came from a real, vetted event.

merch-mint

Mints official 1-of-1 merch.

An organizer mints a unique NFT into their event's collection and marks it as a genuine member. That's the on-chain certificate of authenticity for a physical or digital item.

marketplace

The on-chain listing book.

Holds each listing's seller, price, currency, and remaining stock — plus the platform fee. Nobody can quietly rewrite a price or pretend stock exists.

escrow

Holds the money during a trade.

Funds sit in a program-owned vault from purchase until you confirm the item arrived. No person — not the seller, not DefiMart — can pull them early.

event-registry

Provenance starts with the event

Authenticity has to start somewhere real. On DefiMart it starts with the event itself. Anyone can register an event on-chain as its organizer — that creates an event record holding the organizer's wallet, a slug, and a name. It starts unverified.

A platform authority then verifies the event, flipping a single trusted flag. If fraud surfaces later, that same authority can revoke verification. The organizer also attaches a collection mint to the event — the on-chain collection that all of its official merch will belong to.

Verification is the one deliberately centralized step: a human vouches that an event is genuine. Everything downstream — minting, listing, escrow — is then trustless and tied back to this record.

merch-mint

Verified merch is a 1-of-1 NFT

When an organizer creates an official item, the merch-mint program mints a unique NFT (a true 1/1 — supply of one, zero further editions) and writes its name, symbol, and metadata link on-chain. The NFT points at the event's collection.

Pointing at a collection isn't enough on its own — anyone could claim to belong to it. So the collection's authority signs a second step that verifies the item as a genuine member. Only after that does the marketplace show the green verified badge. A buyer can confirm the membership themselves; they don't have to trust the listing's word.

marketplace

Listings live on-chain

A listing's important facts — seller, price, currency, total quantity, and how many have sold — are stored in the marketplace program, not just in a database. That means they can be trusted without trusting DefiMart's backend.

  • The seller can update the price or cancel — but only while the listing is Active.
  • Each sale decrements remaining stock on-chain, so a listing can never sell more than it has.
  • When the last unit sells, the listing automatically flips to Sold.

A single marketplace config holds the platform fee and the fee recipient, set by an admin and capped in code at 10% so it can never be cranked to something absurd.

escrow

A real trade, step by step

This is the heart of it. Instead of a company holding a wallet full of everyone's money, each trade gets its own vault — a token account whose only controller is the escrow program's logic. There is no private key for anyone to steal or abuse.

01

Buyer pays into escrow

At checkout the buyer's stablecoins move into a vault the escrow program owns. The escrow record is marked Funded. The seller can see the money is locked but cannot touch it.

02

Seller ships the item

Knowing payment is secured, the seller sends the merch. The listing's remaining quantity is recorded on-chain so stock can't be oversold.

03

Buyer confirms receipt

When the item lands, the buyer signs a release. The vault pays the seller and the record flips to Released — instantly, with no middleman holding the cash.

04

Or it gets refunded

If the deal falls through, the seller (or a neutral arbiter in a dispute) signs a refund and the money returns to the buyer. The record flips to Refunded.

The three states

FundedReleased→ sellerorRefunded→ buyer

An escrow only ever moves from Funded to one of the two final states, and only the right party can trigger each move: the buyer or arbiter can release to the seller; the seller or arbiter can refund the buyer. The program also refuses obvious nonsense — a zero amount, or a buyer trying to trade with themselves.

Payments

Currencies & fees

Listings can be priced in SOL or in one of three stablecoins. Escrow handles the stablecoin (SPL token) side:

SOLUSDCPYUSDEURC

The platform charges a percentage fee, set by an admin and recorded on-chain as basis points. It is hard-capped at 10% in the program itself — the cap isn't a policy promise, it's enforced by code, so no admin can exceed it.

Guarantees

Why it's safe

No custodial key

Funds sit in a program-owned vault. There's no admin keypair that controls the money, so there's nothing to leak or rug.

Buyer holds release

Money only reaches the seller when the buyer (or arbiter) signs for it. Shipping first is safe.

Verifiable authenticity

Official merch is a verified member of an event's on-chain collection — checkable by anyone.

No chargebacks

Settlement is final and on-chain. No surprise reversals weeks later, for buyer or seller.

FAQ

Common questions

Who controls my money during a trade?

No single person. The funds live in a program-derived vault — a Solana account whose only authority is the escrow program's own logic. The seller, the buyer, and DefiMart all lack the private key, because there isn't one.

What stops a seller from taking the money and never shipping?

Release only happens when the buyer (or an arbiter) signs for it. Until then the seller's only options are to wait or to refund you. They can never move funds to themselves unilaterally.

What if the seller never ships and never refunds?

An optional arbiter is recorded on every escrow. In a dispute the arbiter can sign the refund back to the buyer or the release to the seller — whichever the evidence supports.

How do I know merch is authentic?

Genuine drops are minted into an event's verified on-chain collection. The marketplace shows that verified badge, and you can check the collection membership yourself on-chain.

Can a seller fake a price or fake stock?

No. Price, currency, and remaining quantity live in the marketplace program. Each sale decrements stock on-chain, so a listing can't sell more than it has.