Skip to content

Cookbook: build every bot type

Copy-paste examples, as MCP tool calls and as curl, to build a grid, short, neutral and spot grid, DCA, QFL, Ladder, arbitrage, Funding and spot hedge bot.

On this page

Every example shows the MCP tool call (the tool name and its arguments) and the same call as curl. In the curl examples $API is https://app.prowdex.com/api/v1 and $PROW_KEY is your key.

The prices in the examples are only examples. A grid must sit around the market's price today, so before you use one, ask Prow for a live example of the same shape (the first recipe): get_bot_type_schema with the venue and the market returns settings at today's price that already pass validation. Never copy a price from this page into a real bot. The examples on this page are checked against Prow's own validator with a mocked price, and the docs test fails if one stops passing.

Every tool that saves, changes or deletes something accepts an idempotency_key in MCP and an Idempotency-Key header in REST. Send the same key and the same arguments when you retry: the action then happens once.

Before you build: a connected account

Every recipe on this page that saves a draft needs an account of that venue connected in Prow (get_bot_type_schema, validate_bot_config and list_bot_types need none to read). Without one the answer is a refusal with the code no_account, and details.fix_url links to where the user connects it:

json
{ "error": { "code": "no_account", "message": "Connect your Hyperliquid account in Prow first. A bot needs an account.", "details": { "fix_url": "https://app.prowdex.com/bots/new" }, "request_id": "req_abc123" } }

With more than one account on the venue the answer is account_required and lists them: send account_id.

Get a live example first

This returns the settings of the type, plain help for each field and an example at today's price that already passes validation. Change only what you want to change.

json
{ "name": "get_bot_type_schema", "arguments": { "type": "grid", "venue": "hyperliquid", "market": "BTC", "direction": "long" } }
bash
curl -sS "$API/bot-types/grid?venue=hyperliquid&market=BTC&direction=long" -H "x-api-key: $PROW_KEY"

type is one of grid, dca, ladder, arbitrage, funding, hedge. list_bot_types (GET /bot-types) shows which types are on for you. A type that is off in Prow is off here too.

Start from a ready setting

Prow ships ready settings for a market (a grid or DCA with its range, stop and take profit already chosen). list_ready_bot_settings lists them for a venue and market, each with a setting_id such as grid-long~mid, the minimum investment and its take profit and loss limit. draft_bot then returns a confirm_url that opens Prow with that setting, and shows your amount back to you (you type the amount in Prow). It is read-only: it saves nothing and starts nothing, so there is no draft id and it needs no idempotency key. Use create_bot_draft when you want your own settings saved as a draft.

json
{ "name": "draft_bot", "arguments": { "venue": "hyperliquid", "market": "BTC", "setting_id": "grid-long~mid", "amount_usd": 200 } }
bash
curl -sS -X POST "$API/bot-drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" -d '{"venue":"hyperliquid","market":"BTC","setting_id":"grid-long~mid","amount_usd":200}'

Start a grid on BTC on Hyperliquid

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

A long grid buys as the price falls and sells as it rises inside the range. It needs a stop below the range (slLow).

These prices are examples and will not pass today. Take a live example from get_bot_type_schema (same venue, market and direction), change only what you want, and send that.

json
{
  "name": "create_bot_draft",
  "arguments": {
    "venue": "hyperliquid",
    "market": "BTC",
    "draft": {
      "type": "grid", "direction": "long", "investment": 200, "leverage": 2,
      "lower": 90000, "upper": 100000, "count": 20, "spacing": "geometric",
      "slLow": 87000, "takeProfitPct": 15
    },
    "idempotency_key": "btc-grid-hl-0001"
  }
}
bash
curl -sS -X POST "$API/bots/drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -H "Idempotency-Key: btc-grid-hl-0001" \
  -d '{"venue":"hyperliquid","market":"BTC","draft":{"type":"grid","direction":"long","investment":200,"leverage":2,"lower":90000,"upper":100000,"count":20,"spacing":"geometric","slLow":87000,"takeProfitPct":15}}'

The answer has bot_id, created (true for a new draft), the settings Prow would use, a summary (money in use, profit per grid, minimum investment, liquidation price), the limits you sign, and confirm_url. Open confirm_url in Prow to review and start. To check without saving, call validate_bot_config (POST /bot-config/validate) with the same arguments.

Pick an investment that passes in one step. The least investment the settings accept comes back as min_investment (with min_investment_currency, rounded up to the cent, so sending that amount passes) from validate_bot_config, in details.min_investment of an invalid_settings answer for a too-small order, and from get_bot_type_schema next to its live example. It depends on the settings (levels, range, leverage), so read it again after you change them: raise investment to at least min_investment instead of guessing from the sentence "Minimum investment for these settings".

The same grid on Aster

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

Only the venue changes. Name the market as list_markets names it: BTC. A market quoted in another currency is written BTC-USD1.

These prices are examples and will not pass today. Take a live example from get_bot_type_schema (same venue, market and direction), change only what you want, and send that.

json
{
  "name": "create_bot_draft",
  "arguments": {
    "venue": "aster",
    "market": "BTC",
    "draft": {
      "type": "grid", "direction": "long", "investment": 200, "leverage": 2,
      "lower": 90000, "upper": 100000, "count": 20, "slLow": 87000
    }
  }
}
bash
curl -sS -X POST "$API/bots/drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"venue":"aster","market":"BTC","draft":{"type":"grid","direction":"long","investment":200,"leverage":2,"lower":90000,"upper":100000,"count":20,"slLow":87000}}'

Aster allows at most 100 levels, Hyperliquid 150. If you have more than one account on a venue, add account_id (the error lists them).

A short grid

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

A short grid sells as the price rises. The stop goes above the range (slHigh) and there is no slLow. Short and neutral grids run only on the deepest markets; on another market the answer says advanced_top_only.

These prices are examples and will not pass today. Take a live example from get_bot_type_schema (same venue, market and direction), change only what you want, and send that.

json
{
  "name": "create_bot_draft",
  "arguments": {
    "venue": "hyperliquid",
    "market": "BTC",
    "draft": {
      "type": "grid", "direction": "short", "investment": 200, "leverage": 2,
      "lower": 90000, "upper": 100000, "count": 20,
      "slHigh": 103000, "takeProfitPct": 15
    }
  }
}
bash
curl -sS -X POST "$API/bots/drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"venue":"hyperliquid","market":"BTC","draft":{"type":"grid","direction":"short","investment":200,"leverage":2,"lower":90000,"upper":100000,"count":20,"slHigh":103000,"takeProfitPct":15}}'

A neutral grid

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

A neutral grid buys below the price and sells above it. It needs both stops.

These prices are examples and will not pass today. Take a live example from get_bot_type_schema (same venue, market and direction), change only what you want, and send that.

json
{
  "name": "create_bot_draft",
  "arguments": {
    "venue": "hyperliquid",
    "market": "BTC",
    "draft": {
      "type": "grid", "direction": "neutral", "investment": 200, "leverage": 2,
      "lower": 90000, "upper": 100000, "count": 20,
      "slLow": 87000, "slHigh": 103000
    }
  }
}
bash
curl -sS -X POST "$API/bots/drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"venue":"hyperliquid","market":"BTC","draft":{"type":"grid","direction":"neutral","investment":200,"leverage":2,"lower":90000,"upper":100000,"count":20,"slLow":87000,"slHigh":103000}}'

A spot grid

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

A spot grid trades the coin itself, so it is long only at 1x. Name the market as list_spot_markets names it: a Hyperliquid spot pair such as @107, which the answer also gives as HYPE/USDC. Add kind: "spot" to every call, including the one that gets a live example.

json
{ "name": "list_spot_markets", "arguments": { "query": "HYPE" } }
bash
curl -sS "$API/spot-markets?query=HYPE" -H "x-api-key: $PROW_KEY"
json
{ "name": "get_bot_type_schema", "arguments": { "type": "grid", "kind": "spot", "venue": "hyperliquid", "market": "@107" } }
bash
curl -sS "$API/bot-types/grid?kind=spot&venue=hyperliquid&market=@107" -H "x-api-key: $PROW_KEY"
json
{
  "name": "create_bot_draft",
  "arguments": {
    "venue": "hyperliquid",
    "kind": "spot",
    "market": "@107",
    "draft": {
      "type": "grid", "direction": "long", "investment": 300, "leverage": 1,
      "lower": 20, "upper": 30, "count": 15, "slLow": 18
    }
  }
}
bash
curl -sS -X POST "$API/bots/drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"venue":"hyperliquid","kind":"spot","market":"@107","draft":{"type":"grid","direction":"long","investment":300,"leverage":1,"lower":20,"upper":30,"count":15,"slLow":18}}'

Spot grids can follow the price: trailingUp ({"limit": 35}) moves the grid up when the price leaves the top, never above the limit, and trailingDown moves it down. Aster spot is offered only while Prow has it on; list_bot_types says so.

A DCA bot with safety orders

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

A DCA bot opens with a base order, adds a safety order each time the price moves against it, and takes profit on the average price. The stop (slPct) is required. It is measured from the average entry price and follows the average as safety orders fill, so it moves with each one; it must sit beyond the next safety order at every stage (stop_inside_ladder).

json
{
  "name": "create_bot_draft",
  "arguments": {
    "venue": "hyperliquid",
    "market": "ETH",
    "draft": {
      "type": "dca", "direction": "long", "investment": 100, "leverage": 2,
      "baseOrder": 20, "safetyOrder": 20, "safetyCount": 4,
      "deviationPct": 1.5, "stepScale": 1.2, "volumeScale": 1, "maxActiveSafety": 2,
      "tpPct": 2, "slPct": 12
    }
  }
}
bash
curl -sS -X POST "$API/bots/drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"venue":"hyperliquid","market":"ETH","draft":{"type":"dca","direction":"long","investment":100,"leverage":2,"baseOrder":20,"safetyOrder":20,"safetyCount":4,"deviationPct":1.5,"stepScale":1.2,"volumeScale":1,"maxActiveSafety":2,"tpPct":2,"slPct":12}}'

deviationPct is how far the first safety order sits from the entry, and stepScale makes each next one further away. validate_bot_config returns the average entry if every order fills (average_entry_if_all_fill) and the smallest stop that works (stop_loss_must_exceed_pct).

A DCA bot with 5 safety orders, a 1.5 percent take profit and an 8 percent stop

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

Start from the DCA example and change the three numbers. validate_bot_config returns stop_loss_must_exceed_pct: the stop (slPct) has to be beyond the last safety order, and the call refuses a stop that is not (stop_inside_ladder). If it does, raise slPct above that number or use fewer or closer safety orders.

json
{
  "name": "validate_bot_config",
  "arguments": {
    "venue": "hyperliquid",
    "market": "ETH",
    "draft": {
      "type": "dca", "direction": "long", "investment": 100, "leverage": 2,
      "baseOrder": 20, "safetyOrder": 20, "safetyCount": 5, "deviationPct": 1.5,
      "tpPct": 1.5, "slPct": 8
    }
  }
}
bash
curl -sS -X POST "$API/bot-config/validate" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"venue":"hyperliquid","market":"ETH","draft":{"type":"dca","direction":"long","investment":100,"leverage":2,"baseOrder":20,"safetyOrder":20,"safetyCount":5,"deviationPct":1.5,"tpPct":1.5,"slPct":8}}'

When the answer says valid: true, save it with create_bot_draft and the same arguments.

A QFL bot

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

A QFL bot is a DCA bot that waits for a crack under a base before it buys (a DCA with start.kind set to qfl). It is long only.

json
{
  "name": "create_bot_draft",
  "arguments": {
    "venue": "hyperliquid",
    "market": "ETH",
    "draft": {
      "type": "dca", "direction": "long", "investment": 100, "leverage": 2,
      "baseOrder": 20, "safetyOrder": 20, "safetyCount": 4, "deviationPct": 1.5,
      "tpPct": 3, "slPct": 12,
      "start": { "kind": "qfl", "tfMin": 60, "lookback": 48, "crackPct": 3, "bouncePct": 2 }
    }
  }
}
bash
curl -sS -X POST "$API/bots/drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"venue":"hyperliquid","market":"ETH","draft":{"type":"dca","direction":"long","investment":100,"leverage":2,"baseOrder":20,"safetyOrder":20,"safetyCount":4,"deviationPct":1.5,"tpPct":3,"slPct":12,"start":{"kind":"qfl","tfMin":60,"lookback":48,"crackPct":3,"bouncePct":2}}}'

Other starts: {"kind":"immediate"} (default), {"kind":"price","op":"lte","price":3200} to wait for a price, {"kind":"manual"} to start the deal yourself in Prow. Do not send seed: Prow fills it in.

A DCA bot on spot

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

Add kind: "spot", use a spot market name, set direction to long and leverage to 1. The rest is the same as a futures DCA bot.

A Ladder

Needs a connected account on this venue in Prow. Without one the answer is no_account (shown at the top of this page).

A Ladder is a grid with a combo block: it opens with a market order, trails its stop and can re-open when it finishes. Send type: "grid" with combo. It runs on futures, long or short, with 6 to 40 levels and a range at least 4 percent wide. It has no trigger price and no range exit. It is offered only while Prow has Ladder bots on.

These prices are examples and will not pass today. Take a live example from get_bot_type_schema (same venue, market and direction), change only what you want, and send that.

json
{
  "name": "create_bot_draft",
  "arguments": {
    "venue": "hyperliquid",
    "market": "BTC",
    "draft": {
      "type": "grid", "direction": "long", "investment": 200, "leverage": 2,
      "lower": 90000, "upper": 100000, "count": 12, "slLow": 87000,
      "combo": { "firstShare": 0.5, "trailStop": true, "breakeven": false }
    }
  }
}
bash
curl -sS -X POST "$API/bots/drafts" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"venue":"hyperliquid","market":"BTC","draft":{"type":"grid","direction":"long","investment":200,"leverage":2,"lower":90000,"upper":100000,"count":12,"slLow":87000,"combo":{"firstShare":0.5,"trailStop":true,"breakeven":false}}}'

Arbitrage from an opportunity

Arbitrage holds a long and a short on the same coin to collect a difference between two venues, or between Hyperliquid spot and its perp. First look at what the scanner shows now.

json
{ "name": "list_arbitrage_opportunities", "arguments": { "kind": "funding", "limit": 5 } }
bash
curl -sS "$API/arbitrage-opportunities?kind=funding&limit=5" -H "x-api-key: $PROW_KEY"

Each row names the coin, the kind (the strategy: funding, basis or gap), the two venues (long_venue, short_venue), the yearly rate after costs (after_costs_pct_a_year) and whether a Prow bot can run it (bot_can_run). A runnable row also has draft_hint, an object with type and draft: the draft has the row's strategy (strategies is [kind]) and coin (coins is [coin]) and example amounts you should change. Pass draft_hint.type as type and draft_hint.draft as draft:

json
{
  "coin": "ETH", "kind": "funding", "long_venue": "hyperliquid", "short_venue": "aster", "bot_can_run": true,
  "draft_hint": { "type": "arbitrage", "draft": { "strategies": ["funding"], "coins": ["ETH"], "capitalUsd": 1000, "pairUsd": 500, "leverage": 2, "maxPairs": 1 } }
}

The strategies on offer depend on what Prow has switched on: list_bot_types shows them, and the call answers type_not_available when arbitrage is off. Arbitrage keeps no draft: the answer's confirm_url opens the Arbitrage form filled in, and you sign every leg in Prow.

json
{
  "name": "create_two_leg_bot_link",
  "arguments": {
    "type": "arbitrage",
    "draft": { "strategies": ["funding"], "coins": ["ETH"], "capitalUsd": 1000, "pairUsd": 500, "leverage": 2, "maxPairs": 1 }
  }
}
bash
curl -sS -X POST "$API/two-leg-bot-links" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"type":"arbitrage","draft":{"strategies":["funding"],"coins":["ETH"],"capitalUsd":1000,"pairUsd":500,"leverage":2,"maxPairs":1}}'

The strategies are funding (long where funding is lower, short where it is higher, Hyperliquid and Aster), basis (Hyperliquid spot against its perp) and gap (a price difference between venues). The money must already be on each venue. The difference is small and can turn negative. To check the settings without a link, call validate_two_leg_bot_config (POST /two-leg-bot-config/validate).

A Funding bot

The Funding bot holds coins on Hyperliquid spot and shorts the same amount on the perp, to collect the funding the short is paid while it is positive. Funding can turn negative. It needs a Hyperliquid account on a unified balance with the capital free in USDC.

json
{ "name": "list_funding_opportunities", "arguments": { "limit": 10 } }
bash
curl -sS "$API/funding-opportunities?limit=10" -H "x-api-key: $PROW_KEY"
json
{
  "name": "create_two_leg_bot_link",
  "arguments": { "type": "funding", "draft": { "mode": "steady", "capitalUsd": 1000, "maxLossPct": 10 } }
}
bash
curl -sS -X POST "$API/two-leg-bot-links" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"type":"funding","draft":{"mode":"steady","capitalUsd":1000,"maxLossPct":10}}'

mode is fast (decides every hour) or steady (decides once a day, holds at least three days). Add coins (at least three) to limit which coins it may hold.

A spot hedge

A spot hedge shorts the Hyperliquid perp for the coins you hold, so the coin's price stops moving your balance. The size is a number of coins, not dollars.

json
{
  "name": "create_two_leg_bot_link",
  "arguments": { "type": "hedge", "draft": { "coin": "BTC", "size": 0.01, "leverage": 1, "spot": { "source": "external" } } }
}
bash
curl -sS -X POST "$API/two-leg-bot-links" -H "x-api-key: $PROW_KEY" -H "Content-Type: application/json" \
  -d '{"type":"hedge","draft":{"coin":"BTC","size":0.01,"leverage":1,"spot":{"source":"external"}}}'

If the spot is on your Hyperliquid account, use {"source":"hl_spot","token":"UBTC"} (BTC is UBTC, ETH is UETH). If you sell the spot, stop the hedge, or the short becomes a bet on the price falling.

List, change and delete your drafts

json
{ "name": "list_bot_drafts", "arguments": { "limit": 10 } }
bash
curl -sS "$API/bots/drafts?limit=10" -H "x-api-key: $PROW_KEY"

update_bot_draft changes a draft (send fields with only what changes), delete_bot_draft removes it. The next page shows both, and how to change the ticker or the exchange.

Every field of every type is in the bot settings reference.

Last updated