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
| Argument | Description |
|---|---|
typeOrId | Type prefix (creator-coin, trend) or coin address/name when used alone |
identifier | Coin name — only needed when a type prefix is provided |
Options
| Flag | Description | Default |
|---|---|---|
--eth <value> | Buy with ETH amount | — |
--usd <value> | Buy with USD equivalent | — |
--percent <value> | Buy with percentage of spend-token balance (1–100) | — |
--all | Swap entire spend-token balance for coin | — |
--token <asset> | Token to spend: eth, usdc, zora | eth |
--slippage <pct> | Slippage tolerance percent | 1 |
--quote | Print quote and exit without trading | — |
--yes | Skip confirmation prompt | — |
--debug | Print full request/response JSON | — |
--json | Machine-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 usdcBuy with 50% of ETH balance
npx @zoralabs/cli buy 0x9b13358e3a023507e7046c18f508a958cda75f54 --percent 50Get a quote without executing
npx @zoralabs/cli buy 0x9b13358e3a023507e7046c18f508a958cda75f54 --eth 0.05 --quoteNon-interactive for scripting
npx @zoralabs/cli buy 0x9b13358e3a023507e7046c18f508a958cda75f54 --eth 0.01 --yes --jsonJSON output
npx @zoralabs/cli buy 0x... --eth 0.01 --yes --jsonQuote 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..."
}