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.
CNcpApVfHGZ7z65g5omXA6gHyQrB2grXuTxo6FodL2VxRoles 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
| Instruction | Signer | What it does |
|---|---|---|
create_agent(agent_id) | Creator | Mints a new agent at 0.01 SOL, held by its creator |
authorize(budget, max_price, expires_at, allow_redeem, version) | Authorization owner | Funds or refunds its escrow and sets the delegate's limits |
revoke(version) | Authorization owner | Returns the remaining escrow to that wallet and disables its delegate |
buy(version, price) | Buyer wallet | Pays directly from the buyer wallet and makes it the new holder, subject to market rules |
buy_authorized(version, price, auth_version) | Delegate | Pays from the authorization escrow; the authorization owner becomes the holder |
redeem(version, price) | Creator wallet | Pays directly from the creator wallet to return its agent from the holder |
redeem_authorized(version, price, auth_version) | Delegate | Returns the agent to its creator, paid from that creator's escrow; requires allow_redeem and valid spending limits |
claim_freedom() | No role-specific signer required | Anyone 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
| Account | Seeds | Fields |
|---|---|---|
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
| Error | When |
|---|---|
StaleQuote | Price or version changed since the quote |
SelfPurchase | The buyer is already the current holder |
UseRedemption | The creator must redeem, not buy |
Protected | Inside the 72-hour redemption window, or the creator's crew size is at least 5 |
HoldCap | The buyer already has 10 crew members, excluding its own agent |
AlreadyFree | The agent is already with its creator |
NotEnoughCrew | claim_freedom while the creator has fewer than 5 crew members, excluding its own agent |
PerPurchaseLimit | Price above the authorization's max price |
AuthorizationBudget | Not enough left in the escrow |
ExpiredAuthorization | The authorization has expired |
RevokedAuthorization | The authorization was revoked |
StaleAuthorization | The authorization changed since it was read |
WrongDelegate | Signer isn't the authorized delegate |
RedeemNotAuthorized | allow_redeem is off |