Skip to main content
GET
/
v1
/
vault
Get user vault state and active positions
curl --request GET \
  --url https://api.totalis.trade/v1/vault \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.totalis.trade/v1/vault"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.totalis.trade/v1/vault', 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.totalis.trade/v1/vault",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$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.totalis.trade/v1/vault"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

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.totalis.trade/v1/vault")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.totalis.trade/v1/vault")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "data": {
    "vault_pda": "<string>",
    "vault_token_account": "<string>",
    "gross_balance": 123,
    "locked_collateral": 123,
    "free_balance": 123,
    "positions": [
      {
        "position_id": "<string>",
        "rfq_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "user_stake": 123,
        "mm_risk": 123,
        "total_payout": 123,
        "created_at": "2023-11-07T05:31:56Z"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Privy JWT issued to the web dashboard. Sent as Authorization: Bearer <jwt>. The Privy session signer underpins all wallet-signed actions.

Response

200 - application/json

OK — vault state or null if no vault exists

data
object | null

Vault state with active position summaries (GET /v1/vault response). Returns the caller's bettor-side vault (owner_type='user') when one exists; falls back to their maker-side vault (owner_type='mm') for pure-MM accounts so the portfolio surface reflects every USDC the caller controls. positions is the bettor-side active list when returning the user vault, or the maker-side active list (joined via q.market_maker_id) when returning the MM vault.