Price and wait

By default, the exchange does not pick the offer with the lowest charge. It picks the offer with the lowest cost: the estimated charge plus the wait cost. The wait cost is the money value that you give to the time that you wait for the answer.

This applies to the price strategy, which is the default. The cheapest axis uses it too.

How the cost is made

The exchange adds two amounts for each offer that meets your limits:

cost = estimated charge + (predicted wait in ms × wait value)

The offer with the lowest cost wins. The exchange then runs the normal steps: the price cap, the hold, and the charge for the tokens that the provider really used.

Example

Two offers answer the same request. The wait value is the default, 200 nano-USD for each millisecond.

Offer Estimated charge Predicted wait Wait cost Cost
A $0.0100 4.0 s $0.0008 $0.0108
B $0.0105 0.5 s $0.0001 $0.0106

Offer B wins, although its charge is higher. You pay the real charge of offer B, which is never more than its price cap. If you set the wait value to zero, offer A wins.

Change the wait value

Set exchange.rank.latency_nanos_per_ms in a request or in a preset. Use a whole number that is zero or more.

{ "exchange": { "rank": { "latency_nanos_per_ms": 0 } } }
Value Result
Not set The default of the exchange, 200.
0 The exchange ranks on the estimated charge alone. An explicit 0 beats a preset.
A larger number A faster offer wins more often, even when its charge is higher.
Above 1000000000 The exchange lowers the value to 1000000000.

The exchange refuses a value that is not a whole number or that is below zero.

What the wait value changes

The wait value changes only the order of the offers. These rules do not change:

When the exchange ranks on price alone

The exchange ranks on the estimated charge alone in these cases:

To see why an offer won, read Explain the choice.

Next steps