curl --request POST \
--url https://api.lamarge.trade/v1/maker/{venue}/prepare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_request_id": "<string>",
"amount": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_request_id: '<string>',
amount: '<string>',
quote_identity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.lamarge.trade/v1/maker/{venue}/prepare', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/maker/{venue}/prepare"
payload = {
"client_request_id": "<string>",
"amount": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_request_id": "<string>",
"state": "preparing",
"venue": "<string>",
"order": {
"preparation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"capital_pool": true,
"held_in": "escrow",
"id": "<string>",
"venue": "<string>",
"owner_address": "<string>",
"state": "preparing",
"error": "<string>",
"amount": "<string>",
"held": "<string>",
"delivery_fee": "<string>",
"revision": "<string>",
"available_to_quote": "<string>",
"received_by_venue": [
{
"venue": "<string>",
"amount": "<string>"
}
],
"quotable": "<string>",
"filled": "<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>",
"available": "<string>",
"offered": "<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": "fund",
"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>",
"chainId": 123,
"verifyingContract": "<string>",
"version": "<string>"
},
"message": {}
},
"fill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attestation": {
"signature": "<string>",
"terms": {
"take": "<string>",
"from": "<string>",
"to": "<string>",
"recipient": "<string>",
"token": "<string>",
"amountOut": "<string>",
"payBy": 123
}
}
}
],
"sequence": 4503599627370496,
"expires_at": "2023-11-07T05:31:56Z",
"expected_revision": "<string>",
"intent": {
"amount": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"funding_source": "wallet"
},
"funding": {
"existing_available": "<string>",
"wallet_amount": "<string>",
"venue_amount": "<string>",
"idle_amount": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}Prepare maker funds
Funds the quote identity’s capital pool on venue (maker capital); prices go through quote lines. Idempotent on client_request_id. A Lighter or Aster pool (before quoting) takes funding_source: venue, one pool per account; a Lighter account without a deposit is STATE_CONFLICT with reason no_deposit, an unreadable Lighter transfer fee VENUE_UNAVAILABLE.
curl --request POST \
--url https://api.lamarge.trade/v1/maker/{venue}/prepare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_request_id": "<string>",
"amount": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_request_id: '<string>',
amount: '<string>',
quote_identity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.lamarge.trade/v1/maker/{venue}/prepare', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/maker/{venue}/prepare"
payload = {
"client_request_id": "<string>",
"amount": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_request_id": "<string>",
"state": "preparing",
"venue": "<string>",
"order": {
"preparation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"capital_pool": true,
"held_in": "escrow",
"id": "<string>",
"venue": "<string>",
"owner_address": "<string>",
"state": "preparing",
"error": "<string>",
"amount": "<string>",
"held": "<string>",
"delivery_fee": "<string>",
"revision": "<string>",
"available_to_quote": "<string>",
"received_by_venue": [
{
"venue": "<string>",
"amount": "<string>"
}
],
"quotable": "<string>",
"filled": "<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>",
"available": "<string>",
"offered": "<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": "fund",
"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>",
"chainId": 123,
"verifyingContract": "<string>",
"version": "<string>"
},
"message": {}
},
"fill_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attestation": {
"signature": "<string>",
"terms": {
"take": "<string>",
"from": "<string>",
"to": "<string>",
"recipient": "<string>",
"token": "<string>",
"amountOut": "<string>",
"payBy": 123
}
}
}
],
"sequence": 4503599627370496,
"expires_at": "2023-11-07T05:31:56Z",
"expected_revision": "<string>",
"intent": {
"amount": "<string>",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"funding_source": "wallet"
},
"funding": {
"existing_available": "<string>",
"wallet_amount": "<string>",
"venue_amount": "<string>",
"idle_amount": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"retryable": true,
"reason": "<string>",
"venue": "<string>",
"step": "permit"
}
}Authorizations
Body
Where the deposit, the added capital the available balance does not cover, comes from (maker capital). wallet: the linked address on the escrow chain; VALIDATION_ERROR if it holds less than the deposit. venue: one margin_move of the whole deposit to the linked address, VALIDATION_ERROR on GMX; the funding goes once that address holds the deposit, and fails if it does not within 10 minutes of the move.
wallet, venue Response
The preparation.