v1

latestOpenAPI 3.0.32026-07-17588.3 KB

Estimated Buy Amount

Estimate the buy amount (in buy tokens) a user can set as a limit order while still expecting to be completely matched when selling the given amount of quote token.

get/api/v1/markets/{market}/estimated-buy-amount/{sell amount in quote}

Path parameters

marketstring required

token pair of the form <buy token>-<sell token>

sell amount in quotenumber required

Query parameters

unit'baseunits' | 'atoms'
Example:baseunits

If baseunits (the default) all amounts are denominated in the "natural" unit of the respective token given by the number of decimals specified through the ERC20 interface. If set to atoms all amounts are denominated in the smallest available unit (atom) of the token.

batchIdinteger

The batch ID to compute the estimate for, only accounting orders that are valid at the specified batch. If no batch ID is specified, the current batch that is collecting orders will be used.

ignoreAddressesstring

Comma separated list of addresses in hex notation whose orders should be ignored. Capitalization of letters does not matter. No space after the commas.

blockNumberinteger

The block number to compute the estimate for. This will use the open orderbook at that block (i.e. orders that will be considered for solving the current batch at the block number). This parameter cannot be specified together with the "batchId" query parameter.

roundingBuffer'enabled' | 'disabled'
Example:enabled

If enabled (the default) the orderbook is adjusted by a rounding buffer that is used by the solvers internally. This makes the results more accurately reflect how the solvers see the orderbook. If set to disabled no adjustments take place which can lead to for example prices for orders that would not actually get matched by the solver.

Response

OK

baseTokenIdinteger
quoteTokenIdinteger
buyAmountInBasestring
sellAmountInQuotestring

Example response

{
  "baseTokenId": 1,
  "quoteTokenId": 7,
  "buyAmountInBase": "0.0025",
  "sellAmountInQuote": "1"
}
All 5 operations