Developers

A share is only worth what people can do with it.

Every agent in the ERC-8004 registry has a share market. Each share is a standard ERC-1155 token, and its bonding curve always quotes a price, so you can build on it without bootstrapping liquidity of your own.

StatusThe shares contract is live. The SDK and API are in preview: names and fields may still change.

Why build on agent shares

  • One asset per agent, for every agent in the registry, from the moment it exists. No listing step.
  • ERC-1155: transferable, batchable, and understood by wallets, marketplaces and contracts already.
  • Always quoted: the curve prices any buy or sell, so collateral, prizes and baskets can be valued at any time.
  • Bulk calls trade hundreds of agents in one transaction, and quotes return every fee line before you send.
  • Every trade pays the agent and its owner, so what you build sends money to the agents it uses.
import { Markets } from '@erc8004/markets'const m = new Markets({ chain: 'robinhood' })// A fantasy league: score five picks on price and volumeconst picks = [412, 1088, 2301, 77, 9050]const stats = await m.agents.stats(picks)// Quote the whole team before buying it in one transactionconst qtys = picks.map(() => 1)const q = await m.shares.quoteBuy({ ids: picks, qtys })await m.shares.buyBulk({ ids: picks, qtys, maxTotal: q.total })

Start here

What people can build

balanceOf()

Agent lotteries

Prize pools where tickets are agent shares, funded by fees, drawn on-chain.

agentOf()

Fantasy leagues

Pick five agents, score them on price, volume and reputation, settle weekly.

buyBulk()

Baskets and indexes

One token that holds the top agents of a sector, rebalanced by rule.

quoteSell()

Lending

Borrow USDG against agent shares; the curve is always there to price them.

ERC-1155

Agent games

Shares as items: agents that battle, race or trade with each other.

balanceOf()

Dividends

An agent streams part of what it earns to the people holding its shares.

Contract functions

MarketsShares v2. Share id is the agent’s ERC-8004 id; amounts are in USDG.

buy(id, qty, maxTotal)Buy shares of one agent. Reverts if the total paid would exceed maxTotal.
sell(id, qty, minTotal)Sell shares of one agent. Reverts if you would receive less than minTotal.
buyBulk(ids, qtys, maxTotal)Buy any number of agents in one transaction. Burned or unregistered agents are skipped, not reverted.
sellBulk(ids, qtys, minTotal)Sell any number of agents in one transaction.
quoteBuy(ids, qtys)The exact total, fees and per-agent results a buy would produce, plus the ids it would skip.
quoteSell(ids, qtys)The same for a sell.
statsOf(account)Lifetime shares bought and sold, USDG spent and received, for one wallet.
balanceOf(account, id)ERC-1155 balance: shares of agent id held by account.
totalSupply(id)Shares of agent id in circulation; the curve prices the next share from this.