Execute Order

Request

The request signals that the solver should execute the quote with quote_id.

For convenienve, slippage adjusted amounts are presented with min_amounts. These values must be used when constructing the order parameters.

The signature of the user is provided.

Permit signatures are also provided where the user has not already approved Bebop and the approval type is Permit or Permit2.

{
  'chain_id': 42161,
  'msg_topic': 'execute_order',
  'msg_type': 'request',
  'msg': {
    'quote_id': '1e00b618-04c5-48d1-89c2-8414d941561a',
    'signature': '0x06f3dd3eb44b1bc0b03fd5f98789f61fa547e5a7cbc0b80ec087b8edd14ef7f50b8b372e812e7ba40bf9212a242318bc0f16db30626bd49a80787c689bfa25841c',
    'min_amounts': [
      {
        'address': '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
        'amount': '2202235984731844'
      }
    ]
  }
}

Upon receiving the execute request, you will need to execute the quote using settle function

See JAM Smart Contracts for settlement contract addresses and ABI on details how to contruct this call.

Response

The solver has 2 seconds to return its response whether it will execute or not. If the solver said that it would execute the order, but did not execute it before expiry, then solver will receive a decrease in the solver rating.

Response if the solver decides to execute order:

{
  "chain_id": 137,
  "msg_topic": "execute_order",
  "msg_type": "response",
  "msg": {
    "quote_id": "1cb3301c-6bf6-4e70-be02-3838137ae2eb"
  }
}

Error Codes

In addition to a successful response, you may also return an error when the order is unsuccessful.

Returning order errors may cause your solver to be excluded from quote flow as it will be considered to be unreliable.

Error
Descriptions
reject

The solver rejects to execute this order. This error could be returned when prices are no longer available or for other reasons, the solver can no longer follow through with the quote.

Example error response:

{
  "chain_id": 137,
  "msg_topic": "execute_order",
  "msg_type": "error",
  "msg": {
    "quote_id": "1cb3301c-6bf6-4e70-be02-3838137ae2eb",
    "error_type": "reject",
    "error_msg": "simulation failed",
  }
}

Last updated