curl --request POST \
--url https://api.lamarge.trade/v1/takes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"transfer_intent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_take_id": "<string>",
"max_parts": 8
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
to: '<string>',
amount_in: '<string>',
min_out: '<string>',
transfer_intent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
client_take_id: '<string>',
max_parts: 8
})
};
fetch('https://api.lamarge.trade/v1/takes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/takes"
payload = {
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"transfer_intent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_take_id": "<string>",
"max_parts": 8
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"take": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_take_id": "<string>",
"amount_in": "<string>",
"amount_out": "<string>",
"fills": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "taker",
"order_id": "<string>",
"sequence": 123,
"swap_id": "<string>",
"hashlock": "<string>",
"from_venue": "<string>",
"to_venue": "<string>",
"amount_out": "<string>",
"amount_in": "<string>",
"payer": "<string>",
"maker_owner": "<string>",
"maker_recipient": "<string>",
"taker_recipient": "<string>",
"payment_leg": "NONE",
"maker_leg": "NONE",
"state": "RESERVED",
"reason": "<string>",
"pay_by": "2023-11-07T05:31:56Z",
"reveal_by": "2023-11-07T05:31:56Z",
"t1": "2023-11-07T05:31:56Z",
"t2": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"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"
}
],
"payment_destination": "venue",
"maker_destination": "venue"
}
]
},
"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"
}
]
}{
"take": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_take_id": "<string>",
"amount_in": "<string>",
"amount_out": "<string>",
"fills": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "taker",
"order_id": "<string>",
"sequence": 123,
"swap_id": "<string>",
"hashlock": "<string>",
"from_venue": "<string>",
"to_venue": "<string>",
"amount_out": "<string>",
"amount_in": "<string>",
"payer": "<string>",
"maker_owner": "<string>",
"maker_recipient": "<string>",
"taker_recipient": "<string>",
"payment_leg": "NONE",
"maker_leg": "NONE",
"state": "RESERVED",
"reason": "<string>",
"pay_by": "2023-11-07T05:31:56Z",
"reveal_by": "2023-11-07T05:31:56Z",
"t1": "2023-11-07T05:31:56Z",
"t2": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"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"
}
],
"payment_destination": "venue",
"maker_destination": "venue"
}
]
},
"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
}
}Take at market
Reserves up to max_parts maker fills for a prefunded linked address; no venue withdrawal happens. When the escrow-chain balance cannot cover payment, returns PREFUNDING_REQUIRED before reserving: move funds with /v1/withdrawals and wait for a fresh chain balance. Persist client_take_id; a retry with the same body returns the same reservation. The payment window is 45 s by default, at most 60. min_out bounds the prepared total; fills settle independently. One unsigned or unpaid take per taker.
curl --request POST \
--url https://api.lamarge.trade/v1/takes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"transfer_intent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_take_id": "<string>",
"max_parts": 8
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
to: '<string>',
amount_in: '<string>',
min_out: '<string>',
transfer_intent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
client_take_id: '<string>',
max_parts: 8
})
};
fetch('https://api.lamarge.trade/v1/takes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/takes"
payload = {
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"transfer_intent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_take_id": "<string>",
"max_parts": 8
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"take": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_take_id": "<string>",
"amount_in": "<string>",
"amount_out": "<string>",
"fills": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "taker",
"order_id": "<string>",
"sequence": 123,
"swap_id": "<string>",
"hashlock": "<string>",
"from_venue": "<string>",
"to_venue": "<string>",
"amount_out": "<string>",
"amount_in": "<string>",
"payer": "<string>",
"maker_owner": "<string>",
"maker_recipient": "<string>",
"taker_recipient": "<string>",
"payment_leg": "NONE",
"maker_leg": "NONE",
"state": "RESERVED",
"reason": "<string>",
"pay_by": "2023-11-07T05:31:56Z",
"reveal_by": "2023-11-07T05:31:56Z",
"t1": "2023-11-07T05:31:56Z",
"t2": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"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"
}
],
"payment_destination": "venue",
"maker_destination": "venue"
}
]
},
"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"
}
]
}{
"take": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_take_id": "<string>",
"amount_in": "<string>",
"amount_out": "<string>",
"fills": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "taker",
"order_id": "<string>",
"sequence": 123,
"swap_id": "<string>",
"hashlock": "<string>",
"from_venue": "<string>",
"to_venue": "<string>",
"amount_out": "<string>",
"amount_in": "<string>",
"payer": "<string>",
"maker_owner": "<string>",
"maker_recipient": "<string>",
"taker_recipient": "<string>",
"payment_leg": "NONE",
"maker_leg": "NONE",
"state": "RESERVED",
"reason": "<string>",
"pay_by": "2023-11-07T05:31:56Z",
"reveal_by": "2023-11-07T05:31:56Z",
"t1": "2023-11-07T05:31:56Z",
"t2": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z",
"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"
}
],
"payment_destination": "venue",
"maker_destination": "venue"
}
]
},
"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
The venue the taker pays on.
The venue the taker receives on.
Most the taker pays, in from base units.
^[0-9]{1,78}$Least the take must reserve, in to base units, else SLIPPAGE. Fills settle independently, so the final amount can be lower.
^[0-9]{1,78}$Reserve for this transfer intent atomically, with its client_take_id and terms.
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_.:-]+$Most maker fills; part of the request's identity for retries.
1 <= x <= 8