Quote

Documentation for eth_defi.cow.quote.Quote Python class.

class Quote

Bases: object

CowSwap quote response.

How does it look like:

{"Buy": "USDC.e", "Price": "3839.194418725202484702282634", "Sell": "WETH", "expiration": "2025-10-31T08:56:32.245289888Z", "from": "0xdcc6d3a3c006bb4a10b448b1ee750966395622c6", "id": 59969377, "quote": {"appData": "0x0000000000000000000000000000000000000000000000000000000000000000", "buyAmount": "374313", "buyToken": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8", "buyTokenBalance": "erc20", "feeAmount": "2502202500000", "kind": "sell", "partiallyFillable": False, "receiver": None, "sellAmount": "97497797500000", "sellToken": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1", "sellTokenBalance": "erc20", "signingScheme": "presign", "validTo": 1761902192}, "verified": True}

Attributes summary

buy_token

Token we are going to receive (token out)

sell_token

Token we are losing (token in)

data

Raw data from CowSwap quote endpoint

Methods summary

__init__(buy_token, sell_token, data)

get_buy_amount()

Get the buy amount from the quote.

get_price()

Get the price implied by the quote (buy amount / sell amount).

get_sell_amount()

Get the sell amount from the quote.

pformat()

Pretty format the quote data.

buy_token: eth_defi.token.TokenDetails

Token we are going to receive (token out)

sell_token: eth_defi.token.TokenDetails

Token we are losing (token in)

data: dict

Raw data from CowSwap quote endpoint

See Order structure at https://docs.cow.fi/cow-protocol/reference/apis/orderbook

get_buy_amount()

Get the buy amount from the quote.

Return type

decimal.Decimal

get_sell_amount()

Get the sell amount from the quote.

Return type

decimal.Decimal

get_price()

Get the price implied by the quote (buy amount / sell amount).

Return type

decimal.Decimal

pformat()

Pretty format the quote data.

Return type

str

__init__(buy_token, sell_token, data)
Parameters
Return type

None