DocsKernel ↗Trade
Opening a market

Opening a market

What you need

  • A Solana keypair with about 0.13 SOL. The site's faucet tops a wallet up to 0.025 SOL only, so the rest comes from Solana's own devnet faucet.
  • The solator CLI, from the ts/ directory of the public repository (Node 22):

`` git clone https://github.com/solatorxyz/xyz-engine && cd xyz-engine/ts && npm install npm run solator -- help ``

The instructions it sends are those of the public program, listed in The program.

  • For a bond, the collateral token in that key's token account.

Create

npm run solator -- market create GOLD --dex xyz --price 2650.5 --cap 250000 --bond 12500

This sends three transactions:

  1. Price feed: a feed named xyz:GOLD/USD that only your key can post to.
  2. Market: the market, its vault, its insurance and the first price.
  3. Order book: one account for resting bids and one for asks.

It then pays the bond, prints the market's address and writes all of its addresses to ./solator-markets/.

OptionMeaning
--priceThe starting price in dollars. Required.
--dexYour prefix, two to six lower-case letters: the market is shown as xyz:GOLD. Without it, the first four characters of your address stand there.
--capOpen-interest cap in dollars at the starting price. Without it there is no cap, and no bond can cover the market.
--freshHow long a posted price is good: 1m (default), 10m or 1h.
--tickfiner or coarser: ten times the default price step either way.
--bondDollars to pay into the market's insurance right away.
--mintThe market's collateral token. The default is the test dollar the site's faucet hands out, 65Y9os6EE8hWreCtd38QvFA4A8thtmVp9NsBwRG9Hsrd. A market on another token works on chain but is not listed on this site.

Then

Start the loop that keeps it alive:

npm run solator -- price run <market> --from url:https://your.server/price.json --json price

A market stops taking new orders when its last price is older than --fresh. See Running a market.

What it costs

Rent on eight accounts, about 0.129 SOL at today's rate. The program closes no account, so treat it as spent. The command reads the rate from the network and shows the total before it sends anything.