Set the account's delegate
Authorizes delegate to quote, trade (POST /v1/order/swap with archerAccount) and manage maker books as the account, and sets the builder-fee ceiling. Owner only. Replaces any existing delegate.
curl --request POST \
--url https://api.archer.exchange/v1/account/delegate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"delegate": "<string>",
"maxBuilderFeePpm": 0,
"signer": "GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK",
"platform": "self",
"withInstructions": false
}
'import requests
url = "https://api.archer.exchange/v1/account/delegate"
payload = {
"delegate": "<string>",
"maxBuilderFeePpm": 0,
"signer": "GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK",
"platform": "self",
"withInstructions": False
}
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({
delegate: '<string>',
maxBuilderFeePpm: 0,
signer: 'GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK',
platform: 'self',
withInstructions: false
})
};
fetch('https://api.archer.exchange/v1/account/delegate', 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/delegate",
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([
'delegate' => '<string>',
'maxBuilderFeePpm' => 0,
'signer' => 'GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK',
'platform' => 'self',
'withInstructions' => false
]),
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://api.archer.exchange/v1/account/delegate"
payload := strings.NewReader("{\n \"delegate\": \"<string>\",\n \"maxBuilderFeePpm\": 0,\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"platform\": \"self\",\n \"withInstructions\": false\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://api.archer.exchange/v1/account/delegate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"delegate\": \"<string>\",\n \"maxBuilderFeePpm\": 0,\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/account/delegate")
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 \"delegate\": \"<string>\",\n \"maxBuilderFeePpm\": 0,\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}"
response = http.request(request)
puts response.read_body{
"action": "create",
"addressLookupTables": [
"<string>"
],
"archerAccount": "<string>",
"transaction": "<string>",
"instructions": {
"addressLookupTables": [
"<string>"
],
"computeBudgetInstructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"instructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"signer": "<string>"
}
}{
"error": "INVALID_PARAMS",
"message": "Invalid market address: xyz"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "RATE_LIMITED",
"message": "Too many requests. Please slow down."
}{
"error": "INTERNAL_ERROR",
"message": "Internal error: ..."
}Authorizations
Body
The wallet to authorize. It may then quote, trade and manage maker books for the account, but never withdraw.
Ceiling on the builder fee any swap funded by this account may carry, in ppm of the quote notional (max 10000). 0 forbids any builder fee.
0
The wallet that signs. Must be the account's owner: a delegate cannot re-delegate. Existing clients may keep sending it as owner; send one name only.
"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK"
Which platform's account. A wallet holds one account per platform, each independently delegated.
self, treadfi Also return the unsigned instructions under instructions, for composing your own transaction instead of signing ours. Omitted or false leaves the response exactly as it was.
Response
An unsigned transaction for the owner to sign.
create, setDelegate, revokeDelegate, deposit, withdraw The ArcherAccount PDA the action targets.
Base64-encoded unsigned transaction for the owner to sign.
Unsigned instructions, present only when the request set withInstructions.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.archer.exchange/v1/account/delegate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"delegate": "<string>",
"maxBuilderFeePpm": 0,
"signer": "GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK",
"platform": "self",
"withInstructions": false
}
'import requests
url = "https://api.archer.exchange/v1/account/delegate"
payload = {
"delegate": "<string>",
"maxBuilderFeePpm": 0,
"signer": "GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK",
"platform": "self",
"withInstructions": False
}
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({
delegate: '<string>',
maxBuilderFeePpm: 0,
signer: 'GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK',
platform: 'self',
withInstructions: false
})
};
fetch('https://api.archer.exchange/v1/account/delegate', 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/delegate",
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([
'delegate' => '<string>',
'maxBuilderFeePpm' => 0,
'signer' => 'GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK',
'platform' => 'self',
'withInstructions' => false
]),
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://api.archer.exchange/v1/account/delegate"
payload := strings.NewReader("{\n \"delegate\": \"<string>\",\n \"maxBuilderFeePpm\": 0,\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"platform\": \"self\",\n \"withInstructions\": false\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://api.archer.exchange/v1/account/delegate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"delegate\": \"<string>\",\n \"maxBuilderFeePpm\": 0,\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.archer.exchange/v1/account/delegate")
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 \"delegate\": \"<string>\",\n \"maxBuilderFeePpm\": 0,\n \"signer\": \"GLKCuotKSjPtQhxHmf6q8GUkw6tUZnzs8W5vEbxdaBdK\",\n \"platform\": \"self\",\n \"withInstructions\": false\n}"
response = http.request(request)
puts response.read_body{
"action": "create",
"addressLookupTables": [
"<string>"
],
"archerAccount": "<string>",
"transaction": "<string>",
"instructions": {
"addressLookupTables": [
"<string>"
],
"computeBudgetInstructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"instructions": [
{
"accounts": [
{
"isSigner": true,
"isWritable": true,
"pubkey": "<string>"
}
],
"data": "<string>",
"programId": "<string>"
}
],
"signer": "<string>"
}
}{
"error": "INVALID_PARAMS",
"message": "Invalid market address: xyz"
}{
"error": "INVALID_PARAMS",
"message": "<string>"
}{
"error": "RATE_LIMITED",
"message": "Too many requests. Please slow down."
}{
"error": "INTERNAL_ERROR",
"message": "Internal error: ..."
}