Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

buy

Buy a coin. Requires a wallet.

zora buy [typeOrId] [identifier] [options]

Arguments

ArgumentDescription
typeOrIdType prefix (creator-coin, trend) or coin address/name when used alone
identifierCoin name — only needed when a type prefix is provided

Options

FlagDescriptionDefault
--eth <value>Buy with ETH amount
--usd <value>Buy with USD equivalent
--percent <value>Buy with percentage of token balance
--allSwap entire token balance for coin
--token <asset>Token to spend: eth, usdc, zoraeth
--slippage <pct>Slippage tolerance percent1
--quotePrint quote and exit without trading
--yesSkip confirmation prompt
--debugPrint full request/response JSON
--jsonMachine-readable JSON output

Examples

Buy the jacob creator coin with 0.01 ETH

# By address
npx @zoralabs/cli buy 0x9b13358e3a023507e7046c18f508a958cda75f54 --eth 0.01
 
# By name with type prefix
npx @zoralabs/cli buy creator-coin jacob --eth 0.01
 Buy jacob (creator-coin)
 
 Spend             0.01 ETH
 Estimated receive 20.63 jacob
 Price per coin    $0.000485
 
 Confirm? (y/n)

Buy with USDC

npx @zoralabs/cli buy 0x9b13358e3a023507e7046c18f508a958cda75f54 --usd 10 --token usdc

Buy with 50% of ETH balance

npx @zoralabs/cli buy 0x9b13358e3a023507e7046c18f508a958cda75f54 --percent 50

Get a quote without executing

npx @zoralabs/cli buy 0x9b13358e3a023507e7046c18f508a958cda75f54 --eth 0.05 --quote

Non-interactive for scripting

npx @zoralabs/cli buy 0x9b13358e3a023507e7046c18f508a958cda75f54 --eth 0.01 --yes --json

JSON output

npx @zoralabs/cli buy 0x... --eth 0.01 --yes --json
Quote response:
{
  "action": "quote",
  "coin": "jacob",
  "spendAmount": "0.01",
  "spendToken": "ETH",
  "estimatedReceive": "20.63",
  "pricePerCoin": "0.000485"
}
Trade execution response:
{
  "action": "trade",
  "coin": "jacob",
  "spendAmount": "0.01",
  "spendToken": "ETH",
  "received": "20.63",
  "txHash": "0xabc123...",
  "explorerUrl": "https://basescan.org/tx/0xabc123..."
}