Comment on page
API Reference v1
By querying the Quote endpoint, users can retrieve details on the current pricing and the estimated gas required to perform the transaction. This endpoint can be used to quickly get the best estimated buy amount for a swap. It is recommended to call the Quote endpoint before using the Solve endpoint to evaluate whether the current estimated buy amount is appealing enough to proceed with the swap. This approach enables users to make informed decisions and assess the feasibility of executing the transaction based on the provided quote information.
In addition to the quote information, the Solve endpoint delivers the actual solution in the form of a transaction ready to be executed on-chain. Target contract can be found in the Solver Contracts section. This functionality allows users to seamlessly integrate the provided transaction data into their own systems or applications, simplifying the process of executing transactions on the blockchain.
https://api.propellerheads.xyz/v1/solver/quote?blockchain=ethereum
Request Parameters
The parameters needed to call the
quote
endpoint are the following:Parameter | Description | Example |
---|---|---|
sell_token | (string) ERC20 token address of the token you want to sell. Lower case allowed. | sell_token=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 |
buy_token | (string) ERC20 token address you want to buy. Lower case allowed. | buy_token=0x6B175474E89094C44Da98b954EedeAC495271d0F |
sell_amount | (optional float) The amount of sell_token you want to send.
Either this or sell_amount_integer should be specified. | sell_amount=10.5 |
sell_amount_integer | (optional str) The amount of sell_token you want to send. Assumes the amount is given in WEI. Either this or sell_amount should be specified. | sell_amount_integer="10" |
amms | (optional string) Exchanges to exclusively include in the solution. By default, this is "+all", which includes all exchanges. | amms="+all", "-maverick" |
origin_address | (optional string) Wallet address with funds. | origin_address="0x0000000000000000000000000000000000000000" |
curl -X 'GET' \
'https://api-dev.bots.multiplier.xyz/solver/quote?blockchain=ethereum&sell_token=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&buy_token=0x6B175474E89094C44Da98b954EedeAC495271d0F&sell_amount=10000000.0' \
-H 'accept: application/json' \
-H 'amms: +all, -maverick' \
-H 'origin_address: "0x0000000000000000000000000000000000000000'
The response from the
quote
endpoint looks like:{
request_id: "quote-3b66116c",
bought: "1.968730552669545614",
bought_integer: 1968730552669545614
gas: 132000
buy_tokens: {
"symbol": "DAI",
"decimals": "18",
"address": "0x6B175474E89094C44Da98b954EedeAC495271d0F"
},
sell_tokens: {
"symbol": "USDC",
"decimals": "6",
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
},
}
Request_id
is the unique ID used to identify the quote. While bought/bought_integer
and gas
represent the best estimated values that the PropellerSolver can give at the current moment. Be aware that for now bought
and bought_integer
are supported but will be abandoned in the future. Finally, buy_token
and sell_token
are the tokens that were provided for the quote.https://api.propellerheads.xyz/v1/solver/solve?blockchain=ethereum
{
"orders": [
{
"origin_address": "0x0000000000000000000000000000000000000000",
"sell_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"buy_token": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"sell_amount": "10000000000000",
"buy_amount": "1000000000000000000000"
},
{
"origin_address": "0x0000000000000000000000000000000000000000",
"sell_token": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"buy_token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"sell_amount": "10000000000",
"buy_amount": "10000000000000000000"
}
],
"amms": [
"+all",
"-maverick"
],
"slippage": 0.0001
}
Parameters | Description | Example |
---|---|---|
amms | (optional string) Exchanges to exclusively include in the solution. By default, this is "+all", which includes all exchanges. | amms="+all", "-maverick" |
orders | A list of orders to be solved. | [ { "origin_address": "0x0000000000000000000000000000000000000000", "sell_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", "buy_token": "0x6B175474E89094C44Da98b954EedeAC495271d0F", "sell_amount": "10000000000000", "buy_amount": "1000000000000000000000" } ] |
slippage | (float) Is a float representing the percentage of acceptable difference between the expected price of an order and the price when the order actually executes. The default value is 0.0005. | slippage=0.0005 |
Parameters | Description | Example |
---|---|---|
origin_address | (string) Wallet address with funds. | origin_address=0x0000000000000000000000000000000000000000 |
sell_token | (string) ERC20 token address of the token you want to sell. | sell_token=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 |
buy_token | (string) ERC20 token address you want to buy. | buy_token=0x6B175474E89094C44Da98b954EedeAC495271d0F |
sell_amount | (string) The amount of sell_token (in sell_token base units) you want to send. Assumes the amount is given in WEI, unless it contains a decimal point (no comma) - then it is interpret as on chain amount. | sell_amount=10000000000000 |
buy_amount | (optional string) The minimum amount of buy_token (in buy_token base units) you want to receive. If the solver can't find a solution with a better buy amount than this, it will fail immediately. | buy_amount=1000000000000000000000 |
For performing swaps involving native tokens, please use the zero address
0x0000000000000000000000000000000000000000
as either the sell_token
or buy_token
parameter.curl -X 'POST' \
'https://api.propellerheads.xyz/solver/solve?blockchain=ethereum' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"orders": [
{
"origin_address": "0x0000000000000000000000000000000000000000",
"sell_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"buy_token": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"sell_amount": "10000000000000",
"buy_amount": "1000000000000000000000"
},
{
"origin_address": "0x0000000000000000000000000000000000000000",
"sell_token": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"buy_token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"sell_amount": "10000000000",
"buy_amount": "10000000000000000000"
}
],
"amms": [
"+all",
"-maverick"
],
"slippage": 0.0001
}'
{
"request_id": "solve-79fe3959",
"solutions": [
{
"orders": [
{
"origin_address": "0x0000000000000000000000000000000000000000",
"sell_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"buy_token": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"sell_amount": "10000000000000",
"executed_sell_amount": "10000000000000",
"buy_amount": "1000000000000000000000",
"executed_buy_amount": "10000000000000000000000000",
"external_id": "0"
}
],
"call_data": "0x6e5129d10000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000c1000000000000000000000000000000000000000000000000000009184e72a000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000084595161401484a0000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000d00000000000089b78cfa322f6c5de0abceecab66aee45393cc5aa0b86991c6218b36c1d19d4a2e9eb0ce3606eb480c0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000410b3da0f9b97274aba67574d1b517386d087e33db5ca5ca84b37820ec0305d0851d570c659d25f8bbe55111b82259616da1632eb1bf535fa517ee51aa6e1d78811b00000000000000000000000000000000000000000000000000000000000000",
"gas": "211500"
},
{
"orders": [
{
"origin_address": "0x0000000000000000000000000000000000000000",
"sell_token": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
"buy_token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"sell_amount": "10000000000",
"executed_sell_amount": "10000000000",
"buy_amount": "10000000000000000000",
"executed_buy_amount": "1810190970975596824838",
"external_id": "1"
}
],
"call_data": "0x6e5129d10000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000de00000000000000000000000000000000000000000000000000000002540be4002260fac5e5542a773aa44fbcfedf7c193bc2c5990000000000000000000000000000000000000000000000622172394cabe3c906c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000010000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000bb80c000000000000000000000000000000000000000000cbcdf9626bc03e24f779434178a73a0b4bad62ed010000000000000000000000000000000000000000000000000000000000000000000000000000411ad6fd89965499f916479cfb35777e6b08c042130375aaf03a1f379d29d7f66b18a8de463e0efde9eabc8ca0c041a26059aab4890542f73cc00ae51583e39b9b1b00000000000000000000000000000000000000000000000000000000000000",
"gas": "107100"
}
]
}
Where there is one solution per order that was in the request, the solution is defined by the same parameters as the order (to match order and solution) and the following parameters:
Field | Description |
---|---|
executed_buy_amount | (string) Optimised amount of buy_token that the solver found. |
gas | (string) Estimated gas used in the txs (right now this value is rather imprecise). |
call_data | (string) Call data used to execute the txs found by the solver. This data is meant to be sent to our Solver Contracts. |
The PropellerSolver API follows standard HTTP status codes to indicate success or failure. In case of an error, additional information is provided in the response body to help identify and resolve the issue.
- Status: 400 Bad Request: This indicates an invalid request or missing parameters in the request. Examples of 400 Bad Request errors:
Token '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' not found
- token is not yet supported by the PropellerSolverInvalid token address. Please input a valid hex string token address
- the token address (ofsell_token
orbuy_token
) is invalid.
- Status: 500 Internal Server Error: This indicates an internal server error occurred. Please contact us for assistance.
Both endpoints have a rate limiting of 3 requests per second. If you need to support higher loads – please contact us.
Last modified 6d ago