This object represents an order in Absurdia. The endpoints let you upload a new order, update its status and retrieve a specific order.
An order object returned by Absurdia's APIs will contain the following attributes:
string
The Absurdia ID of the order.
string
The ID of the fund to which it belongs.
string | null
A custom ID you can freely choose.
string | null
An ID that a venue, such as an exchange, has assigned to the order.
string
One of received, placed, canceled, rejected, partial or filled.
string
Symbol of the base asset. For example, for the instrument BTC.USDC, the base asset is BTC.
string
Symbol of the quote asset. For example, for the instrument BTC.USDC, the quote asset is USDC.
string
Name of the venue where the order has been sent for execution.
string
One of market, limit, stop, stop_limit, take or take_limit.
string
Either buy or sell.
double
Amount of base asset. This is the value of the order at its creation. The latter attribute quantity_filled is the amount that has been filled.
double | null
Amount of quote asset. If the order type is market, stop or take, it should be null. The latter attribute price_filled is the price effectively paid.
string | null
One of GTC, GTT, FOK, IOC, OPG, CLS or DAY. If unknown, it will be null.
boolean
Whether it is a reduce only order.
boolean
Whether it is a post only order.
integer | null
Leverage used for the order. If no leverage was used, it will be null.
double | null
Fees paid to execute the order. If the order's status is not filled, it might be null.
double | null
Slippage estimation made by Absurdia. If the order's status is not filled, it might be null.
integer | null
UNIX timestamp in microseconds of the date when order became filled. If not filled, the value will be null.
integer | null
UNIX timestamp in microseconds of the date when order became cancelled.
integer | null
UNIX timestamp in microseconds of the date when order became rejected.
double | null
Average price paid to fill the order.
double | null
Total quantity filled. This value can vary if partially filled only, or should be equal to quantity if the order is filled.
hash | null
A hashmap of custom metadata. Values must be strings or empty. If a value is empty, the key might be used as a "tag".
string
The ID of the agent that added the order.
integer
UNIX timestamp in microseconds of the creation date of the order at Absurdia.
integer
UNIX timestamp in microseconds of the last update date of the order at Absurdia.
{
"id": "01827891588d7f7795ffff70acd00e26",
"fund_id": "01G9TC7YPQECKRV1GJ8PVP6VD9",
"quote_asset": null,
"base_asset": null,
"status": "filled",
"venue_symbol": "BTCBUSD",
"venue": "BIN",
"absurdia_symbol": "BTC.BUSD:BIN",
"type": "market",
"side": "sell",
"quantity": 0.32,
"price": null,
"time_in_force": null,
"reduce_only": false,
"post_only": true,
"leverage": null,
"imported": true,
"sent_to_venue_at": 1659880167210000,
"sent_to_absurdia_at": null,
"received_at": 1659880167565000,
"custom_id": null,
"venue_id": null,
"filled_at": 1659880226882852,
"cancelled_at": null,
"rejected_at": null,
"price_filled": 26132.01,
"quantity_filled": 0.32,
"fees_total": null,
"metadata": {},
"created_by": "1af6759e6a3d4ab4959d1ebe34d83888",
"created_at": 1659880167565000,
"updated_at": 1659880227173000
}
signature required
An order to be added for accounting in one of your fund.
requiredstring
The ID of the fund to which it belongs.
string
The Alt ID of the asset in the fund to which we should add the acquired assets. If not present, it will be guessed or automatically created, but the processing of the order will take more time.
string
The Alt ID of the asset in the fund to which we should remove assets to pay for the base. If not present, it will be guessed or automatically created, but the processing of the order will take more time.
requiredstring
Symbol of the instrument at the venue
requiredstring
Name of the venue where the order has been sent for execution.
requiredstring
One of received, placed, canceled, rejected, partial or filled.
string
One of spot, future and margin. Default value is spot.
requiredstring
One of market, limit, stop, stop_limit, take or take_limit.
string
One of GTC, GTT, FOK, IOC, OPG, CLS or DAY.
requiredstring
One of buy, sell, long or short. If it's a spot or margin order, use either buy or sell. If it is a future order, use either long or short.
requireddouble
Amount of base asset. This is the value of the order at its creation. The latter attribute quantity_filled is the amount that has been filled.
double
Amount of quote asset. If the order type is market, stop or take, it should be null. The latter attribute price_filled is the price effectively paid.
boolean
Whether it is a reduce only order. Default is false.
boolean
Whether it is a post only order. Default is false.
integer
Leverage used for the order. If none used, do not include it.
double
Fees paid to execute the order. If the order's status is not filled, do not include it.
integer
UNIX timestamp in microseconds of the date when order became filled. If the order's status is not filled, do not include it.
integer
UNIX timestamp in microseconds of the date when order became cancelled.
integer
UNIX timestamp in microseconds of the date when order became rejected.
string
An arbitrary text that explains why the order has been cancelled or rejected. Only added if the status is cancelled, rejected or partial_cancelled.
double
Average price paid to fill the order. Required if the status of this order is filled.
double | null
Total quantity filled. This value can be lower than quantity if the status is partial, otherwise should be equal to quantity if the order is filled.
string
A custom ID you can freely choose.
string
An ID that a venue, such as an exchange, has assigned to the order.
requiredinteger
UNIX timestamp in microseconds of when the order was sent to the venue.
hash
A map of metadata attached to the order.
An order object if the request was successful.
POST /v1/ordersimport requests
url = "https://api.absurdia.markets/v1/orders"
data = {
...
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer {{token}}",
"Abs-Signature": sign(data)
}
response = requests.request("POST", url, headers=headers, data=dump(data))
print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.absurdia.markets/v1/orders';
let data = {
...
}
let options = {
method: 'POST',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer {{token}}",
"Abs-Signature": sign(data)
},
body: JSON.stringify(data)
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"data": {
//...Order object...
}
}
signature required
Retrieve the order with the given ID.
An order object if the ID is valid and the requestor is authorised to read the order. Returns an error otherwise.
GET /v1/orders/:idcurl https://api.absurdia.markets/v1/orders/:id
-H "Accept: application/json"
-H "Authorization: Bearer {{token}}"
import requests
url = "https://api.absurdia.markets/v1/orders/" + order_id
headers = {
"Accept": "application/json",
"Authorization": "Bearer {{token}}"
}
response = requests.request("GET", url, headers=headers)
print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.absurdia.markets/v1/orders/' + order_id;
let options = {
method: 'GET',
headers: {
"Accept": "application/json",
"Authorization": "Bearer {{token}}"
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"data": {
//...Order object...
}
}
signature required
Some fields of an order can be updated up to 7 days after the order has been added. This endpoint only support the update of those fields.
string
An arbitrary text that explains why the order has been cancelled or rejected. Only added if the status is cancelled, rejected or partial_cancelled.
string
A custom ID you can freely choose.
string
An ID that a venue, such as an exchange, has assigned to the order.
hash
A map of metadata attached to the order. The old metadata will be completly replaced by this map.
The updated order object if the request is successful. Returns an error otherwise.
PATCH /v1/orders/:idimport requests
url = "https://api.absurdia.markets/v1/orders" + order_id
data = {
"metadata" : {
"older_key": "same_value",
"new_key": "0.231"
}
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer {{token}}",
"Abs-Signature": sign(data)
}
response = requests.request("PATCH", url, headers=headers, data=dump(data))
print(response.json())
const fetch = require('node-fetch');
const url = 'https://api.absurdia.markets/v1/orders/' + order_id;
let data = {
"metadata" : {
"older_key": "same_value",
"new_key": "0.231"
}
}
let options = {
method: 'PATCH',
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer {{token}}",
"Abs-Signature": sign(data)
},
body: JSON.stringify(data)
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"data": {
//...Order object...
}
}
signature required
Register the order with the given ID as filled.
requiredinteger
UNIX timestamp in microseconds of the date when order became filled.
double | null
Average price paid to fill the order. Required if the order's type is market, stop or take. For other types, if this value is not given, the order's current price will be used as the fill price.
double | null
Total quantity filled. If this value is not given, the order's current quantity value will be used instead.
double | null
Total fees paid for the order.
An order object if the requested has effects and the requestor is authorised to read the order. Returns an error otherwise.
{
"data": {
//...Order object...
}
}
signature required
Register the order with the given ID as filled.
requiredinteger
UNIX timestamp in microseconds of the date when order became cancelled.
string
An arbitrary text that explains why the order has been cancelled.
An order object if the requested has effects and the requestor is authorised to read the order. Returns an error otherwise.
{
"data": {
//...Order object...
}
}
signature required
Register the order with the given ID as filled.
requiredinteger
UNIX timestamp in microseconds of the date when order became rejected.
string
An arbitrary text that explains why the order has been rejected.
An order object if the requested has effects and the requestor is authorised to read the order. Returns an error otherwise.
{
"data": {
//...Order object...
}
}