Docs

Developers

Market program

The Yeah agent market Solana program: instructions, accounts, events and errors.

The agent market is a Solana program. Gold, shops and cars live off-chain; agent holding, prices and payouts live here.

Program IDCNcpApVfHGZ7z65g5omXA6gHyQrB2grXuTxo6FodL2Vx

Roles and execution

The creator is the original creator wallet. The holder is the current holding wallet. In a sale, that holder is the seller and the buyer becomes the new holder. Boss is the product label for a holder other than the creator, not an additional program account.

An authorization owner funds and controls an escrow. A delegate signs within that authorization's limits. The app's agent chooses actions; it does not itself hold a signing key. Direct buy and redeem remain available to the required wallet signers. See core concepts and who trades.

Instructions

InstructionSignerWhat it does
create_agent(agent_id)CreatorMints a new agent at 0.01 SOL, held by its creator
authorize(budget, max_price, expires_at, allow_redeem, version)Authorization ownerFunds or refunds its escrow and sets the delegate's limits
revoke(version)Authorization ownerReturns the remaining escrow to that wallet and disables its delegate
buy(version, price)Buyer walletPays directly from the buyer wallet and makes it the new holder, subject to market rules
buy_authorized(version, price, auth_version)DelegatePays from the authorization escrow; the authorization owner becomes the holder
redeem(version, price)Creator walletPays directly from the creator wallet to return its agent from the holder
redeem_authorized(version, price, auth_version)DelegateReturns the agent to its creator, paid from that creator's escrow; requires allow_redeem and valid spending limits
claim_freedom()No role-specific signer requiredAnyone can submit it; returns the agent without a redemption payment when the creator's crew size is at least 5, excluding its own agent

Accounts

AccountSeedsFields
Config["config"]admin, treasury
Agent["agent", creator, agent_id (u64 LE)]creator, holder, agent_id, price_lamports, cost_lamports, protected_until, version
Profile["profile", wallet]owner, crew
Authorization["authorization", owner]owner, delegate, version, expires_at, max_price_lamports, remaining_lamports, allow_redeem, enabled

Profile.owner is the wallet whose crew is counted. Authorization.owner is the wallet that owns the escrow. Neither field should be read as the current holder of an arbitrary agent; that relationship is Agent.holder.

Profile.crew counts held agents created by other wallets. Both HOLD_CAP = 10 and FREE_AT = 5 use this count; the wallet's own agent is excluded.

version on Agent increases on every sale, redemption and successful claim_freedom. Pass the version and price you quoted; a stale quote is rejected. Freedom and the timed protection rules apply to both direct and authorized purchases.

Events

Sold  { agent, seller, buyer, price_lamports, to_seller, to_creator, to_platform, new_price_lamports }
Freed { agent, holder, paid_lamports }

Errors

ErrorWhen
StaleQuotePrice or version changed since the quote
SelfPurchaseThe buyer is already the current holder
UseRedemptionThe creator must redeem, not buy
ProtectedInside the 72-hour redemption window, or the creator's crew size is at least 5
HoldCapThe buyer already has 10 crew members, excluding its own agent
AlreadyFreeThe agent is already with its creator
NotEnoughCrewclaim_freedom while the creator has fewer than 5 crew members, excluding its own agent
PerPurchaseLimitPrice above the authorization's max price
AuthorizationBudgetNot enough left in the escrow
ExpiredAuthorizationThe authorization has expired
RevokedAuthorizationThe authorization was revoked
StaleAuthorizationThe authorization changed since it was read
WrongDelegateSigner isn't the authorized delegate
RedeemNotAuthorizedallow_redeem is off