Positions and orders of a wallet
curl --request GET \
--url https://router.raze.bot/perp/account \
--header 'x-api-key: <api-key>'import requests
url = "https://router.raze.bot/perp/account"
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://router.raze.bot/perp/account', 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://router.raze.bot/perp/account",
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://router.raze.bot/perp/account"
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://router.raze.bot/perp/account")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://router.raze.bot/perp/account")
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{
"quoteId": "94c3676a0000000f",
"user": "bJx6noQaPDTCQ2vxn2dMX1nYbTKhgprcj3bfAvYemky",
"accounts": [
{
"venue": "jupiter",
"registered": true,
"collateralUsdE6": null,
"withdrawableUsdE6": null,
"positions": [],
"orders": []
},
{
"venue": "gmtrade",
"registered": true,
"collateralUsdE6": null,
"withdrawableUsdE6": null,
"positions": [
{
"marketId": "gmtrade:BTC-USDC-USDC-PERP",
"side": "short",
"account": "27stKrvjdgVWA2gGfjxhznUwsEDHSmwpbPB5toRsXXqV",
"sizeUsdE6": 41402640197,
"collateralUsdE6": null,
"entryPriceE6": 79036932246
}
],
"orders": [
{
"marketId": "gmtrade:BTC-USDC-USDC-PERP",
"orderId": "3Wz7PMY9NDFnMyXwjXG4bC4iojvTeHdyGfqnZ8DPnpVo",
"kind": "limit",
"triggerPriceE6": 87500000000,
"sizeUsdE6": 899924665
},
{
"marketId": "gmtrade:BTC-USDC-USDC-PERP",
"orderId": "8JcKwkiRezTTFFjqyMrD7iDSKJ4oxf4JCzWPoSjGP4ES",
"kind": "limit",
"triggerPriceE6": 88500000000,
"sizeUsdE6": 1049883644
},
{
"marketId": "gmtrade:BTC-USDC-USDC-PERP",
"orderId": "FnqEGuvafdixax7fHiSBnHHhkyoWdv8cjHQZQFeetMFg",
"kind": "tp",
"triggerPriceE6": 77000000000,
"sizeUsdE6": 41402640197
}
]
}
]
}Perps
Perp account
The live positions and resting orders of a wallet, one row per enabled venue (or for the venue asked), read from the chain at every call.
- A venue whose chain read failed is missing from
accounts; it is not reported asregistered: false. orderslists resting orders only (limit, take profit, stop loss). A market request or order still waiting for the keeper is not listed; its address isdetail.requestin the/perp/instructionsresponse, andcancelaccepts it.- If the order scan fails,
ordersis empty without an error.
GET
/
perp
/
account
Positions and orders of a wallet
curl --request GET \
--url https://router.raze.bot/perp/account \
--header 'x-api-key: <api-key>'import requests
url = "https://router.raze.bot/perp/account"
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://router.raze.bot/perp/account', 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://router.raze.bot/perp/account",
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://router.raze.bot/perp/account"
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://router.raze.bot/perp/account")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://router.raze.bot/perp/account")
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{
"quoteId": "94c3676a0000000f",
"user": "bJx6noQaPDTCQ2vxn2dMX1nYbTKhgprcj3bfAvYemky",
"accounts": [
{
"venue": "jupiter",
"registered": true,
"collateralUsdE6": null,
"withdrawableUsdE6": null,
"positions": [],
"orders": []
},
{
"venue": "gmtrade",
"registered": true,
"collateralUsdE6": null,
"withdrawableUsdE6": null,
"positions": [
{
"marketId": "gmtrade:BTC-USDC-USDC-PERP",
"side": "short",
"account": "27stKrvjdgVWA2gGfjxhznUwsEDHSmwpbPB5toRsXXqV",
"sizeUsdE6": 41402640197,
"collateralUsdE6": null,
"entryPriceE6": 79036932246
}
],
"orders": [
{
"marketId": "gmtrade:BTC-USDC-USDC-PERP",
"orderId": "3Wz7PMY9NDFnMyXwjXG4bC4iojvTeHdyGfqnZ8DPnpVo",
"kind": "limit",
"triggerPriceE6": 87500000000,
"sizeUsdE6": 899924665
},
{
"marketId": "gmtrade:BTC-USDC-USDC-PERP",
"orderId": "8JcKwkiRezTTFFjqyMrD7iDSKJ4oxf4JCzWPoSjGP4ES",
"kind": "limit",
"triggerPriceE6": 88500000000,
"sizeUsdE6": 1049883644
},
{
"marketId": "gmtrade:BTC-USDC-USDC-PERP",
"orderId": "FnqEGuvafdixax7fHiSBnHHhkyoWdv8cjHQZQFeetMFg",
"kind": "tp",
"triggerPriceE6": 77000000000,
"sizeUsdE6": 41402640197
}
]
}
]
}Guide: Perps.
Authorizations
Query Parameters
Wallet address (base58)
Example:
"bJx6noQaPDTCQ2vxn2dMX1nYbTKhgprcj3bfAvYemky"
Only this venue. Aliases jup, gmsol and gm are accepted. Omit for every enabled venue
Available options:
jupiter, gmtrade ⌘I