curl --request POST \
--url https://{environment}.garden.finance/v3/quote \
--header 'Content-Type: application/json' \
--header 'garden-app-id: <api-key>' \
--data '
{
"source": {
"asset": "arbitrum_sepolia:wbtc",
"owner": "<string>",
"delegate": "<string>",
"amount": "20000"
},
"destination": {
"asset": "arbitrum_sepolia:wbtc",
"owner": "<string>",
"delegate": "<string>",
"amount": "20000"
},
"slippage": 50,
"affiliate_fees": [],
"nonce": "<string>"
}
'{
"status": "Ok",
"result": {
"request_id": "<string>",
"quotes": [
{
"id": "<string>",
"solver_id": "<string>",
"secret_hash": "<string>",
"source_swap_id": "<string>",
"destination_swap_id": "<string>",
"source": {
"asset": "solana_testnet:usdc",
"amount": "15082000",
"display": "15.08200000",
"value": "15.0820"
},
"destination": {
"asset": "solana_testnet:usdc",
"amount": "15082000",
"display": "15.08200000",
"value": "15.0820"
},
"fee": 123,
"fixed_fee": "<string>",
"slippage": 123,
"estimated_time": 123,
"deadline": 123,
"initiate": {
"type": "evm",
"chain_id": 421614,
"initiate_transaction": {
"to": "0xb5ae9785349186069c48794a763db39ec756b1cf",
"value": "0x0",
"data": "0x97ffc7ae0000000000000000000000001fd1f7b5c6e4e7b9f80a4db17903afd83d3fd31d",
"gas_limit": "0x493e0",
"chain_id": 421614
},
"approval_transaction": {
"to": "0xb5ae9785349186069c48794a763db39ec756b1cf",
"value": "0x0",
"data": "0x97ffc7ae0000000000000000000000001fd1f7b5c6e4e7b9f80a4db17903afd83d3fd31d",
"gas_limit": "0x493e0",
"chain_id": 421614
},
"core_to_evm_transfer": {
"to": "0xb5ae9785349186069c48794a763db39ec756b1cf",
"value": "0x0",
"data": "0x97ffc7ae0000000000000000000000001fd1f7b5c6e4e7b9f80a4db17903afd83d3fd31d",
"gas_limit": "0x493e0",
"chain_id": 421614
}
}
}
]
}
}Price a swap and create the order in a single call.
Set amount on the leg you want to fix: on source to spend an exact amount, or on destination to receive one. The other side is returned in the response, along with the initiate transaction.
curl --request POST \
--url https://{environment}.garden.finance/v3/quote \
--header 'Content-Type: application/json' \
--header 'garden-app-id: <api-key>' \
--data '
{
"source": {
"asset": "arbitrum_sepolia:wbtc",
"owner": "<string>",
"delegate": "<string>",
"amount": "20000"
},
"destination": {
"asset": "arbitrum_sepolia:wbtc",
"owner": "<string>",
"delegate": "<string>",
"amount": "20000"
},
"slippage": 50,
"affiliate_fees": [],
"nonce": "<string>"
}
'{
"status": "Ok",
"result": {
"request_id": "<string>",
"quotes": [
{
"id": "<string>",
"solver_id": "<string>",
"secret_hash": "<string>",
"source_swap_id": "<string>",
"destination_swap_id": "<string>",
"source": {
"asset": "solana_testnet:usdc",
"amount": "15082000",
"display": "15.08200000",
"value": "15.0820"
},
"destination": {
"asset": "solana_testnet:usdc",
"amount": "15082000",
"display": "15.08200000",
"value": "15.0820"
},
"fee": 123,
"fixed_fee": "<string>",
"slippage": 123,
"estimated_time": 123,
"deadline": 123,
"initiate": {
"type": "evm",
"chain_id": 421614,
"initiate_transaction": {
"to": "0xb5ae9785349186069c48794a763db39ec756b1cf",
"value": "0x0",
"data": "0x97ffc7ae0000000000000000000000001fd1f7b5c6e4e7b9f80a4db17903afd83d3fd31d",
"gas_limit": "0x493e0",
"chain_id": 421614
},
"approval_transaction": {
"to": "0xb5ae9785349186069c48794a763db39ec756b1cf",
"value": "0x0",
"data": "0x97ffc7ae0000000000000000000000001fd1f7b5c6e4e7b9f80a4db17903afd83d3fd31d",
"gas_limit": "0x493e0",
"chain_id": 421614
},
"core_to_evm_transfer": {
"to": "0xb5ae9785349186069c48794a763db39ec756b1cf",
"value": "0x0",
"data": "0x97ffc7ae0000000000000000000000001fd1f7b5c6e4e7b9f80a4db17903afd83d3fd31d",
"gas_limit": "0x493e0",
"chain_id": 421614
}
}
}
]
}
}