coinbase_agentkit.action_providers.wow.uniswap package

Submodules

coinbase_agentkit.action_providers.wow.uniswap.constants module

Uniswap constants for WOW action provider.

coinbase_agentkit.action_providers.wow.uniswap.utils module

Uniswap utilities for WOW action provider.

class coinbase_agentkit.action_providers.wow.uniswap.utils.Balance(erc20z, weth)

Bases: object

Balance for a given token.

erc20z: NewType(Wei, int)
weth: NewType(Wei, int)
class coinbase_agentkit.action_providers.wow.uniswap.utils.PoolInfo(token0, balance0, token1, balance1, fee, liquidity, sqrt_price_x96)

Bases: object

Pool info for a given uniswap v3 pool.

balance0: int
balance1: int
fee: int
liquidity: int
sqrt_price_x96: int
token0: str
token1: str
class coinbase_agentkit.action_providers.wow.uniswap.utils.Price(per_token, total)

Bases: object

Price info for a given token.

per_token: PriceInfo
total: PriceInfo
class coinbase_agentkit.action_providers.wow.uniswap.utils.PriceInfo(eth, usd)

Bases: object

Price info for a given token.

eth: NewType(Wei, int)
usd: Decimal
class coinbase_agentkit.action_providers.wow.uniswap.utils.Quote(amount_in, amount_out, balance, fee, error)

Bases: object

Quote for a given uniswap v3 swap.

amount_in: int
amount_out: int
balance: Balance | None
error: str | None
fee: float | None
coinbase_agentkit.action_providers.wow.uniswap.utils.create_price_info(wei_amount, eth_price_in_usd)

Create a PriceInfo object from wei amount and ETH price.

Parameters:
  • wei_amount (NewType(Wei, int)) – Amount in wei

  • eth_price_in_usd (float) – Current ETH price in USD

Returns:

A PriceInfo object containing the amount in ETH and USD

Return type:

PriceInfo

coinbase_agentkit.action_providers.wow.uniswap.utils.exact_input_single(wallet_provider, token_in, token_out, amount_in, fee)

Get exact input quote from Uniswap.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider to use for contract calls

  • token_in (str) – Token address to swap from, such as 0x036CbD53842c5426634e7929541eC2318f3dCF7e

  • token_out (str) – Token address to swap to, such as 0x036CbD53842c5426634e7929541eC2318f3dCF7e

  • amount_in (int) – Amount of tokens to swap (in Wei)

  • fee (str) – Fee for the swap

Returns:

Amount of tokens to receive (in Wei)

Return type:

int

coinbase_agentkit.action_providers.wow.uniswap.utils.get_has_graduated(wallet_provider, token_address)

Check if a token has graduated from the Zora Wow protocol.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider to use for contract calls

  • token_address (str) – Token address, such as 0x036CbD53842c5426634e7929541eC2318f3dCF7e

Returns:

True if the token has graduated, False otherwise

Return type:

bool

coinbase_agentkit.action_providers.wow.uniswap.utils.get_pool_address(wallet_provider, token_address)

Fetch the uniswap v3 pool address for a given token.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider to use for contract calls

  • token_address (str) – The address of the token contract, such as 0x036CbD53842c5426634e7929541eC2318f3dCF7e

Returns:

The uniswap v3 pool address associated with the token.

Return type:

str

coinbase_agentkit.action_providers.wow.uniswap.utils.get_pool_info(wallet_provider, pool_address)

Get pool info for a given uniswap v3 pool address.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider to use for contract calls

  • pool_address (str) – Uniswap v3 pool address

Returns:

A PoolInfo object containing the token0, balance0, token1, balance1, fee, liquidity, and sqrt_price_x96.

Return type:

PoolInfo

coinbase_agentkit.action_providers.wow.uniswap.utils.get_uniswap_quote(wallet_provider, token_address, amount, quote_type)

Get Uniswap quote for buying or selling tokens.

Parameters:
  • wallet_provider (EvmWalletProvider) – The wallet provider to use for contract calls

  • token_address (str) – Token address, such as 0x036CbD53842c5426634e7929541eC2318f3dCF7e

  • amount (int) – Amount of tokens (in Wei)

  • quote_type (Literal['buy', 'sell']) – ‘buy’ or ‘sell’

Returns:

A Quote object containing the amount in, amount out, balance, fee, and any error messages.

Return type:

Quote

Module contents

Uniswap integration for WOW action provider.