Trading
Buy (simple)
POST
https://www.slay.money/api/trade/buyRequires an API key: Authorization: Bearer spk_…Limit: 60 / min per key
Spend dollars on an outcome, from your API wallet (slay.money/api/keys). The market is words from its title (btc 5m), its id or its link; the outcome is one of its options (up, yes, Lakers; no Lakers bets against). Slay quotes both venues, takes the better one (or the one already holding your money when it's within 3%), moves money there if needed and places the order. Answers when the venue has: 201, or 202 with status: pending after 20 s.
Request
curl -X POST 'https://www.slay.money/api/trade/buy' \
-H 'Authorization: Bearer $SLAY_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"market":"btc 5m","outcome":"up","usd":10,"externalId":"my-0001"}'Body
marketstringrequiredoutcomestringrequiredusdnumberrequiredDollars to spend. Hyperliquid's minimum is $10, Polymarket's $1.
maxPricenumberThe most per share (0.55 or 55). Default: 3c over the book's price for this size.
venuestring One of
hyperliquid, polymarketpaperbooleanPractice with $1,000 of fake money on the live books.
previewbooleanEvery check and the venue it would go to, nothing placed (
status: preview, with quote). externalIdstringYour id for this order (1-64 of A-Z a-z 0-9 . _ : -). A retry with it never places a second order.
Responses
201Placed.
idstringstatusstring One of
filled, partial, unfilled, failed, pending, previewmarketstringoutcomestringvenuestringWhere the order went (or would go, for a preview). One of
hyperliquid, polymarketsharesnumberusdnumberavgPricenumber | nulltoWinnumberBuy: what the shares pay if the outcome wins ($1 each).
offersobjectWhat each venue offered for this order: shares, avgPrice, cost, toWin (or error).
paperbooleanexternalIdstring | nullduplicatebooleanThis is the earlier answer for a retried externalId.
201 response
{
"id": "string",
"status": "filled",
"market": "string",
"outcome": "string",
"venue": "hyperliquid",
"shares": 0,
"usd": 0,
"avgPrice": 0,
"toWin": 0,
"offers": {},
"paper": true,
"externalId": "string",
"duplicate": true
}202Still at the venue (held in-play order): read it with /trade/order/{id}.
400Bad parameters (
code says which).404No open market matches (
market_not_found).409More than one market matches (
ambiguous_market, with matches), nothing to buy at your price (no_liquidity), or not enough in the API wallet (insufficient_balance).