By id#
GET https://api.pro.anboto.xyz/api/v2/strategies/campaigns/byId
Get one campaign ApiKeyAuth required.
Query params#
campaignId string requiredThe 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 stringCampaign id (UUID)
type stringCampaign type; today always paper_farm
status enumrunning | paused | stopped | done | error —
running, paused, stopped, done, errorstopping booleanA 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 stringCycle phase the runner is in: idle, opening, open, closing or settling
stop_reason stringWhy 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 integerCycles completed so far
cycles_planned integermax_cycles from create, or null for unlimited
paper_minted numberTotal PAPER minted by this campaign's losing legs
usdc_converted numberTotal USDC spent converting minted PAPER (haircut + fee)
queued_usdc numberProfit queued to fund a future cycle's margin instead of being paid out
haircut_paid numberTotal haircut paid converting PAPER to USDC
fees_paid numberTotal 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 stringThe venue's position id, or null while the open is still unconfirmed
current_legs[].side stringlong or short
current_legs[].entry numberEntry (mark) price the leg opened at
current_legs[].move_pct numberSigned move since entry, in percent, from this leg's point of view
current_legs[].bust numberThis leg's liquidation (bust) price
current_legs[].size numberPosition size
current_legs[].margin numberMargin posted for this leg, in USDC
current_legs[].leverage integerLeverage of this leg
current_legs[].mark_price numberLatest mark price used to watch this leg
current_legs[].parent_order_id stringThe order id that opened this leg
current_legs[].opened_at date-timeUTC time the leg opened, ISO 8601
last_cycle StrategyCampaignCycleThe campaign's most recently closed cycle
last_cycle.pnl_usdc numberNet result of the cycle, in USDC (can be negative)
last_cycle.paper numberPAPER minted by the losing leg of this cycle
last_cycle.closed_at date-timeUTC time both legs were closed, ISO 8601
last_cycle.multileg_order_id stringThe multileg (or paired single) order id the close went through, when known
last_error stringWhy the campaign is in error; empty otherwise
symbol stringAnboto symbol being farmed, e.g. BTC/USDC:USDC
leverage integerLeverage of each leg
margin_per_leg numberMargin posted per leg at the start of a cycle, in USDC
target_move_bps integerWinning-leg move, in basis points, that closes the cycle
budget_usdc numberbudget_usdc from create, or null for no spend cap
stop StrategyStopRulesStop conditions the campaign watches on its own, besides an explicit stop/kill
stop.queued_share_pct numberStop 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 booleanStop gracefully once the Papertrade session key has under an hour left, rather than risk a cycle stuck open past expiry
stop.hard_kill_on_stop booleanIf a stop rule fires mid-cycle, close both legs at market now instead of waiting for the target
created_at date-timeUTC time the campaign was created, ISO 8601
started_at date-timeUTC time the campaign started, ISO 8601
stopped_at date-timeUTC 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(¶ms))
.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"
}