Get trader TWAP orders
curl --request GET \
--url https://perp-api.phoenix.trade/v1/trader/{authority}/twapimport requests
url = "https://perp-api.phoenix.trade/v1/trader/{authority}/twap"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://perp-api.phoenix.trade/v1/trader/{authority}/twap', 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://perp-api.phoenix.trade/v1/trader/{authority}/twap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://perp-api.phoenix.trade/v1/trader/{authority}/twap"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://perp-api.phoenix.trade/v1/trader/{authority}/twap")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/trader/{authority}/twap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"accounts": [
{
"assetId": 1,
"sequenceNumber": 1,
"traderSubaccountIndex": 1,
"twapAccount": "<string>",
"order": {
"assetId": 1,
"baseLotsFilled": 1,
"childOrdersExecuted": 1,
"childOrdersRemaining": 1,
"cooldownSlots": 1,
"dueSlot": 1,
"lastExecutedSlot": 1,
"lastValidSlot": 1,
"latestSequenceNumber": 1,
"nChildOrders": 1,
"nDustOrders": 1,
"orderSequenceNumber": 1,
"quoteLotsFilled": 1,
"traderAccount": "<string>",
"traderAuthority": "<string>",
"traderPdaIndex": 1,
"traderSubaccountIndex": 1,
"transferCollateralAccountCount": 1,
"cancelExisting": true,
"childOrderCollateralQuoteLotsToTransfer": 1,
"childOrderMaxPriceInTicks": 1,
"childOrderMaxSlippageBps": 1,
"childOrderMinPriceInTicks": 1,
"clientOrderId": "<string>",
"dustOrderSize": 1,
"lastValidSlotFromPacket": 1,
"matchLimit": 1,
"minBaseLotsToFill": 1,
"minQuoteLotsToFill": 1,
"numBaseLots": 1,
"numQuoteLots": 1,
"orderFlags": 1,
"priceInTicks": 1,
"selfTradeBehavior": "<string>",
"side": "<string>"
}
}
],
"authority": "<string>",
"slot": 1,
"traderPdaIndex": 1,
"terminalEvents": [
{
"errorCode": "<string>",
"eventId": "<string>",
"orderSequenceNumber": 1,
"twapAccount": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Trader
Get trader TWAP orders
Handles GET /v1/trader/{authority}/twap via get.v1.trader.by_authority.twap.
GET
/
v1
/
trader
/
{authority}
/
twap
Get trader TWAP orders
curl --request GET \
--url https://perp-api.phoenix.trade/v1/trader/{authority}/twapimport requests
url = "https://perp-api.phoenix.trade/v1/trader/{authority}/twap"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://perp-api.phoenix.trade/v1/trader/{authority}/twap', 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://perp-api.phoenix.trade/v1/trader/{authority}/twap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://perp-api.phoenix.trade/v1/trader/{authority}/twap"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://perp-api.phoenix.trade/v1/trader/{authority}/twap")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/trader/{authority}/twap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"accounts": [
{
"assetId": 1,
"sequenceNumber": 1,
"traderSubaccountIndex": 1,
"twapAccount": "<string>",
"order": {
"assetId": 1,
"baseLotsFilled": 1,
"childOrdersExecuted": 1,
"childOrdersRemaining": 1,
"cooldownSlots": 1,
"dueSlot": 1,
"lastExecutedSlot": 1,
"lastValidSlot": 1,
"latestSequenceNumber": 1,
"nChildOrders": 1,
"nDustOrders": 1,
"orderSequenceNumber": 1,
"quoteLotsFilled": 1,
"traderAccount": "<string>",
"traderAuthority": "<string>",
"traderPdaIndex": 1,
"traderSubaccountIndex": 1,
"transferCollateralAccountCount": 1,
"cancelExisting": true,
"childOrderCollateralQuoteLotsToTransfer": 1,
"childOrderMaxPriceInTicks": 1,
"childOrderMaxSlippageBps": 1,
"childOrderMinPriceInTicks": 1,
"clientOrderId": "<string>",
"dustOrderSize": 1,
"lastValidSlotFromPacket": 1,
"matchLimit": 1,
"minBaseLotsToFill": 1,
"minQuoteLotsToFill": 1,
"numBaseLots": 1,
"numQuoteLots": 1,
"orderFlags": 1,
"priceInTicks": 1,
"selfTradeBehavior": "<string>",
"side": "<string>"
}
}
],
"authority": "<string>",
"slot": 1,
"traderPdaIndex": 1,
"terminalEvents": [
{
"errorCode": "<string>",
"eventId": "<string>",
"orderSequenceNumber": 1,
"twapAccount": "<string>"
}
]
}{
"error": "<string>"
}{
"error": "<string>"
}Query Parameters
Response
Active TWAP state for trader
Active TWAP snapshot for a trader PDA.