curl --request POST \
--url https://api.lamarge.trade/v1/transfers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_transfer_id": "<string>",
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"payer": "<string>",
"recipient": "<string>",
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"funding": "venue",
"max_parts": 8,
"previous_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_fee_bps": 50,
"from_dex": "xyz"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_transfer_id: '<string>',
from: '<string>',
to: '<string>',
amount_in: '<string>',
min_out: '<string>',
payer: '<string>',
recipient: '<string>',
move_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
funding: 'venue',
max_parts: 8,
previous_transfer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
max_fee_bps: 50,
from_dex: 'xyz'
})
};
fetch('https://api.lamarge.trade/v1/transfers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/transfers"
payload = {
"client_transfer_id": "<string>",
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"payer": "<string>",
"recipient": "<string>",
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"funding": "venue",
"max_parts": 8,
"previous_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_fee_bps": 50,
"from_dex": "xyz"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"destination": "venue",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_transfer_id": "<string>",
"client_take_id": "<string>",
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"max_parts": 4,
"payer": "<string>",
"recipient": "<string>",
"from_chain_id": 123,
"to_chain_id": 123,
"withdrawal_preparation": {
"amount": "<string>",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"chainId": 123,
"verifyingContract": "<string>",
"version": "<string>"
},
"message": {}
},
"created_at": "2023-11-07T05:31:56Z"
},
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"venue": "<string>",
"from_dex": "xyz",
"kind": "withdrawal",
"amount": "<string>",
"destination": "<string>",
"state": "queued",
"venue_ref": "<string>",
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"relayed_at": "2023-11-07T05:31:56Z",
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"funding_plan": {
"observed_at": "2023-11-07T05:31:56Z",
"venue": "<string>",
"owner": "<string>",
"amount": "<string>",
"deposit": "<string>",
"withdrawal_amount": "<string>",
"withdrawal_to": "signer",
"payment_setup": "done",
"signed_at_once": true,
"requests": [
{
"kind": "permit",
"signer": "<string>",
"chain_id": 123
}
]
},
"funding_plan_error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"venue": "<string>",
"step": "permit",
"retry_after": 2
},
"take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"take_final": true,
"previous_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"continuable": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"grouped": {
"state": "prepared",
"second_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"second_take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commit_by": "2023-11-07T05:31:56Z"
},
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversion": {
"amount_in": "<string>",
"min_out": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chain_id": 123,
"escrow": "<string>",
"payer": "<string>",
"converter": "<string>",
"token": "<string>",
"nonce": "<string>",
"deadline": "<string>",
"prepared_block": 123,
"state": "prepared",
"attempts": [
"<string>"
],
"tx_hash": "<string>",
"received": "<string>",
"block_number": 123
},
"funding": "venue",
"max_fee_bps": 50,
"from_dex": "xyz",
"then": {
"to": "<string>",
"recipient": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"destination": "venue",
"max_fee_bps": 50,
"chain_id": 123
}
}{
"destination": "venue",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_transfer_id": "<string>",
"client_take_id": "<string>",
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"max_parts": 4,
"payer": "<string>",
"recipient": "<string>",
"from_chain_id": 123,
"to_chain_id": 123,
"withdrawal_preparation": {
"amount": "<string>",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"chainId": 123,
"verifyingContract": "<string>",
"version": "<string>"
},
"message": {}
},
"created_at": "2023-11-07T05:31:56Z"
},
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"venue": "<string>",
"from_dex": "xyz",
"kind": "withdrawal",
"amount": "<string>",
"destination": "<string>",
"state": "queued",
"venue_ref": "<string>",
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"relayed_at": "2023-11-07T05:31:56Z",
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"funding_plan": {
"observed_at": "2023-11-07T05:31:56Z",
"venue": "<string>",
"owner": "<string>",
"amount": "<string>",
"deposit": "<string>",
"withdrawal_amount": "<string>",
"withdrawal_to": "signer",
"payment_setup": "done",
"signed_at_once": true,
"requests": [
{
"kind": "permit",
"signer": "<string>",
"chain_id": 123
}
]
},
"funding_plan_error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"venue": "<string>",
"step": "permit",
"retry_after": 2
},
"take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"take_final": true,
"previous_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"continuable": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"grouped": {
"state": "prepared",
"second_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"second_take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commit_by": "2023-11-07T05:31:56Z"
},
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversion": {
"amount_in": "<string>",
"min_out": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chain_id": 123,
"escrow": "<string>",
"payer": "<string>",
"converter": "<string>",
"token": "<string>",
"nonce": "<string>",
"deadline": "<string>",
"prepared_block": 123,
"state": "prepared",
"attempts": [
"<string>"
],
"tx_hash": "<string>",
"received": "<string>",
"block_number": 123
},
"funding": "venue",
"max_fee_bps": 50,
"from_dex": "xyz",
"then": {
"to": "<string>",
"recipient": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"destination": "venue",
"max_fee_bps": 50,
"chain_id": 123
}
}{
"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"
}
}Create a recoverable transfer
Records a take to come and, from venue margin (not Lighter or Aster), the withdrawal it needs (paying from venue margin); moves no funds and reserves nothing. No payment setup needed; funding_plan asks for a permit when wallet funds need one.
curl --request POST \
--url https://api.lamarge.trade/v1/transfers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_transfer_id": "<string>",
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"payer": "<string>",
"recipient": "<string>",
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"funding": "venue",
"max_parts": 8,
"previous_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_fee_bps": 50,
"from_dex": "xyz"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
client_transfer_id: '<string>',
from: '<string>',
to: '<string>',
amount_in: '<string>',
min_out: '<string>',
payer: '<string>',
recipient: '<string>',
move_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
funding: 'venue',
max_parts: 8,
previous_transfer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
max_fee_bps: 50,
from_dex: 'xyz'
})
};
fetch('https://api.lamarge.trade/v1/transfers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lamarge.trade/v1/transfers"
payload = {
"client_transfer_id": "<string>",
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"payer": "<string>",
"recipient": "<string>",
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"funding": "venue",
"max_parts": 8,
"previous_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_fee_bps": 50,
"from_dex": "xyz"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"destination": "venue",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_transfer_id": "<string>",
"client_take_id": "<string>",
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"max_parts": 4,
"payer": "<string>",
"recipient": "<string>",
"from_chain_id": 123,
"to_chain_id": 123,
"withdrawal_preparation": {
"amount": "<string>",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"chainId": 123,
"verifyingContract": "<string>",
"version": "<string>"
},
"message": {}
},
"created_at": "2023-11-07T05:31:56Z"
},
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"venue": "<string>",
"from_dex": "xyz",
"kind": "withdrawal",
"amount": "<string>",
"destination": "<string>",
"state": "queued",
"venue_ref": "<string>",
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"relayed_at": "2023-11-07T05:31:56Z",
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"funding_plan": {
"observed_at": "2023-11-07T05:31:56Z",
"venue": "<string>",
"owner": "<string>",
"amount": "<string>",
"deposit": "<string>",
"withdrawal_amount": "<string>",
"withdrawal_to": "signer",
"payment_setup": "done",
"signed_at_once": true,
"requests": [
{
"kind": "permit",
"signer": "<string>",
"chain_id": 123
}
]
},
"funding_plan_error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"venue": "<string>",
"step": "permit",
"retry_after": 2
},
"take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"take_final": true,
"previous_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"continuable": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"grouped": {
"state": "prepared",
"second_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"second_take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commit_by": "2023-11-07T05:31:56Z"
},
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversion": {
"amount_in": "<string>",
"min_out": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chain_id": 123,
"escrow": "<string>",
"payer": "<string>",
"converter": "<string>",
"token": "<string>",
"nonce": "<string>",
"deadline": "<string>",
"prepared_block": 123,
"state": "prepared",
"attempts": [
"<string>"
],
"tx_hash": "<string>",
"received": "<string>",
"block_number": 123
},
"funding": "venue",
"max_fee_bps": 50,
"from_dex": "xyz",
"then": {
"to": "<string>",
"recipient": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"destination": "venue",
"max_fee_bps": 50,
"chain_id": 123
}
}{
"destination": "venue",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"client_transfer_id": "<string>",
"client_take_id": "<string>",
"from": "<string>",
"to": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"max_parts": 4,
"payer": "<string>",
"recipient": "<string>",
"from_chain_id": 123,
"to_chain_id": 123,
"withdrawal_preparation": {
"amount": "<string>",
"typed_data": {
"types": {},
"primaryType": "<string>",
"domain": {
"name": "<string>",
"chainId": 123,
"verifyingContract": "<string>",
"version": "<string>"
},
"message": {}
},
"created_at": "2023-11-07T05:31:56Z"
},
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"venue": "<string>",
"from_dex": "xyz",
"kind": "withdrawal",
"amount": "<string>",
"destination": "<string>",
"state": "queued",
"venue_ref": "<string>",
"error": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"relayed_at": "2023-11-07T05:31:56Z",
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"funding_plan": {
"observed_at": "2023-11-07T05:31:56Z",
"venue": "<string>",
"owner": "<string>",
"amount": "<string>",
"deposit": "<string>",
"withdrawal_amount": "<string>",
"withdrawal_to": "signer",
"payment_setup": "done",
"signed_at_once": true,
"requests": [
{
"kind": "permit",
"signer": "<string>",
"chain_id": 123
}
]
},
"funding_plan_error": {
"code": "<string>",
"message": "<string>",
"status": 123,
"reason": "<string>",
"venue": "<string>",
"step": "permit",
"retry_after": 2
},
"take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"take_final": true,
"previous_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"continuable": "<string>",
"cancelled_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"grouped": {
"state": "prepared",
"second_transfer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"second_take_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commit_by": "2023-11-07T05:31:56Z"
},
"move_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversion": {
"amount_in": "<string>",
"min_out": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"chain_id": 123,
"escrow": "<string>",
"payer": "<string>",
"converter": "<string>",
"token": "<string>",
"nonce": "<string>",
"deadline": "<string>",
"prepared_block": 123,
"state": "prepared",
"attempts": [
"<string>"
],
"tx_hash": "<string>",
"received": "<string>",
"block_number": 123
},
"funding": "venue",
"max_fee_bps": 50,
"from_dex": "xyz",
"then": {
"to": "<string>",
"recipient": "<string>",
"amount_in": "<string>",
"min_out": "<string>",
"destination": "venue",
"max_fee_bps": 50,
"chain_id": 123
}
}{
"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
The linked account on to; with destination wallet, any address a wallet delivery accepts.
^0x[0-9a-fA-F]{40}$The move this transfer belongs to (moves): the root of a route only, from the move's origin and payer, ending at its destination.
Response
Existing identical intent.
Where a take delivers on to: venue, into the taker's account linked there; wallet, by plain transfer to recipient's address on to's escrow chain, in that chain's wallet token (chain.wallet in GET /v1/venues; on Polygon native USDC converted from pUSD), to any address a wallet delivery accepts.
venue, wallet Returned on creation and with funding_plan=true while the transfer has no take and is not cancelled: before a withdrawal, or once a relayed withdrawal's funds at the wallet plus the available balance cover amount_in. Null otherwise, when paying from Lighter or Aster, or when it cannot be computed.
Show child attributes
Show child attributes
Why funding_plan could not be computed when it was asked for, as the refusal would carry it: such as VALIDATION_ERROR for a withdrawable balance short of the amount, VENUE_UNAVAILABLE while a chain does not answer, or STATE_CONFLICT with retry_after while an earlier withdrawal of the account is being sent. Null otherwise.
Show child attributes
Show child attributes
With then, once no part of its take can deliver more and unless cancelled: what a continuation may still pay, in to base units: what the take delivered, less what continuations may pay or paid (fees included) and the next payment's fee, in whole millionths. Null otherwise, or while Lighter's fee is unknown.
^[0-9]{1,78}$