Prepare quote lines
curl --request POST \
--url https://api.lamarge.trade/v1/quote-lines/prepare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_revision": "<string>",
"valid_until": 1,
"lines": [
{
"venue": "<string>",
"buy": "<string>",
"sell": "<string>",
"stock": "<string>",
"min_fill": "<string>"
}
],
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_revision: '<string>',
valid_until: 1,
lines: [
{
venue: '<string>',
buy: '<string>',
sell: '<string>',
stock: '<string>',
min_fill: '<string>'
}
],
quote_identity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.lamarge.trade/v1/quote-lines/prepare', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/quote-lines/prepare"
payload = {
"expected_revision": "<string>",
"valid_until": 1,
"lines": [
{
"venue": "<string>",
"buy": "<string>",
"sell": "<string>",
"stock": "<string>",
"min_fill": "<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",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_revision": "<string>",
"valid_until": 1,
"lines": [
{
"venue": "<string>",
"buy": "<string>",
"sell": "<string>",
"stock": "<string>",
"min_fill": "<string>"
}
],
"drafts": [
{
"order_id": "<string>",
"venue": "<string>",
"draft_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sequence": 4503599627370496,
"valid_until": 1,
"expires_at": 1,
"quote_size": "<string>",
"quotes": [
{
"venue": "<string>",
"chain_id": 123,
"token": "<string>",
"recipient": "<string>",
"supply": "<string>",
"receive": "<string>",
"min_fill": "<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
}
}
}
]
}
],
"cancels": [
"<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"
}
}Quote control
Prepare quote lines
Compiles a complete replacement of the identity’s lines into one draft per live pool with stock and one cancellation per other quoted pool (quote lines); publish them within five minutes. VALIDATION_ERROR for stock without a pool on its venue, under one token or its minimum fill, or without a sell price and a buy price elsewhere that can pay for it. STATE_CONFLICT while a pool of the identity moves capital, or unless each draft’s pool is live under a current lease; each quote needs a linked, set-up account on its venue. At most 100 unpublished, unexpired drafts per identity, else RATE_LIMITED. Credential scope: quote, and cancel when it cancels.
POST
/
v1
/
quote-lines
/
prepare
Prepare quote lines
curl --request POST \
--url https://api.lamarge.trade/v1/quote-lines/prepare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expected_revision": "<string>",
"valid_until": 1,
"lines": [
{
"venue": "<string>",
"buy": "<string>",
"sell": "<string>",
"stock": "<string>",
"min_fill": "<string>"
}
],
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
expected_revision: '<string>',
valid_until: 1,
lines: [
{
venue: '<string>',
buy: '<string>',
sell: '<string>',
stock: '<string>',
min_fill: '<string>'
}
],
quote_identity_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.lamarge.trade/v1/quote-lines/prepare', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/quote-lines/prepare"
payload = {
"expected_revision": "<string>",
"valid_until": 1,
"lines": [
{
"venue": "<string>",
"buy": "<string>",
"sell": "<string>",
"stock": "<string>",
"min_fill": "<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",
"quote_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"expected_revision": "<string>",
"valid_until": 1,
"lines": [
{
"venue": "<string>",
"buy": "<string>",
"sell": "<string>",
"stock": "<string>",
"min_fill": "<string>"
}
],
"drafts": [
{
"order_id": "<string>",
"venue": "<string>",
"draft_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sequence": 4503599627370496,
"valid_until": 1,
"expires_at": 1,
"quote_size": "<string>",
"quotes": [
{
"venue": "<string>",
"chain_id": 123,
"token": "<string>",
"recipient": "<string>",
"supply": "<string>",
"receive": "<string>",
"min_fill": "<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
}
}
}
]
}
],
"cancels": [
"<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"
}
}Authorizations
sessionmakerCredential
Body
application/json
Response
The drafts to sign.