Aerodrome¶
Connector for Aerodrome (Solidly-based) DEX on Base.
almanak.framework.connectors.aerodrome
¶
Aerodrome Finance Connector.
This package provides integration with Aerodrome Finance, a Solidly-based AMM on Base chain. Aerodrome supports dual pool types: - Volatile pools: xy=k formula (0.3% fee) - Stable pools: x^3y + y^3*x formula (0.05% fee)
Key Features: - Token swaps (exact input) - Liquidity provision (add/remove) - Fungible LP tokens (not NFT positions like Uniswap V3)
Example
from almanak.framework.connectors.aerodrome import AerodromeAdapter, AerodromeConfig
config = AerodromeConfig( chain="base", wallet_address="0x...", ) adapter = AerodromeAdapter(config)
Execute a volatile pool swap¶
result = adapter.swap_exact_input( token_in="USDC", token_out="WETH", amount_in=Decimal("1000"), stable=False, )
Execute a stable pool swap¶
result = adapter.swap_exact_input( token_in="USDC", token_out="USDbC", amount_in=Decimal("1000"), stable=True, )
AerodromeAdapter
¶
Adapter for Aerodrome Finance DEX protocol.
This adapter provides methods for: - Executing token swaps (exact input) - Adding and removing liquidity - Building swap and LP transactions - Handling ERC-20 approvals - Managing slippage protection
Example
config = AerodromeConfig( chain="base", wallet_address="0x...", ) adapter = AerodromeAdapter(config)
Execute a volatile pool swap¶
result = adapter.swap_exact_input( token_in="USDC", token_out="WETH", amount_in=Decimal("1000"), stable=False, slippage_bps=50, )
Execute a stable pool swap¶
result = adapter.swap_exact_input( token_in="USDC", token_out="USDbC", amount_in=Decimal("1000"), stable=True, slippage_bps=10, )
Initialize the adapter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
AerodromeConfig
|
Aerodrome adapter configuration |
required |
token_resolver
|
TokenResolver | None
|
Optional TokenResolver instance. If None, uses singleton. |
None
|
swap_exact_input
¶
swap_exact_input(
token_in: str,
token_out: str,
amount_in: Decimal,
stable: bool = False,
slippage_bps: int | None = None,
recipient: str | None = None,
) -> SwapResult
Build a swap transaction with exact input amount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_in
|
str
|
Input token symbol or address |
required |
token_out
|
str
|
Output token symbol or address |
required |
amount_in
|
Decimal
|
Amount of input token (in token units, not wei) |
required |
stable
|
bool
|
Pool type (True=stable, False=volatile) |
False
|
slippage_bps
|
int | None
|
Slippage tolerance in basis points (default from config) |
None
|
recipient
|
str | None
|
Address to receive output tokens (default: wallet_address) |
None
|
Returns:
| Type | Description |
|---|---|
SwapResult
|
SwapResult with transaction data |
add_liquidity
¶
add_liquidity(
token_a: str,
token_b: str,
amount_a: Decimal,
amount_b: Decimal,
stable: bool = False,
slippage_bps: int | None = None,
recipient: str | None = None,
) -> LiquidityResult
Build an add liquidity transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_a
|
str
|
First token symbol or address |
required |
token_b
|
str
|
Second token symbol or address |
required |
amount_a
|
Decimal
|
Amount of token A (in token units) |
required |
amount_b
|
Decimal
|
Amount of token B (in token units) |
required |
stable
|
bool
|
Pool type |
False
|
slippage_bps
|
int | None
|
Slippage tolerance in basis points |
None
|
recipient
|
str | None
|
Address to receive LP tokens |
None
|
Returns:
| Type | Description |
|---|---|
LiquidityResult
|
LiquidityResult with transaction data |
remove_liquidity
¶
remove_liquidity(
token_a: str,
token_b: str,
liquidity: Decimal,
stable: bool = False,
slippage_bps: int | None = None,
recipient: str | None = None,
) -> LiquidityResult
Build a remove liquidity transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_a
|
str
|
First token symbol or address |
required |
token_b
|
str
|
Second token symbol or address |
required |
liquidity
|
Decimal
|
LP token amount to burn (in LP token units) |
required |
stable
|
bool
|
Pool type |
False
|
slippage_bps
|
int | None
|
Slippage tolerance in basis points |
None
|
recipient
|
str | None
|
Address to receive tokens |
None
|
Returns:
| Type | Description |
|---|---|
LiquidityResult
|
LiquidityResult with transaction data |
compile_swap_intent
¶
compile_swap_intent(
intent: SwapIntent,
stable: bool = False,
price_oracle: dict[str, Decimal] | None = None,
) -> ActionBundle
Compile a SwapIntent to an ActionBundle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intent
|
SwapIntent
|
The SwapIntent to compile |
required |
stable
|
bool
|
Pool type (True=stable, False=volatile) |
False
|
price_oracle
|
dict[str, Decimal] | None
|
Optional price oracle for USD conversions |
None
|
Returns:
| Type | Description |
|---|---|
ActionBundle
|
ActionBundle containing transactions for execution |
set_allowance
¶
Set cached allowance (for testing).
AerodromeConfig
dataclass
¶
AerodromeConfig(
chain: str,
wallet_address: str,
default_slippage_bps: int = 50,
deadline_seconds: int = DEFAULT_DEADLINE_SECONDS,
price_provider: dict[str, Decimal] | None = None,
allow_placeholder_prices: bool = False,
rpc_url: str | None = None,
)
Configuration for AerodromeAdapter.
Attributes:
| Name | Type | Description |
|---|---|---|
chain |
str
|
Target blockchain (currently only "base") |
wallet_address |
str
|
Address executing transactions |
default_slippage_bps |
int
|
Default slippage tolerance in basis points (default 50 = 0.5%) |
deadline_seconds |
int
|
Transaction deadline in seconds (default 300 = 5 minutes) |
price_provider |
dict[str, Decimal] | None
|
Price oracle dict (token symbol -> USD price). Required for production use to calculate accurate slippage amounts. |
allow_placeholder_prices |
bool
|
If False (default), raises ValueError when no price_provider is given. Set to True ONLY for unit tests. |
LiquidityResult
dataclass
¶
LiquidityResult(
success: bool,
transactions: list[TransactionData] = list(),
token_a: str = "",
token_b: str = "",
amount_a: int = 0,
amount_b: int = 0,
liquidity: int = 0,
stable: bool = False,
error: str | None = None,
gas_estimate: int = 0,
)
Result of a liquidity operation.
Attributes:
| Name | Type | Description |
|---|---|---|
success |
bool
|
Whether operation was built successfully |
transactions |
list[TransactionData]
|
List of transactions to execute |
token_a |
str
|
First token address |
token_b |
str
|
Second token address |
amount_a |
int
|
Amount of token A |
amount_b |
int
|
Amount of token B |
liquidity |
int
|
LP tokens (minted or burned) |
stable |
bool
|
Pool type |
error |
str | None
|
Error message if failed |
gas_estimate |
int
|
Total gas estimate |
PoolType
¶
Bases: Enum
Pool type for Aerodrome.
SwapQuote
dataclass
¶
SwapQuote(
token_in: str,
token_out: str,
amount_in: int,
amount_out: int,
stable: bool,
gas_estimate: int = AERODROME_GAS_ESTIMATES["swap"],
price_impact_bps: int = 0,
effective_price: Decimal = Decimal("0"),
quoted_at: datetime = (lambda: datetime.now(UTC))(),
)
Quote for a swap operation.
Attributes:
| Name | Type | Description |
|---|---|---|
token_in |
str
|
Input token address |
token_out |
str
|
Output token address |
amount_in |
int
|
Input amount in wei |
amount_out |
int
|
Output amount in wei |
stable |
bool
|
Pool type (True=stable, False=volatile) |
gas_estimate |
int
|
Estimated gas for the swap |
price_impact_bps |
int
|
Price impact in basis points |
effective_price |
Decimal
|
Effective price of the swap |
quoted_at |
datetime
|
Timestamp when quote was fetched |
SwapResult
dataclass
¶
SwapResult(
success: bool,
transactions: list[TransactionData] = list(),
quote: SwapQuote | None = None,
amount_in: int = 0,
amount_out_minimum: int = 0,
error: str | None = None,
gas_estimate: int = 0,
)
Result of a swap operation.
Attributes:
| Name | Type | Description |
|---|---|---|
success |
bool
|
Whether the swap was built successfully |
transactions |
list[TransactionData]
|
List of transactions to execute |
quote |
SwapQuote | None
|
Quote used for the swap |
amount_in |
int
|
Actual input amount |
amount_out_minimum |
int
|
Minimum output amount (with slippage) |
error |
str | None
|
Error message if failed |
gas_estimate |
int
|
Total gas estimate for all transactions |
SwapType
¶
Bases: Enum
Type of swap operation.
TransactionData
dataclass
¶
TransactionData(
to: str,
value: int,
data: str,
gas_estimate: int,
description: str,
tx_type: str = "swap",
)
Transaction data for execution.
Attributes:
| Name | Type | Description |
|---|---|---|
to |
str
|
Target contract address |
value |
int
|
Native token value to send |
data |
str
|
Encoded calldata |
gas_estimate |
int
|
Estimated gas |
description |
str
|
Human-readable description |
tx_type |
str
|
Type of transaction (approve, swap, add_liquidity, remove_liquidity) |
AerodromeEvent
dataclass
¶
AerodromeEventType
¶
Bases: Enum
Aerodrome event types.
AerodromeReceiptParser
¶
AerodromeReceiptParser(
chain: str = "base",
token0_address: str | None = None,
token1_address: str | None = None,
token0_symbol: str | None = None,
token1_symbol: str | None = None,
token0_decimals: int = 18,
token1_decimals: int = 18,
quoted_price: Decimal | None = None,
**kwargs: Any,
)
Parser for Aerodrome transaction receipts.
Refactored to use base infrastructure utilities for hex decoding and event registry management. Maintains full backward compatibility.
Initialize the parser.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chain
|
str
|
Blockchain network (for token symbol resolution) |
'base'
|
token0_address
|
str | None
|
Address of token0 in the pool |
None
|
token1_address
|
str | None
|
Address of token1 in the pool |
None
|
token0_symbol
|
str | None
|
Symbol of token0 |
None
|
token1_symbol
|
str | None
|
Symbol of token1 |
None
|
token0_decimals
|
int
|
Decimals for token0 |
18
|
token1_decimals
|
int
|
Decimals for token1 |
18
|
quoted_price
|
Decimal | None
|
Expected price for slippage calculation |
None
|
parse_receipt
¶
Parse a transaction receipt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
receipt
|
dict[str, Any]
|
Transaction receipt dict |
required |
quoted_amount_out
|
int | None
|
Expected output amount for slippage calculation |
None
|
Returns:
| Type | Description |
|---|---|
ParseResult
|
ParseResult with extracted events and swap data |
extract_swap_amounts
¶
Extract swap amounts from a transaction receipt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
receipt
|
dict[str, Any]
|
Transaction receipt dict with 'logs' field |
required |
Returns:
| Type | Description |
|---|---|
SwapAmounts | None
|
SwapAmounts dataclass if swap event found, None otherwise |
extract_lp_close_data
¶
Extract LP close data from transaction receipt.
Looks for Burn events which indicate LP tokens being burned.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
receipt
|
dict[str, Any]
|
Transaction receipt dict with 'logs' field |
required |
Returns:
| Type | Description |
|---|---|
LPCloseData | None
|
LPCloseData dataclass if Burn event found, None otherwise |
extract_liquidity
¶
Extract liquidity from LP mint transaction receipt.
For Aerodrome V1, this extracts the LP tokens minted from Transfer events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
receipt
|
dict[str, Any]
|
Transaction receipt dict with 'logs' field |
required |
Returns:
| Type | Description |
|---|---|
int | None
|
LP token amount if found, None otherwise |
is_aerodrome_event
¶
Check if a topic is a known Aerodrome event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
topic
|
str | bytes
|
Event topic (supports bytes, hex string with/without 0x, any case) |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if topic is a known Aerodrome event |
get_event_type
¶
Get the event type for a topic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
topic
|
str | bytes
|
Event topic (supports bytes, hex string with/without 0x, any case) |
required |
Returns:
| Type | Description |
|---|---|
AerodromeEventType
|
Event type or UNKNOWN |
BurnEventData
dataclass
¶
Parsed data from Burn event.
MintEventData
dataclass
¶
Parsed data from Mint event.
ParsedLiquidityResult
dataclass
¶
ParsedLiquidityResult(
operation: str,
token0: str,
token1: str,
token0_symbol: str,
token1_symbol: str,
amount0: int,
amount1: int,
amount0_decimal: Decimal,
amount1_decimal: Decimal,
pool_address: str,
)
High-level liquidity result extracted from receipt.
ParsedSwapResult
dataclass
¶
ParseResult
dataclass
¶
ParseResult(
success: bool,
events: list[AerodromeEvent] = list(),
swap_events: list[SwapEventData] = list(),
mint_events: list[MintEventData] = list(),
burn_events: list[BurnEventData] = list(),
transfer_events: list[TransferEventData] = list(),
swap_result: ParsedSwapResult | None = None,
liquidity_result: ParsedLiquidityResult | None = None,
error: str | None = None,
transaction_hash: str = "",
block_number: int = 0,
transaction_success: bool = True,
)
Result of parsing a receipt.
SwapEventData
dataclass
¶
SwapEventData(
sender: str,
to: str,
amount0_in: int,
amount1_in: int,
amount0_out: int,
amount1_out: int,
pool_address: str,
)
Parsed data from Swap event.
TransferEventData
dataclass
¶
Parsed data from Transfer event.
AerodromeSDK
¶
AerodromeSDK(
chain: str = "base",
rpc_url: str | None = None,
token_resolver: TokenResolver | None = None,
)
Low-level SDK for Aerodrome Finance on Base.
This SDK provides direct interaction with Aerodrome contracts: - Pool queries (reserves, amounts) - Transaction building (swaps, liquidity) - ABI encoding for all operations
Example
sdk = AerodromeSDK(chain="base")
Get quote for swap¶
quote = sdk.get_swap_quote( token_in="0x...", token_out="0x...", amount_in=1000000, stable=False, )
Build swap transaction¶
tx = sdk.build_swap_exact_tokens_tx( amount_in=1000000, amount_out_min=990000, routes=[SwapRoute(token_in, token_out, stable=False)], recipient="0x...", deadline=int(time.time()) + 300, sender="0x...", )
Initialize the SDK.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
chain
|
str
|
Target chain (currently only "base" supported) |
'base'
|
rpc_url
|
str | None
|
RPC endpoint URL (optional) |
None
|
token_resolver
|
TokenResolver | None
|
Optional TokenResolver instance. If None, uses singleton. |
None
|
get_pool_address
¶
Get pool address from factory (uses internal RPC or env var).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_a
|
str
|
First token address |
required |
token_b
|
str
|
Second token address |
required |
stable
|
bool
|
Pool type |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Pool address if exists, None otherwise |
get_pool_address_from_factory
¶
Get pool address from factory contract.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_a
|
str
|
First token address |
required |
token_b
|
str
|
Second token address |
required |
stable
|
bool
|
Pool type |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
Pool address if exists, None otherwise |
get_pool_info
¶
Get full pool information.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_a
|
str
|
First token address |
required |
token_b
|
str
|
Second token address |
required |
stable
|
bool
|
Pool type |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
PoolInfo | None
|
PoolInfo if pool exists, None otherwise |
get_amount_out
¶
get_amount_out(
amount_in: int,
token_in: str,
token_out: str,
stable: bool,
web3: Any,
) -> int | None
Get expected output amount for a swap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount_in
|
int
|
Input amount |
required |
token_in
|
str
|
Input token address |
required |
token_out
|
str
|
Output token address |
required |
stable
|
bool
|
Pool type |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
int | None
|
Output amount or None if pool doesn't exist |
get_amounts_out
¶
Get expected output amounts for multi-hop swap.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount_in
|
int
|
Input amount |
required |
routes
|
list[SwapRoute]
|
List of swap routes |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
list[int] | None
|
List of amounts for each hop, or None on error |
build_approve_tx
¶
build_approve_tx(
token_address: str,
spender: str,
amount: int,
sender: str,
web3: Any,
) -> dict[str, Any]
Build ERC-20 approve transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_address
|
str
|
Token to approve |
required |
spender
|
str
|
Address to approve for spending |
required |
amount
|
int
|
Amount to approve (use MAX_UINT256 for unlimited) |
required |
sender
|
str
|
Transaction sender |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Transaction dictionary |
build_swap_exact_tokens_tx
¶
build_swap_exact_tokens_tx(
amount_in: int,
amount_out_min: int,
routes: list[SwapRoute],
recipient: str,
deadline: int,
sender: str,
web3: Any,
) -> dict[str, Any]
Build swapExactTokensForTokens transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount_in
|
int
|
Input token amount |
required |
amount_out_min
|
int
|
Minimum output amount (slippage protection) |
required |
routes
|
list[SwapRoute]
|
Swap routes |
required |
recipient
|
str
|
Recipient address |
required |
deadline
|
int
|
Unix timestamp deadline |
required |
sender
|
str
|
Transaction sender |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Transaction dictionary |
build_add_liquidity_tx
¶
build_add_liquidity_tx(
token_a: str,
token_b: str,
stable: bool,
amount_a_desired: int,
amount_b_desired: int,
amount_a_min: int,
amount_b_min: int,
recipient: str,
deadline: int,
sender: str,
web3: Any,
) -> dict[str, Any]
Build addLiquidity transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_a
|
str
|
First token address |
required |
token_b
|
str
|
Second token address |
required |
stable
|
bool
|
Pool type |
required |
amount_a_desired
|
int
|
Desired amount of token A |
required |
amount_b_desired
|
int
|
Desired amount of token B |
required |
amount_a_min
|
int
|
Minimum amount of token A |
required |
amount_b_min
|
int
|
Minimum amount of token B |
required |
recipient
|
str
|
LP token recipient |
required |
deadline
|
int
|
Unix timestamp deadline |
required |
sender
|
str
|
Transaction sender |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Transaction dictionary |
build_remove_liquidity_tx
¶
build_remove_liquidity_tx(
token_a: str,
token_b: str,
stable: bool,
liquidity: int,
amount_a_min: int,
amount_b_min: int,
recipient: str,
deadline: int,
sender: str,
web3: Any,
) -> dict[str, Any]
Build removeLiquidity transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token_a
|
str
|
First token address |
required |
token_b
|
str
|
Second token address |
required |
stable
|
bool
|
Pool type |
required |
liquidity
|
int
|
LP token amount to burn |
required |
amount_a_min
|
int
|
Minimum token A to receive |
required |
amount_b_min
|
int
|
Minimum token B to receive |
required |
recipient
|
str
|
Token recipient |
required |
deadline
|
int
|
Unix timestamp deadline |
required |
sender
|
str
|
Transaction sender |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Transaction dictionary |
build_wrap_eth_tx
¶
Build WETH wrap (deposit) transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
int
|
ETH amount to wrap |
required |
sender
|
str
|
Transaction sender |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Transaction dictionary |
build_unwrap_eth_tx
¶
Build WETH unwrap (withdraw) transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
int
|
WETH amount to unwrap |
required |
sender
|
str
|
Transaction sender |
required |
web3
|
Any
|
Web3 instance |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Transaction dictionary |
resolve_token
¶
Resolve token symbol to address using TokenResolver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
str
|
Token symbol or address |
required |
Returns:
| Type | Description |
|---|---|
str
|
Token address |
Raises:
| Type | Description |
|---|---|
TokenResolutionError
|
If the token cannot be resolved |
get_token_symbol
¶
Get token symbol from address using TokenResolver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Token address |
required |
Returns:
| Type | Description |
|---|---|
str
|
Token symbol |
get_token_decimals
¶
Get token decimals from symbol using TokenResolver.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Token symbol |
required |
Returns:
| Type | Description |
|---|---|
int
|
Token decimals |
Raises:
| Type | Description |
|---|---|
TokenResolutionError
|
If decimals cannot be determined |
AerodromeSDKError
¶
Bases: Exception
Base exception for Aerodrome SDK errors.
InsufficientLiquidityError
¶
Bases: AerodromeSDKError
Raised when pool has insufficient liquidity.
PoolInfo
dataclass
¶
PoolInfo(
address: str,
token0: str,
token1: str,
stable: bool,
reserve0: int = 0,
reserve1: int = 0,
decimals0: int = 18,
decimals1: int = 18,
)
Information about an Aerodrome pool.
Attributes:
| Name | Type | Description |
|---|---|---|
address |
str
|
Pool contract address |
token0 |
str
|
First token address |
token1 |
str
|
Second token address |
stable |
bool
|
True for stable pool, False for volatile |
reserve0 |
int
|
Current reserve of token0 |
reserve1 |
int
|
Current reserve of token1 |
decimals0 |
int
|
Decimals of token0 |
decimals1 |
int
|
Decimals of token1 |
PoolNotFoundError
¶
Bases: AerodromeSDKError
Raised when a pool doesn't exist.
SwapRoute
dataclass
¶
A single hop in a swap route.
Attributes:
| Name | Type | Description |
|---|---|---|
from_token |
str
|
Input token address |
to_token |
str
|
Output token address |
stable |
bool
|
Pool type (True=stable, False=volatile) |
factory |
str | None
|
Factory address (optional, uses default) |
SDKSwapQuote
dataclass
¶
SDKSwapQuote(
amount_in: int,
amount_out: int,
routes: list[SwapRoute],
price_impact_bps: int = 0,
gas_estimate: int = AERODROME_GAS_ESTIMATES["swap"],
)
Quote for a swap operation.
Attributes:
| Name | Type | Description |
|---|---|---|
amount_in |
int
|
Input amount |
amount_out |
int
|
Expected output amount |
routes |
list[SwapRoute]
|
List of swap routes |
price_impact_bps |
int
|
Estimated price impact in basis points |
gas_estimate |
int
|
Estimated gas for the swap |