Venue Kit
Venue Kit
Set up a venue for event markets in a few commands with the Somnia CLI: register the venue, create its markets from a question file and copy a front end wired to it.
Your venue in a few commands.
The Venue Kit is the somnia venue command group in the Somnia CLI, from version 0.1.0. It registers your venue on Somnia Markets, creates markets on it from a question file, and copies a front end wired to it. The commands and the front end are built and published; an agent skill is not yet (see Not in the kit yet). Every step is an ordinary transaction signed by your own key, so the venue is the same one you would get by building it on the Markets SDK yourself.
Before you start
- The CLI. Node.js 22 or newer, then
npm install -g @somnia-chain/cli. To run it without installing, putnpx @somnia-chain/cliin place ofsomniabelow. - A key. Writes sign with a key from the environment, such as
SOMNIA_PRIVATE_KEY, or from your system keychain, never from a flag. See Signing. - Testnet funds. STT pays the gas and each market's oracle cost on the Global testnet. See how to get testnet funds.
The CLI goes to mainnet unless you pass --network testnet. Start on testnet, then run the same commands with --network mainnet.
Set up a venue
# 1. Register an operator, deploy the venue's market policy and create the venue
somnia venue create --network testnet --fee 0.5 --name my-venue
# 2. Create markets on it from a question file
somnia venue markets add --from question.json --network testnet
# 3. Copy a front end wired to the venue, then run it
somnia venue init my-venue --network testnet
cd my-venue && pnpm install && pnpm dev
venue create saves the venue to ./somnia-venue.json, by chain id, so the commands after it find the venue with no ids. Run them from the same folder, or pass --operator and --venue to act on another venue.
You can also run venue init first. The front end's .env.local then has no venue in it, and you fill in its operator and venue ids after venue create.
Create the venue
somnia venue create sends up to three transactions: it registers an operator for your key (once; --operator reuses one you own), deploys a market policy unless the venue is open, and creates the venue. The venue hosts event (binary) markets; its market type is fixed when it's created.
| Flag | Default | What it sets |
|---|---|---|
--fee <percent> |
0 |
The venue fee, up to two decimals (0.5 is 0.5%). It is charged on taker fills and paid to the fee recipient. The protocol caps it. |
--fee-recipient <address> |
the operator's | The address that receives the venue fee. |
--policy |
allowlist |
Who may create markets: operator (you only), allowlist (you and the accounts you allow) or open (anyone). |
--operator <id> |
a new operator | Create the venue under an operator you already own. |
--name <name> |
none | A name stored onchain with the venue. The front end shows it. |
Add markets
somnia venue markets add --from <file> creates one market for each question in the file, which holds one question object or an array of them. Each market schedules its oracle question in the same transaction.
A price market resolves YES when the asset's USDC price at expiry is at or above the strike, read from six exchanges' 1-minute candles, of which four must agree. Its expiry is rounded up to a whole minute.
[{ "type": "price", "asset": "BTC", "strike": 100000, "expiry": "+1d" }]
A custom market resolves YES when the number its sources report at expiry is at or above the strike. Half the sources, rounded up, must agree unless minAgreement says otherwise.
[
{
"type": "custom",
"question": "Will the index close at or above 3,000?",
"strike": 3000,
"decimals": 2,
"expiry": "2026-12-31T16:00:00Z",
"sources": [{ "url": "https://example.com/api/index", "path": "data.price" }]
}
]
expiry takes an ISO date, unix seconds, or a time from now such as +30m, +2h or +1d.
Each market attaches the oracle's scheduling cost plus a resolution reserve, paid in SOMI (STT on testnet). The part of the reserve its resolution doesn't use comes back to the operator, and the CLI prints what each market attached. Your venue's policy must let your key create markets.
Run the venue
| Command | What it does |
|---|---|
somnia venue markets list |
Your venue's markets from the indexer, newest first |
somnia venue fee set --fee <percent> |
Change the venue fee. A market keeps the fee it was created with, so only new markets change. |
somnia venue policy allow <account> |
Let an account create markets on an allowlist venue (policy deny stops it) |
somnia venue status |
Your venue as the indexer sees it; somnia venues show decodes its fees |
The front end
somnia venue init <name> copies a Next.js app into a new folder and writes its .env.local for the network you pass. The app connects a wallet, lists your venue's markets from the indexer, reads books and status from the chain, and places orders. It's a starting point for your own brand: change it as you like.
See it in use
- A venue made with the kit.
docs-venue-kit-exampleon the Global testnet (pick Global testnet in the Explorer if it shows another chain), created with the commands on this page: operator 27, an allowlist policy and a BTC price market beside a custom one. - Venues in Somnia Explorer. Every venue and operator, what they trade, their fees and who may create markets on them.
Use it from the CLI and MCP
The Venue Kit is the CLI, so every step above runs from a terminal or a script. To read any venue, yours or another's:
somnia venues list --network testnet # every venue, oldest first
somnia venues show 0x80297e42d771e0a850946633587b53deb97a79d5f71c1f75037d5ea734f04b09 --network testnet # one venue, fees decoded
The MCP server has no tool that reads one venue, so an agent runs somnia venues list and somnia venues show in a shell for that. Its venue_health tool grades Somnia Markets as a whole (the indexer, the chain and the price feed), not your venue, and its somnia_find and somnia_help tools find the somnia venue command for a task. It never signs, so it can't create a venue or its markets: an agent runs those commands in a shell too, where the CLI signs as usual. Every command's --help is written for agents as well as people.
Not in the kit yet
- Spot and perp venues. The kit creates venues for event markets. A spot front end can earn a builder fee on the orders it routes; see the Markets SDK.
- Liquidity. A new market's book starts empty. Quote it with your own desk, or ask the Somnia team about market making.
- An agent skill. There is no packaged agent skill for the kit yet; agents use the CLI, as above.