Skip to main content

get_quote

Intro

URL: https://rfq-quotes.angstrom.xyz/get_quote Swagger Api: https://sorellalabs.github.io/angstrom-rfq-quoter/

Submit a request for a quote to swap tokens with a specified input or output amount. Returns the amount in/out based off current pool state, the target block for the execution, the executable calldata for the universal router (with either the encoded bundle or unlock attestation), and the encoded angstrom bundle, if applicable.

Notes

  • The call is only valid for block n+1, where n is the current chain tip, so set the block parameter in the request to the current block number + 1.
warning

Angstrom nodes don't complete consensus until about 9 seconds into the block, so this endpoint will hang from 0s < t < 9s, and will return results from 9s < t < 12s - This will, however, guarantee pool state post bundle execution

Parameters

ParameterTypeDescription
blocknumberThe block number for which the returned calldata is valid (current block + 1)
token_instringThe input token
token_outstringThe output token
amount_innumber?(optional) The amount in requested, returns the amount out expected (conflicts with amount_out)
amount_outnumber?(optional) The amount out requested, returns the amount in required (conflicts with amount_in)

Result

FieldTypeDescription
messagestringThe message returned by the simulated swap (empty if success = true)
successboolWhether or not the sim was successful
target_blocknumberThe target block for execution
token_instringThe input token
token_outstringThe output token
token_in_amountnumberThe input token amount
token_out_amountnumberThe output token amount
calldatastringThe encoded calldata with the angstrom bundle or empty block attestation with the simulated swap
angstrom_bundlestring?The encoded bundle calldata (if applicable)

Request

curl -X 'POST' \
'https://rfq-quotes.angstrom.xyz/get_quote' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"block": 23635551,
"token_in": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"token_out": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"amount_in": "1000000000"
}'

Response

{
"success": true,
"message": "",
"target_block": 23635551,
"token_in": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"token_out": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"token_in_amount": "0x3b9aca00",
"token_out_amount": "0x3a7bb68bccf95eb",
"calldata": "0x24856bc30000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000340000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000003060c0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000020000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000aa232009084bd71a5797d089aa4edfad40000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000003a7bb68bccf95eb000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000003a7bb68bccf95eb",
"angstrom_bundle": "0x02f9034f0182fd5e80840c0380c18306c523940000000aa232009084bd71a5797d089aa4edfad480b902e409c5eabe000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002950000cca0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000893dc6a00000000000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000005f746140000000000000000000001a23836610f000000000000000000cf33de325fc800dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000049c9ee10000000000000000000000000000000000004c000000010000000000000000000000000000000000000032c14f8f6718df9dde4397f7231b8800010002000100000000000000000000000000000000000000000000000034a40116329c4f9a00006602000000000000000000000086bc0155d158000000000000000000000000000000073b00000000000000000264ed5241e9b44f03000100000000000000000048763aa4580ef10000000000000000000001a23836610f0000000000000000003024aa42ec2e350001080900000000000000000086bc0155d158000000000000000000000000000893d52f000000000000000000000000000000010000000000000000000000000000000000001b15cba59edd6c29d875825218a47709e316b0b231776a63bf5ed082fcba9418b117acb9bf310e64844198e3fb05a8b48eeb62a1f102877a52355758b1630160800b0000000000000000004877dcdc8e7000000000000000000000000000049c9ee100000000000000000000000005f7461400000000000000000000000005f7461400011cbabd869a4c8321b2bd785f74bf3278c227bc00718a793c3b19aa83cf7bba231c66f98ece85b72dd6f423bd3184849f6ba20251c80f09a6ae895dd38c6763bafc0000000000000000000000000000c001a04d2e08b733450dd5e3f595de127d0d7f20c2d5363b9944108350fa6158b3eb61a0297bb4f590d51a6fd547d8bdc7592a644b50db4fe4a808d1507cbe81783c9829"
}