Report trader status
curl --request POST \
--url https://harness.chance.cc/api/v1/trader/heartbeat \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"instanceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"version": "<string>",
"dryRun": true,
"venue": "dimes",
"walletAddress": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"lastTickAt": "2023-11-07T05:31:56Z",
"openPositions": 1,
"totalExposureUsd": 123,
"dailyRealizedPnlUsd": 123,
"creditsRemaining": 123,
"note": "<string>"
}
'import requests
url = "https://harness.chance.cc/api/v1/trader/heartbeat"
payload = {
"instanceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"version": "<string>",
"dryRun": True,
"venue": "dimes",
"walletAddress": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"lastTickAt": "2023-11-07T05:31:56Z",
"openPositions": 1,
"totalExposureUsd": 123,
"dailyRealizedPnlUsd": 123,
"creditsRemaining": 123,
"note": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
instanceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
version: '<string>',
dryRun: true,
venue: 'dimes',
walletAddress: '<string>',
startedAt: '2023-11-07T05:31:56Z',
lastTickAt: '2023-11-07T05:31:56Z',
openPositions: 1,
totalExposureUsd: 123,
dailyRealizedPnlUsd: 123,
creditsRemaining: 123,
note: '<string>'
})
};
fetch('https://harness.chance.cc/api/v1/trader/heartbeat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://harness.chance.cc/api/v1/trader/heartbeat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instanceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'version' => '<string>',
'dryRun' => true,
'venue' => 'dimes',
'walletAddress' => '<string>',
'startedAt' => '2023-11-07T05:31:56Z',
'lastTickAt' => '2023-11-07T05:31:56Z',
'openPositions' => 1,
'totalExposureUsd' => 123,
'dailyRealizedPnlUsd' => 123,
'creditsRemaining' => 123,
'note' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://harness.chance.cc/api/v1/trader/heartbeat"
payload := strings.NewReader("{\n \"instanceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"dryRun\": true,\n \"venue\": \"dimes\",\n \"walletAddress\": \"<string>\",\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"lastTickAt\": \"2023-11-07T05:31:56Z\",\n \"openPositions\": 1,\n \"totalExposureUsd\": 123,\n \"dailyRealizedPnlUsd\": 123,\n \"creditsRemaining\": 123,\n \"note\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://harness.chance.cc/api/v1/trader/heartbeat")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"instanceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"dryRun\": true,\n \"venue\": \"dimes\",\n \"walletAddress\": \"<string>\",\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"lastTickAt\": \"2023-11-07T05:31:56Z\",\n \"openPositions\": 1,\n \"totalExposureUsd\": 123,\n \"dailyRealizedPnlUsd\": 123,\n \"creditsRemaining\": 123,\n \"note\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harness.chance.cc/api/v1/trader/heartbeat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instanceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"dryRun\": true,\n \"venue\": \"dimes\",\n \"walletAddress\": \"<string>\",\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"lastTickAt\": \"2023-11-07T05:31:56Z\",\n \"openPositions\": 1,\n \"totalExposureUsd\": 123,\n \"dailyRealizedPnlUsd\": 123,\n \"creditsRemaining\": 123,\n \"note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true
}Trader
Report trader status
A trader container reports liveness and headline numbers. Upserts one record per instanceId. Free.
POST
/
api
/
v1
/
trader
/
heartbeat
Report trader status
curl --request POST \
--url https://harness.chance.cc/api/v1/trader/heartbeat \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"instanceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"version": "<string>",
"dryRun": true,
"venue": "dimes",
"walletAddress": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"lastTickAt": "2023-11-07T05:31:56Z",
"openPositions": 1,
"totalExposureUsd": 123,
"dailyRealizedPnlUsd": 123,
"creditsRemaining": 123,
"note": "<string>"
}
'import requests
url = "https://harness.chance.cc/api/v1/trader/heartbeat"
payload = {
"instanceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"version": "<string>",
"dryRun": True,
"venue": "dimes",
"walletAddress": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"lastTickAt": "2023-11-07T05:31:56Z",
"openPositions": 1,
"totalExposureUsd": 123,
"dailyRealizedPnlUsd": 123,
"creditsRemaining": 123,
"note": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
instanceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
version: '<string>',
dryRun: true,
venue: 'dimes',
walletAddress: '<string>',
startedAt: '2023-11-07T05:31:56Z',
lastTickAt: '2023-11-07T05:31:56Z',
openPositions: 1,
totalExposureUsd: 123,
dailyRealizedPnlUsd: 123,
creditsRemaining: 123,
note: '<string>'
})
};
fetch('https://harness.chance.cc/api/v1/trader/heartbeat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://harness.chance.cc/api/v1/trader/heartbeat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'instanceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'version' => '<string>',
'dryRun' => true,
'venue' => 'dimes',
'walletAddress' => '<string>',
'startedAt' => '2023-11-07T05:31:56Z',
'lastTickAt' => '2023-11-07T05:31:56Z',
'openPositions' => 1,
'totalExposureUsd' => 123,
'dailyRealizedPnlUsd' => 123,
'creditsRemaining' => 123,
'note' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://harness.chance.cc/api/v1/trader/heartbeat"
payload := strings.NewReader("{\n \"instanceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"dryRun\": true,\n \"venue\": \"dimes\",\n \"walletAddress\": \"<string>\",\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"lastTickAt\": \"2023-11-07T05:31:56Z\",\n \"openPositions\": 1,\n \"totalExposureUsd\": 123,\n \"dailyRealizedPnlUsd\": 123,\n \"creditsRemaining\": 123,\n \"note\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://harness.chance.cc/api/v1/trader/heartbeat")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"instanceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"dryRun\": true,\n \"venue\": \"dimes\",\n \"walletAddress\": \"<string>\",\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"lastTickAt\": \"2023-11-07T05:31:56Z\",\n \"openPositions\": 1,\n \"totalExposureUsd\": 123,\n \"dailyRealizedPnlUsd\": 123,\n \"creditsRemaining\": 123,\n \"note\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://harness.chance.cc/api/v1/trader/heartbeat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instanceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"version\": \"<string>\",\n \"dryRun\": true,\n \"venue\": \"dimes\",\n \"walletAddress\": \"<string>\",\n \"startedAt\": \"2023-11-07T05:31:56Z\",\n \"lastTickAt\": \"2023-11-07T05:31:56Z\",\n \"openPositions\": 1,\n \"totalExposureUsd\": 123,\n \"dailyRealizedPnlUsd\": 123,\n \"creditsRemaining\": 123,\n \"note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true
}Authorizations
ApiKeyAuthBearerAuth
An API key (chance_sk_live_…) from https://harness.chance.cc/keys.
Body
application/json
Required string length:
1 - 64Required string length:
1 - 64Available options:
starting, running, paused_out_of_credits, stopping, error Required string length:
1 - 32Example:
"dimes"
Available options:
sandbox, production Pattern:
^0x[0-9a-fA-F]{40}$Required range:
x >= 0Maximum string length:
280Response
Recorded.
Available options:
true 