Skip to content

Campaigns#

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

Newest first. status uses the public values this API reports, not the internal ones. ApiKeyAuth required.

Query params#

type string
Only this campaign type; today only paper_farm
status enum
Only this status — running, paused, stopped, done, error
limit integer
Campaigns per page, 1-200 (default 20)
Default: 20
offset integer
Campaigns to skip (default 0)
Default: 0

Headers#

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

Responses#

200 A page of campaigns
401 Unauthorized: missing or unknown API key
429 Rate limit exceeded, retry later, {"code", "error", "errors"?}
503 The strategies service is unavailable, {"code", "error", "errors"?}

Response fields — StrategyCampaignList#

count integer
Total campaigns matching the filter, across every page
campaigns array[StrategyCampaign] required
This page's campaigns, newest first
campaigns[].id string
Campaign id (UUID)
campaigns[].type string
Campaign type; today always paper_farm
campaigns[].status enum
running | paused | stopped | done | error — running, paused, stopped, done, error
campaigns[].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)
campaigns[].phase string
Cycle phase the runner is in: idle, opening, open, closing or settling
campaigns[].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
campaigns[].cycles_done integer
Cycles completed so far
campaigns[].cycles_planned integer
max_cycles from create, or null for unlimited
campaigns[].paper_minted number
Total PAPER minted by this campaign's losing legs
campaigns[].usdc_converted number
Total USDC spent converting minted PAPER (haircut + fee)
campaigns[].queued_usdc number
Profit queued to fund a future cycle's margin instead of being paid out
campaigns[].haircut_paid number
Total haircut paid converting PAPER to USDC
campaigns[].fees_paid number
Total trading fees paid by this campaign
campaigns[].current_legs array[StrategyCampaignLeg]
Open legs of the current cycle (0 while idle, up to 2 while open)
campaigns[].current_legs[].position_id string
The venue's position id, or null while the open is still unconfirmed
campaigns[].current_legs[].side string
long or short
campaigns[].current_legs[].entry number
Entry (mark) price the leg opened at
campaigns[].current_legs[].move_pct number
Signed move since entry, in percent, from this leg's point of view
campaigns[].current_legs[].bust number
This leg's liquidation (bust) price
campaigns[].current_legs[].size number
Position size
campaigns[].current_legs[].margin number
Margin posted for this leg, in USDC
campaigns[].current_legs[].leverage integer
Leverage of this leg
campaigns[].current_legs[].mark_price number
Latest mark price used to watch this leg
campaigns[].current_legs[].parent_order_id string
The order id that opened this leg
campaigns[].current_legs[].opened_at date-time
UTC time the leg opened, ISO 8601
campaigns[].last_cycle StrategyCampaignCycle
The campaign's most recently closed cycle
campaigns[].last_error string
Why the campaign is in error; empty otherwise
campaigns[].symbol string
Anboto symbol being farmed, e.g. BTC/USDC:USDC
campaigns[].leverage integer
Leverage of each leg
campaigns[].margin_per_leg number
Margin posted per leg at the start of a cycle, in USDC
campaigns[].target_move_bps integer
Winning-leg move, in basis points, that closes the cycle
campaigns[].budget_usdc number
budget_usdc from create, or null for no spend cap
campaigns[].stop StrategyStopRules
Stop conditions the campaign watches on its own, besides an explicit stop/kill
campaigns[].created_at date-time
UTC time the campaign was created, ISO 8601
campaigns[].started_at date-time
UTC time the campaign started, ISO 8601
campaigns[].stopped_at date-time
UTC time the campaign stopped, ISO 8601, or null while still running
curl -X GET "$BASE/api/v2/strategies/campaigns?type=string" \
  -H "X-API-KEY: $API_KEY" -H "X-TIMESTAMP: $ts" \
  -H "X-SIGN: $sign"
params = {"type": ..., "status": ..., "limit": ..., "offset": ...}
r = requests.get(f"{BASE}/api/v2/strategies/campaigns",
    params=params
    headers=signed_headers_query(params))
print(r.json())
let resp = client
    .get(format!("{BASE}/api/v2/strategies/campaigns?type=string"))
    .headers(signed_headers_query(&params))
    .send()?;
println!("{}", resp.text()?);
req, _ := http.NewRequest("GET", BASE+"/api/v2/strategies/campaigns?type=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?type=string"),
    HttpResponse.BodyHandlers.ofString());
const res = await fetch(`${BASE}/api/v2/strategies/campaigns?type=string`, {
  method: "GET",
  headers: signedHeadersQuery(params),
});
const data: StrategyCampaignList = await res.json();
val request = signedGet("/api/v2/strategies/campaigns?type=string")
val response = client.send(request, HttpResponse.BodyHandlers.ofString())
println(response.body())
cpr::Response r = cpr::Get(
    cpr::Url{BASE + "/api/v2/strategies/campaigns?type=string"},
    signedHeadersQuery(params));
std::cout << r.text << std::endl;
const res = await fetch(`${BASE}/api/v2/strategies/campaigns?type=string`, {
  method: "GET",
  headers: signedHeadersQuery(params),
});
console.log(await res.json());

Response 200

{
  "count": 0,
  "campaigns": [
    {
      "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": [
        {}
      ],
      "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"
    }
  ]
}