curl --request POST \
--url https://api.lamarge.trade/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"venue": "<string>",
"amount": "<string>",
"receive_venue": "<string>",
"receive": "<string>",
"min_fill": "<string>",
"client_order_id": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_validity_seconds": 0
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
venue: '<string>',
amount: '<string>',
receive_venue: '<string>',
receive: '<string>',
min_fill: '<string>',
client_order_id: '<string>',
quote_identity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quote_validity_seconds: 0
})
};
fetch('https://api.lamarge.trade/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/orders"
payload = {
"venue": "<string>",
"amount": "<string>",
"receive_venue": "<string>",
"receive": "<string>",
"min_fill": "<string>",
"client_order_id": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_validity_seconds": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"order": {
"id": "<string>",
"venue": "<string>",
"receive_venue": "<string>",
"owner_address": "<string>",
"state": "preparing",
"error": "<string>",
"amount": "<string>",
"escrow_available": "<string>",
"quotable": "<string>",
"filled": "<string>",
"received": "<string>",
"last_sequence": 123,
"quote_set": {
"sequence": 123,
"expires_at": "2023-11-07T05:31:56Z",
"quotes": [
{
"venue": "<string>",
"chain_id": 123,
"token": "<string>",
"recipient": "<string>",
"supply": "<string>",
"receive": "<string>",
"min_fill": "<string>"
}
],
"signature": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"quote_size": "<string>",
"identity_generation": "<string>",
"active": true
},
"margin_move": {
"venue": "<string>",
"amount": "<string>",
"venue_ref": "<string>",
"state": "queued",
"error": "<string>",
"at": "2023-11-07T05:31:56Z"
},
"transactions": [
{
"kind": "permit",
"chain_id": 123,
"hash": "<string>",
"status": "pending",
"error": "<string>",
"at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"client_order_id": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_signer": "<string>"
},
"to_sign": [
{
"kind": "margin_move",
"signer": "<string>",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>"
},
"message": {}
},
"fill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"order": {
"id": "<string>",
"venue": "<string>",
"receive_venue": "<string>",
"owner_address": "<string>",
"state": "preparing",
"error": "<string>",
"amount": "<string>",
"escrow_available": "<string>",
"quotable": "<string>",
"filled": "<string>",
"received": "<string>",
"last_sequence": 123,
"quote_set": {
"sequence": 123,
"expires_at": "2023-11-07T05:31:56Z",
"quotes": [
{
"venue": "<string>",
"chain_id": 123,
"token": "<string>",
"recipient": "<string>",
"supply": "<string>",
"receive": "<string>",
"min_fill": "<string>"
}
],
"signature": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"quote_size": "<string>",
"identity_generation": "<string>",
"active": true
},
"margin_move": {
"venue": "<string>",
"amount": "<string>",
"venue_ref": "<string>",
"state": "queued",
"error": "<string>",
"at": "2023-11-07T05:31:56Z"
},
"transactions": [
{
"kind": "permit",
"chain_id": 123,
"hash": "<string>",
"status": "pending",
"error": "<string>",
"at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"client_order_id": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_signer": "<string>"
},
"to_sign": [
{
"kind": "margin_move",
"signer": "<string>",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>"
},
"message": {}
},
"fill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}Place an order
Prepares the funding and initial quote of an order. Persist client_order_id first: a retry with the same parameters returns the same order and signing payload, with no second nonce or withdrawal; other parameters return 409. A master session funds its browser identity by default, or the delegated quote_identity_id. At most 100 active orders per user.
curl --request POST \
--url https://api.lamarge.trade/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"venue": "<string>",
"amount": "<string>",
"receive_venue": "<string>",
"receive": "<string>",
"min_fill": "<string>",
"client_order_id": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_validity_seconds": 0
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
venue: '<string>',
amount: '<string>',
receive_venue: '<string>',
receive: '<string>',
min_fill: '<string>',
client_order_id: '<string>',
quote_identity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quote_validity_seconds: 0
})
};
fetch('https://api.lamarge.trade/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/orders"
payload = {
"venue": "<string>",
"amount": "<string>",
"receive_venue": "<string>",
"receive": "<string>",
"min_fill": "<string>",
"client_order_id": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_validity_seconds": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"order": {
"id": "<string>",
"venue": "<string>",
"receive_venue": "<string>",
"owner_address": "<string>",
"state": "preparing",
"error": "<string>",
"amount": "<string>",
"escrow_available": "<string>",
"quotable": "<string>",
"filled": "<string>",
"received": "<string>",
"last_sequence": 123,
"quote_set": {
"sequence": 123,
"expires_at": "2023-11-07T05:31:56Z",
"quotes": [
{
"venue": "<string>",
"chain_id": 123,
"token": "<string>",
"recipient": "<string>",
"supply": "<string>",
"receive": "<string>",
"min_fill": "<string>"
}
],
"signature": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"quote_size": "<string>",
"identity_generation": "<string>",
"active": true
},
"margin_move": {
"venue": "<string>",
"amount": "<string>",
"venue_ref": "<string>",
"state": "queued",
"error": "<string>",
"at": "2023-11-07T05:31:56Z"
},
"transactions": [
{
"kind": "permit",
"chain_id": 123,
"hash": "<string>",
"status": "pending",
"error": "<string>",
"at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"client_order_id": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_signer": "<string>"
},
"to_sign": [
{
"kind": "margin_move",
"signer": "<string>",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>"
},
"message": {}
},
"fill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"order": {
"id": "<string>",
"venue": "<string>",
"receive_venue": "<string>",
"owner_address": "<string>",
"state": "preparing",
"error": "<string>",
"amount": "<string>",
"escrow_available": "<string>",
"quotable": "<string>",
"filled": "<string>",
"received": "<string>",
"last_sequence": 123,
"quote_set": {
"sequence": 123,
"expires_at": "2023-11-07T05:31:56Z",
"quotes": [
{
"venue": "<string>",
"chain_id": 123,
"token": "<string>",
"recipient": "<string>",
"supply": "<string>",
"receive": "<string>",
"min_fill": "<string>"
}
],
"signature": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"valid_until": "2023-11-07T05:31:56Z",
"quote_size": "<string>",
"identity_generation": "<string>",
"active": true
},
"margin_move": {
"venue": "<string>",
"amount": "<string>",
"venue_ref": "<string>",
"state": "queued",
"error": "<string>",
"at": "2023-11-07T05:31:56Z"
},
"transactions": [
{
"kind": "permit",
"chain_id": 123,
"hash": "<string>",
"status": "pending",
"error": "<string>",
"at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"client_order_id": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quote_signer": "<string>"
},
"to_sign": [
{
"kind": "margin_move",
"signer": "<string>",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>"
},
"message": {}
},
"fill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true
}
}Authorizations
Master session from POST /v1/auth/verify. Revocable; expires after seven days by default. Required for financial operations.
Body
Supply venue: funds the order and pays takers.
Supplied amount in venue base units; at least 5,000,000.
^[0-9]{1,78}$Venue the maker receives on.
What the maker wants for the whole amount, in receive_venue base units; the price is receive / amount.
^[0-9]{1,78}$Smallest fill in venue base units: at least 1,000,000, at most fill_max and amount.
^[0-9]{1,78}$Persist before the first attempt. Unique per user and resource type; reuse with other parameters returns 409 STATE_CONFLICT. When omitted, the server assigns a UUID and a lost response cannot be recovered by id.
1 - 64^[A-Za-z0-9_.:-]+$Delegated identity that quotes the order; it gets no initial quote. Default: the master's browser identity.
Initial admission window, counted from preparation; if funding outlasts it, quote again once live. 0 means Never (valid_until 253402214400) for a browser order.
0 <= x <= 300