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. Spends from your smart wallet when one is configured, otherwise your EOA.

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 spend-token balance (1–100)
--allSwap entire spend-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 (--quote --json):

{
  "action": "quote",
  "coin": "JACOB",
  "address": "0x9b13358e3a023507e7046c18f508a958cda75f54",
  "spend": {
    "amount": "0.01",
    "raw": "10000000000000000",
    "symbol": "ETH"
  },
  "estimated": {
    "amount": "20.63",
    "raw": "20630000000000000000",
    "symbol": "JACOB"
  },
  "slippage": 1
}

Trade execution response (--yes --json):

{
  "action": "buy",
  "coin": "JACOB",
  "address": "0x9b13358e3a023507e7046c18f508a958cda75f54",
  "spent": {
    "amount": "0.01",
    "raw": "10000000000000000",
    "symbol": "ETH"
  },
  "received": {
    "amount": "20.63",
    "raw": "20630000000000000000",
    "symbol": "JACOB"
  },
  "tx": "0xabc123..."
}