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,
"makerBps": 5
}
'import requests
url = "https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee"
payload = {
"bps": 10,
"makerBps": 5
}
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, makerBps: 5})
};
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,
'makerBps' => 5
]),
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 \"makerBps\": 5\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 \"makerBps\": 5\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 \"makerBps\": 5\n}"
response = http.request(request)
puts response.read_body{
"builderFeeBps": 10,
"previousBuilderFeeBps": 0,
"changesRemaining": 1,
"nextChangeAllowedAt": "2023-11-07T05:31:56Z",
"builderMakerFeeBps": 5,
"previousBuilderMakerFeeBps": 0
}Set your builder fees
Set this application’s builder fees.
The builder fee is an additional taker fee, in basis points, that this frontend charges its own users on top of Monaco’s fee when their order fills as the taker. The maker add-on is the same for a user’s order that fills as the maker: it is paid by the maker on top of Monaco’s maker fee or rebate. 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 (taker) is required. makerBps is optional; omitting it leaves the
maker add-on unchanged. Each must be between 0 and the current builder-fee
cap (builderFeeCapBps on GetBuildercodesConfig) inclusive; the cap and
the switches are shared by both sides. The application must be enrolled in
BuilderCodes with a payout address. At most two changes are allowed in any
rolling 24 hours, and one call that sets both sides is one change; changes
Monaco makes on the application’s behalf do not count. Setting the values
it already has is a no-op that succeeds and does not use up a change.
The fees can be set while the revenue share or builder fees are switched
on, and are refused (HTTP 403 / PERMISSION_DENIED) while both are
off. With builder fees off (builderFeeEnabled false) they are stored and
nothing is charged until they are switched on. A newly stored taker fee
reaches order requests within a few seconds. A newly stored maker add-on
applies to orders placed after the matching engine’s next BuilderCodes
enrollment refresh, shortly after it is saved; an order resting on the book
keeps the maker add-on in force when it was placed. Sequencer ordering is
authoritative for matching-engine policy and enrollment state: an order
processed before one of those sequenced changes uses the earlier state, and
a later order uses the new state.
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 or makerBps 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,
"makerBps": 5
}
'import requests
url = "https://staging.apimonaco.xyz/api/v1/buildercodes/builder-fee"
payload = {
"bps": 10,
"makerBps": 5
}
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, makerBps: 5})
};
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,
'makerBps' => 5
]),
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 \"makerBps\": 5\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 \"makerBps\": 5\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 \"makerBps\": 5\n}"
response = http.request(request)
puts response.read_body{
"builderFeeBps": 10,
"previousBuilderFeeBps": 0,
"changesRemaining": 1,
"nextChangeAllowedAt": "2023-11-07T05:31:56Z",
"builderMakerFeeBps": 5,
"previousBuilderMakerFeeBps": 0
}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
New maker add-on in basis points, from 0 up to the current builderFeeCapBps inclusive. Omit to leave the maker add-on unchanged; 0 stops charging one. It applies to orders placed after the matching engine's next BuilderCodes enrollment refresh, shortly after it is saved, and never to an order already resting.
x <= 1005
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.
The maker add-on now stored, in basis points. It applies to orders placed after the matching engine's next BuilderCodes enrollment refresh, shortly after it is saved; orders already resting keep the rate they were placed with.
x <= 1005
The maker add-on this change replaced, in basis points. Equal to builderMakerFeeBps when the request left it unchanged.
x <= 1000
Was this page helpful?

