aave_v3.deployment

Documentation for eth_defi.aave_v3.deployment Python module.

Aave v3 deployments.

Functions

fetch_deployment(web3, pool_address, ...[, ...])

Construct Aave v3 deployment based on on-chain data.

Classes

AaveV3Deployment

Describe Aave v3 deployment.

AaveV3ReserveConfiguration

AaveV3ReserveConfiguration(decimals, ltv, liquidation_threshold, liquidation_bonus, reserve_factor, usage_as_collateral_enabled, borrowing_enabled, stable_borrow_rate_enabled, is_active, is_frozen)

AaveV3UserData

AaveV3UserData(total_collateral_base, total_debt_base, available_borrows_base, current_liquidation_threshold, ltv, health_factor)

class AaveV3Deployment

Bases: object

Describe Aave v3 deployment.

__init__(web3, pool, data_provider, oracle, ausdc=None)
Parameters
  • web3 (web3.main.Web3) –

  • pool (web3.contract.contract.Contract) –

  • data_provider (web3.contract.contract.Contract) –

  • oracle (web3.contract.contract.Contract) –

  • ausdc (Optional[eth_defi.token.TokenDetails]) –

Return type

None

get_price(token_address)

Returns asset latest price using Aave oracle.

Parameters

token_address (eth_typing.evm.HexAddress) –

Return type

int

get_reserve_configuration_data(token_address)

Returns reserve configuration data.

Parameters

token_address (eth_typing.evm.HexAddress) –

Return type

eth_defi.aave_v3.deployment.AaveV3ReserveConfiguration

get_user_data(user_address)

Returns the user account data across all the reserves.

Parameters

user_address (eth_typing.evm.HexAddress) –

Return type

eth_defi.aave_v3.deployment.AaveV3UserData

class AaveV3ReserveConfiguration

Bases: NamedTuple

AaveV3ReserveConfiguration(decimals, ltv, liquidation_threshold, liquidation_bonus, reserve_factor, usage_as_collateral_enabled, borrowing_enabled, stable_borrow_rate_enabled, is_active, is_frozen)

Create new instance of AaveV3ReserveConfiguration(decimals, ltv, liquidation_threshold, liquidation_bonus, reserve_factor, usage_as_collateral_enabled, borrowing_enabled, stable_borrow_rate_enabled, is_active, is_frozen)

static __new__(_cls, decimals, ltv, liquidation_threshold, liquidation_bonus, reserve_factor, usage_as_collateral_enabled, borrowing_enabled, stable_borrow_rate_enabled, is_active, is_frozen)

Create new instance of AaveV3ReserveConfiguration(decimals, ltv, liquidation_threshold, liquidation_bonus, reserve_factor, usage_as_collateral_enabled, borrowing_enabled, stable_borrow_rate_enabled, is_active, is_frozen)

Parameters
  • decimals (int) –

  • ltv (int) –

  • liquidation_threshold (int) –

  • liquidation_bonus (int) –

  • reserve_factor (int) –

  • usage_as_collateral_enabled (bool) –

  • borrowing_enabled (bool) –

  • stable_borrow_rate_enabled (bool) –

  • is_active (bool) –

  • is_frozen (bool) –

borrowing_enabled: bool

Alias for field number 6

count(value, /)

Return number of occurrences of value.

decimals: int

Alias for field number 0

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

is_active: bool

Alias for field number 8

is_frozen: bool

Alias for field number 9

liquidation_bonus: int

Alias for field number 3

liquidation_threshold: int

Alias for field number 2

ltv: int

Alias for field number 1

reserve_factor: int

Alias for field number 4

stable_borrow_rate_enabled: bool

Alias for field number 7

usage_as_collateral_enabled: bool

Alias for field number 5

class AaveV3UserData

Bases: NamedTuple

AaveV3UserData(total_collateral_base, total_debt_base, available_borrows_base, current_liquidation_threshold, ltv, health_factor)

Create new instance of AaveV3UserData(total_collateral_base, total_debt_base, available_borrows_base, current_liquidation_threshold, ltv, health_factor)

static __new__(_cls, total_collateral_base, total_debt_base, available_borrows_base, current_liquidation_threshold, ltv, health_factor)

Create new instance of AaveV3UserData(total_collateral_base, total_debt_base, available_borrows_base, current_liquidation_threshold, ltv, health_factor)

Parameters
  • total_collateral_base (int) –

  • total_debt_base (int) –

  • available_borrows_base (int) –

  • current_liquidation_threshold (int) –

  • ltv (int) –

  • health_factor (int) –

available_borrows_base: int

Alias for field number 2

count(value, /)

Return number of occurrences of value.

current_liquidation_threshold: int

Alias for field number 3

health_factor: int

Alias for field number 5

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

ltv: int

Alias for field number 4

total_collateral_base: int

Alias for field number 0

total_debt_base: int

Alias for field number 1

fetch_deployment(web3, pool_address, data_provider_address, oracle_address, ausdc_address=None)

Construct Aave v3 deployment based on on-chain data.

Returns

Data class representing Aave v3 exchange deployment

Parameters
Return type

eth_defi.aave_v3.deployment.AaveV3Deployment