Skip to content

By id#

GET https://api.pro.anboto.xyz/api/v2/strategies/campaigns/byId

Get one campaign ApiKeyAuth required.

Query params#

campaignId string required
The campaign's id (UUID)

Headers#

Header
X-API-KEY string required
X-TIMESTAMP int64 ms required
X-SIGN string required
X-RECV-WINDOW int, default 5000

Responses#

200 The campaign
400 campaignId is not a valid id, {"code", "error", "errors"?}
401 Unauthorized: missing or unknown API key
404 No such campaign on this account, {"code", "error", "errors"?}
429 Rate limit exceeded, retry later, {"code", "error", "errors"?}
503 The strategies service is unavailable, {"code", "error", "errors"?}

Response fields — StrategyCampaign#

id string
Campaign id (UUID)
type string
Campaign type; today always paper_farm
status enum
running | paused | stopped | done | error — running, paused, stopped, done, error
stopping boolean
A graceful stop or a hard kill is under way. Independent of status: can be true while status stays error (the open legs are being closed before the campaign reaches stopped)
phase string
Cycle phase the runner is in: idle, opening, open, closing or settling
stop_reason string
Why a stopped/done campaign ended: cycles_done, budget_spent, session_key_expiring, queued_share, user_stop or user_kill. Empty while still running
cycles_done integer
Cycles completed so far
cycles_planned integer
max_cycles from create, or null for unlimited
paper_minted number
Total PAPER minted by this campaign's losing legs
usdc_converted number
Total USDC spent converting minted PAPER (haircut + fee)
queued_usdc number
Profit queued to fund a future cycle's margin instead of being paid out
haircut_paid number
Total haircut paid converting PAPER to USDC
fees_paid number
Total trading fees paid by this campaign
current_legs array[StrategyCampaignLeg]
Open legs of the current cycle (0 while idle, up to 2 while open)
current_legs[].position_id string
The venue's position id, or null while the open is still unconfirmed
current_legs[].side string
long or short
current_legs[].entry number
Entry (mark) price the leg opened at
current_legs[].move_pct number
Signed move since entry, in percent, from this leg's point of view
current_legs[].bust number
This leg's liquidation (bust) price
current_legs[].size number
Position size
current_legs[].margin number
Margin posted for this leg, in USDC
current_legs[].leverage integer
Leverage of this leg
current_legs[].mark_price number
Latest mark price used to watch this leg
current_legs[].parent_order_id string
The order id that opened this leg
current_legs[].opened_at date-time
UTC time the leg opened, ISO 8601
The campaign's most recently closed cycle
last_cycle.pnl_usdc number
Net result of the cycle, in USDC (can be negative)
last_cycle.paper number
PAPER minted by the losing leg of this cycle
last_cycle.closed_at date-time
UTC time both legs were closed, ISO 8601
last_cycle.multileg_order_id string
The multileg (or paired single) order id the close went through, when known
last_error string
Why the campaign is in error; empty otherwise
symbol string
Anboto symbol being farmed, e.g. BTC/USDC:USDC
leverage integer
Leverage of each leg
margin_per_leg number
Margin posted per leg at the start of a cycle, in USDC
target_move_bps integer
Winning-leg move, in basis points, that closes the cycle
budget_usdc number
budget_usdc from create, or null for no spend cap
Stop conditions the campaign watches on its own, besides an explicit stop/kill
stop.queued_share_pct number
Stop once this percent (0-100) of a new cycle's margin would come from queued profit rather than fresh budget. Null or omitted: off
stop.stop_before_key_expiry boolean
Stop gracefully once the Papertrade session key has under an hour left, rather than risk a cycle stuck open past expiry
Default: true
stop.hard_kill_on_stop boolean
If a stop rule fires mid-cycle, close both legs at market now instead of waiting for the target
Default: false
created_at date-time
UTC time the campaign was created, ISO 8601
started_at date-time
UTC time the campaign started, ISO 8601
stopped_at date-time
UTC time the campaign stopped, ISO 8601, or null while still running
curl -X GET "$BASE/api/v2/strategies/campaigns/byId?campaignId=string" \
  -H "X-API-KEY: $API_KEY" -H "X-TIMESTAMP: $ts" \
  -H "X-SIGN: $sign"
params = {"campaignId": ...}
r = requests.get(f"{BASE}/api/v2/strategies/campaigns/byId",
    params=params
    headers=signed_headers_query(params))
print(r.json())
let resp = client
    .get(format!("{BASE}/api/v2/strategies/campaigns/byId?campaignId=string"))
    .headers(signed_headers_query(&params))
    .send()?;
println!("{}", resp.text()?);
req, _ := http.NewRequest("GET", BASE+"/api/v2/strategies/campaigns/byId?campaignId=string", nil)
for k, v := range signedHeadersQuery(req.URL.Query()) {
    req.Header.Set(k, v)
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer resp.Body.Close()
io.Copy(os.Stdout, resp.Body)
HttpResponse<String> resp = client.send(
    signedGet("/api/v2/strategies/campaigns/byId?campaignId=string"),
    HttpResponse.BodyHandlers.ofString());
const res = await fetch(`${BASE}/api/v2/strategies/campaigns/byId?campaignId=string`, {
  method: "GET",
  headers: signedHeadersQuery(params),
});
const data: StrategyCampaign = await res.json();
val request = signedGet("/api/v2/strategies/campaigns/byId?campaignId=string")
val response = client.send(request, HttpResponse.BodyHandlers.ofString())
println(response.body())
cpr::Response r = cpr::Get(
    cpr::Url{BASE + "/api/v2/strategies/campaigns/byId?campaignId=string"},
    signedHeadersQuery(params));
std::cout << r.text << std::endl;
const res = await fetch(`${BASE}/api/v2/strategies/campaigns/byId?campaignId=string`, {
  method: "GET",
  headers: signedHeadersQuery(params),
});
console.log(await res.json());

Response 200

{
  "id": "string",
  "type": "string",
  "status": "running",
  "stopping": true,
  "phase": "string",
  "stop_reason": "string",
  "cycles_done": 0,
  "cycles_planned": 0,
  "paper_minted": 0.0,
  "usdc_converted": 0.0,
  "queued_usdc": 0.0,
  "haircut_paid": 0.0,
  "fees_paid": 0.0,
  "current_legs": [
    {
      "position_id": "string",
      "side": "string",
      "entry": 0.0,
      "move_pct": 0.0,
      "bust": 0.0,
      "size": 0.0,
      "margin": 0.0,
      "leverage": 0,
      "mark_price": 0.0,
      "parent_order_id": "string",
      "opened_at": "string"
    }
  ],
  "last_cycle": {
    "pnl_usdc": 0.0,
    "paper": 0.0,
    "closed_at": "string",
    "multileg_order_id": "string"
  },
  "last_error": "string",
  "symbol": "string",
  "leverage": 0,
  "margin_per_leg": 0.0,
  "target_move_bps": 0,
  "budget_usdc": 0.0,
  "stop": {
    "queued_share_pct": 0.0,
    "stop_before_key_expiry": true,
    "hard_kill_on_stop": true
  },
  "created_at": "string",
  "started_at": "string",
  "stopped_at": "string"
}