Skip to content

Spot Triggers

Spot triggers buy or sell assets held in your exchange account. They use a separate payload and execution path from futures triggers.

For manual buys and sells, account balances, holdings, and open-order management, start with Spot Trading. This page is the automation/webhook reference.

On Automations (/trading-terminal), select the exchange, Spot, and an eligible API key. Create a buy or sell trigger, then use Copy JSON and the matching webhook URL. Spot availability is checked for the selected exchange, key, and feature; a futures connection does not by itself guarantee spot access. Use the product options the app actually enables.

Endpoint

text
POST https://api.crodl.com/webhooks/spot/trading
Content-Type: application/json

The futures endpoint /webhooks/trading does not accept spot payloads. The spot endpoint requires trading_type: "spot" and infers the action from side; do not add trading_action.

Buy Example

This market buy requests 10 USDT worth of SOL, subject to balance, fees, and exchange minimum/lot rules:

json
{
  "name": "buy spot",
  "exchange": "blofin",
  "trading_type": "spot",
  "symbol": "SOL-USDT",
  "side": "buy",
  "order_type": "market",
  "time_in_force": "gtc",
  "quantity_type": "amount",
  "quantity_mode": "margin",
  "quantity_amount": "10",
  "quantity_quote": "USDT",
  "cancel_unfilled": "disabled",
  "pyramiding_allowed": "none",
  "opposite_side_close": false,
  "security_token": "YOUR_SECURITY_TOKEN",
  "trigger_id": 5
}

In spot payloads, margin is the buy-side sizing label. It does not enable leverage or borrowing.

Sell Example

This market sell requests 10 USDT worth of SOL from your available SOL holdings, not 10 SOL and not the full holding:

json
{
  "name": "sell spot",
  "exchange": "blofin",
  "trading_type": "spot",
  "symbol": "SOL-USDT",
  "side": "sell",
  "order_type": "market",
  "time_in_force": "gtc",
  "quantity_type": "amount",
  "quantity_mode": "position",
  "quantity_amount": "10",
  "quantity_quote": "USDT",
  "cancel_unfilled": "disabled",
  "pyramiding_allowed": "none",
  "opposite_side_close": false,
  "security_token": "YOUR_SECURITY_TOKEN",
  "trigger_id": 6
}

A spot sell requires quantity_mode: "position". Changing only side in a buy payload leaves the wrong mode and saved trigger ID. Create the sell trigger in Crodl and copy its own JSON. IDs 5 and 6 here are illustrative, not IDs to reuse on your account.

Quantity Units

All quantities must be positive; percentages must be at most 100. quantity_quote must match the symbol's quote asset (USDT for SOL-USDT).

quantity_typeBuy (quantity_mode: "margin")Sell (quantity_mode: "position")
amountQuote currency to spend; "10" means 10 USDT for SOL-USDTQuote value of base asset to sell; "10" means approximately 10 USDT worth of SOL
percentagePercentage of available quote balancePercentage of available base-asset holdings
assetBase-asset units to buy; "10" means 10 SOLBase-asset units to sell; "10" means 10 SOL

To sell the available holding, create a sell trigger with quantity_type: "percentage", quantity_mode: "position", and quantity_amount: "100", then copy its new payload. Locked balance, fee reserves, exchange precision, and minimum size can leave a remainder. A sell cannot open a short or sell an asset you do not have.

Saved Trigger Binding

Unlike a direct futures payload, a spot webhook requires a saved trigger_id. Crodl verifies that it belongs to the authenticated user, API key, and exchange, and that the execution configuration matches the saved trigger.

The checked configuration includes symbol, buy/sell side, order type, time-in-force, quantity type/mode/amount/quote, limit pricing, fixed policy values, and any strategy_dashboard_id. A valid token alone does not authorize arbitrary changes to these fields. A mismatch returns 422 with spot_trigger_scope_invalid.

After editing a spot trigger, re-copy its payload into TradingView or your sender. The old saved alert message does not update automatically. Do not substitute {{ticker}}, {{close}}, or other dynamic values into bound execution fields unless they still match the saved configuration.

Fields

FieldContract
exchangeThe exchange on the saved trigger; supported schema values are blofin, bitunix, bitget, bybit, okx, and hyperliquid, subject to live capability checks
trading_typeRequired: spot
security_tokenRequired: token from your own saved trigger export; keep it private
trigger_idRequired: positive integer identifying that saved spot trigger
nameHuman-readable label included by the exporter
symbolRequired: canonical base-quote pair, for example SOL-USDT; use the pair copied from the trigger
sideRequired: buy or sell, not futures long/short/close_long
order_typemarket or limit; time-in-force is a separate field
time_in_forcegtc by default; use the values offered for the selected venue and order type
quantity_typeRequired: amount, percentage, or asset
quantity_modeRequired: margin for buys, position for sells
quantity_amountRequired: positive numeric string, with the units explained above
quantity_quoteRequired: pair's quote currency
limit_price_mode / limit_order_priceRequired together for limit orders; omit both for market orders
cancel_unfilledOnly disabled
pyramiding_allowedOnly none; do not apply futures stacking-policy meanings to spot holdings
opposite_side_closeOnly JSON boolean false
strategy_dashboard_idOptional reporting ID, saved with the trigger; up to 128 characters using letters, numbers, ., _, :, or -, starting with a letter or number

The spot schema rejects unknown fields. Do not include futures leverage, margin_mode, position_mode, TP/SL, allocation_id, qty, or trading_action. Keep numeric quantities as strings, trigger_id as an integer, and opposite_side_close as a boolean in copied JSON.

Limit Orders and Time-in-Force

For a spot limit trigger, set order_type: "limit" and include limit_price_mode (price or percentage) plus a positive limit_order_price. Percentage mode uses a distance below the current reference for buys and above it for sells: "2" means 2%, not 98% of the reference. A buy percentage must be less than 100.

VenueLimit time-in-force values
Blofin, Bybit, Bitget, OKXgtc, ioc, fok, post_only
Bitunixgtc
Hyperliquidgtc, ioc, post_only

Market payloads use gtc; Hyperliquid also accepts ioc. These values do not make a market order rest on the book. Copy the configuration offered by the selected venue; never carry limit fields into a market payload.

TradingView Setup

  1. Create and save the intended Spot buy or sell trigger in Crodl.
  2. Copy that trigger's JSON and spot webhook URL.
  3. In TradingView's alert notifications, enable the webhook and paste https://api.crodl.com/webhooks/spot/trading.
  4. Paste the complete JSON object into the alert message, with your own token and saved trigger ID.
  5. Save the alert. After any trigger configuration change, re-copy and save the alert message.

Acceptance and Errors

202 Accepted means Crodl queued the request, not that the exchange filled it. The response includes accepted, request_id, accepted_ms, and trading_type: "spot". Track the request in the spot execution history and check the exchange order/fill record when necessary.

ResultMeaning
401Invalid security token
422 spot_trade_validation_failedInvalid or forbidden field, wrong quantity mode, or inconsistent sizing/pricing
422 spot_trigger_scope_invalidSaved trigger is missing, belongs to another scope, or its execution configuration differs
409A conflicting request/reservation already exists; inspect before sending another order
429Spot admission rate limit; default 10 requests/second, configurable by the operator
503Spot is not released/eligible, an ingress gate is closed, or admission/queue services are unavailable

Use an Idempotency-Key HTTP header when your sender supports it: a unique value for each intended signal, reused only for retries of that signal. Spot's strict schema does not accept the futures body-level idempotency fields. Reusing trigger_id alone does not deduplicate repeated fires. If an outcome is uncertain, inspect the existing request rather than sending a new one with a different key.