Respond with Self-Execution Quote

This mode enables users to request quotes that they can execute themselves. Upon request, solvers provide interaction details, in addition to quote amounts.

Request

Request from user for a quote.

{
 'chain_id': 42161,
 'msg_topic': 'taker_quote',
 'msg_type': 'request',
 'msg': {
   'quote_id': 'dc8afe28-bc96-446e-a134-9e4de5704dc4',
   'order_type': '121',
   'base_settle_gas': 145000,
   'approval_type': 'Standard',
   'taker': '0x43c33c2e0f3E076793f51028D80a490b3BEb4C09',
   'receiver': '0x43c33c2e0f3E076793f51028D80a490b3BEb4C09',
   'expiry': 1734441089,
   'exclusivity_deadline': 1734441089,
   'nonce': '293151850998689970227469782035377180100',
   'slippage': 0.1,
   'hooks_data': '0x',
   'partner_info': '0',
   'sell_tokens': [
     {
       'address': '0x6c84a8f1c29108F47a79964b5Fe888D4f4D0dE40',
       'amount': '83649370402483',
       'usd_price': 106695.0
     }
    ],
    'buy_tokens': [
      {
        'address': '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',
        'amount': None,
        'usd_price': 3999.2
      }
    ],
    'native_token_price': 3999.2
  }
}

base_settle_gas is an estimate amount of gas the execution will use excluding any interactions. You may ignore this field for this mode.

Response

msg_topic

As per the request, the response msg_topic is taker_quote

msg

quote_id

As per the request.

amounts

Calculate your quote for all tokens listed in buy_tokens and respond with amount in the response.

Respond with a list of TokenAmountResponse

fee

Must be "0" for self-execution mode.

executor

As opposed to gasless mode where the solver executes the order, in self-execution mode the executor is the taker. Respond with the address of taker from the request.

interactions

The interactions of the solution, returned as a list of InteractionDetails .

The InteractionDetails are comprised of a data field, and a gas field which represents the gas cost of the InteractionData .

By default, the balance_recipient is the Jam Contract. The solvers can specify the recipient of the user's funds.

Example Response

Error Codes

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

Error
Descriptions

Unavailable to provide quotes

Type of order or tokens not supported

Order size is too small to cover fee

Unknown error

Example error response:

Last updated