Get an ArcherAccount's holdings across all markets
What the account holds, summed per token across every market it has a maker book on, plus what sits idle in the account’s own token accounts. One call answers what would otherwise take one balance read per market and a sum on the caller’s side.
Totals are per token and are not valued in a common currency: netting one token against another needs a price, and which price is the caller’s decision. markets carries the per-market rows the totals came from. Quote balances are projected the way the program will settle them.
curl --request GET \
--url https://api.archer.exchange/v1/account/position \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.archer.exchange/v1/account/position"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.archer.exchange/v1/account/position', 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://api.archer.exchange/v1/account/position",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.archer.exchange/v1/account/position"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.archer.exchange/v1/account/position")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/account/position")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"address": "<string>",
"markets": [
{
"baseFree": "<string>",
"baseLocked": "<string>",
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"owner": "<string>",
"quoteFree": "<string>",
"quoteLocked": "<string>"
}
],
"owner": "<string>",
"platform": "self",
"tokens": [
{
"decimals": 123,
"free": "<string>",
"idle": "<string>",
"locked": "<string>",
"mint": "<string>",
"total": "<string>",
"symbol": "<string>"
}
]
}{
"error": "INVALID_PARAMS",
"message": "Invalid market address: xyz"
}{
"error": "RATE_LIMITED",
"message": "Too many requests. Please slow down."
}{
"error": "INTERNAL_ERROR",
"message": "Internal error: ..."
}Authorizations
Query Parameters
The wallet that owns the account.
self, treadfi Response
The position, or null if the account has not been created.
The ArcherAccount PDA.
The per-market balances the book totals were summed from, sorted by market address.
Show child attributes
Show child attributes
self, treadfi One row per token the account holds anywhere, sorted by mint.
Show child attributes
Show child attributes
curl --request GET \
--url https://api.archer.exchange/v1/account/position \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.archer.exchange/v1/account/position"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.archer.exchange/v1/account/position', 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://api.archer.exchange/v1/account/position",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.archer.exchange/v1/account/position"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.archer.exchange/v1/account/position")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/account/position")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"address": "<string>",
"markets": [
{
"baseFree": "<string>",
"baseLocked": "<string>",
"market": "u8tnfCb1JSSghuNFquQ2beStYgAN1kmd1f1Lhxbaec4",
"owner": "<string>",
"quoteFree": "<string>",
"quoteLocked": "<string>"
}
],
"owner": "<string>",
"platform": "self",
"tokens": [
{
"decimals": 123,
"free": "<string>",
"idle": "<string>",
"locked": "<string>",
"mint": "<string>",
"total": "<string>",
"symbol": "<string>"
}
]
}{
"error": "INVALID_PARAMS",
"message": "Invalid market address: xyz"
}{
"error": "RATE_LIMITED",
"message": "Too many requests. Please slow down."
}{
"error": "INTERNAL_ERROR",
"message": "Internal error: ..."
}