curl --request PUT \
--url https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee \
--header 'Content-Type: application/json' \
--header 'X-Monaco-Signature: <api-key>' \
--data '{
"bps": 10
}'import requests
url = "https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee"
payload = { "bps": 10 }
headers = {
"X-Monaco-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Monaco-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({bps: 10})
};
fetch('https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee', 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://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bps' => 10
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Monaco-Signature: <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://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee"
payload := strings.NewReader("{\n \"bps\": 10\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Monaco-Signature", "<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.put("https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee")
.header("X-Monaco-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"bps\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Monaco-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bps\": 10\n}"
response = http.request(request)
puts response.read_body{
"builderFeeBps": 10,
"previousBuilderFeeBps": 0,
"changesRemaining": 1,
"nextChangeAllowedAt": "2023-11-07T05:31:56Z"
}Set your builder fee
Set this application’s builder fee.
The builder fee is an additional taker fee, in basis points, that this frontend charges its own users on top of Monaco’s fee. The application is taken from the authenticated session; the caller must be the application’s BuilderCodes payout wallet, and delegated-agent sessions are refused.
bps must be between 0 and the current builder-fee cap
(builderFeeCapBps on GetBuildercodesConfig) inclusive. The application
must be enrolled in BuilderCodes with a payout address. At most two changes
are allowed in any rolling 24 hours; changes Monaco makes on the
application’s behalf do not count. Setting the fee it already has is a
no-op that succeeds and does not use up a change.
The fee can be set while builder fees are switched off
(builderFeeEnabled false): it is stored and nothing is charged until they
are switched on. Once charged, a new fee applies to orders placed after the
change within a few seconds; resting orders keep the fee they were placed
with.
A refused change is HTTP 409 / FAILED_PRECONDITION when the
application is not enrolled with a payout address or has no changes left
(REST adds details.nextChangeAllowedAt), and HTTP 400 /
INVALID_ARGUMENT when bps is above the cap.
curl --request PUT \
--url https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee \
--header 'Content-Type: application/json' \
--header 'X-Monaco-Signature: <api-key>' \
--data '{
"bps": 10
}'import requests
url = "https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee"
payload = { "bps": 10 }
headers = {
"X-Monaco-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Monaco-Signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({bps: 10})
};
fetch('https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee', 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://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'bps' => 10
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Monaco-Signature: <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://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee"
payload := strings.NewReader("{\n \"bps\": 10\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Monaco-Signature", "<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.put("https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee")
.header("X-Monaco-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"bps\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Monaco-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bps\": 10\n}"
response = http.request(request)
puts response.read_body{
"builderFeeBps": 10,
"previousBuilderFeeBps": 0,
"changesRemaining": 1,
"nextChangeAllowedAt": "2023-11-07T05:31:56Z"
}Authorizations
Ed25519 session-key request signing. Every authenticated request carries three headers: X-Monaco-PublicKey (64-char lowercase-hex session public key), X-Monaco-Timestamp (Unix milliseconds, within 30s of server time), and X-Monaco-Signature (hex ed25519 signature). The signature is over METHOD\npath?query\ntimestamp_ms\nSHA256_hex(body), where the body hash is the SHA-256 of the empty byte string when there is no body. Obtain the session keypair from POST /api/v1/auth/challenge followed by POST /api/v1/auth/verify.
Body
New builder fee in basis points, from 0 up to the current builderFeeCapBps inclusive. 0 stops charging a builder fee.
x <= 10010
Response
OK
The builder fee now stored, in basis points.
x <= 10010
The builder fee this change replaced, in basis points. Equal to builderFeeBps when the request set the fee it already had, which changes nothing.
x <= 1000
Builder-fee changes this application can still make in the current rolling 24 hours (at most 2).
x <= 21
RFC 3339 time at which the next builder-fee change becomes allowed, or null while changesRemaining is above 0.
Was this page helpful?

