erc_4626.vault_protocol.wildcat.discovery

Documentation for eth_defi.erc_4626.vault_protocol.wildcat.discovery Python module.

Wildcat market discovery through the WildcatArchController registry.

Wildcat markets are not ERC-4626 vaults. Every market is registered in the chain’s WildcatArchController, which emits MarketAdded(address indexed controller, address market). The registry event is sufficient identification, so a decoded market becomes a direct lead and skips the generic ERC-4626 feature probe, as Enzyme Blue deployments do.

Only version 2 markets are supported. Their controller is the HooksFactory; registry events from version 1 market controllers are skipped.

See the WildcatArchController source.

Module Attributes

MARKET_ADDED_TOPIC_COUNT

MarketAdded has topic0 and the indexed controller topic.

Functions

create_wildcat_market_candidate(chain_id, ...)

Decode a version 2 market from a registry MarketAdded log.

fetch_wildcat_deployment(chain_id)

Return the reviewed Wildcat deployment for a chain.

fetch_wildcat_market_added_event_topic()

Return the WildcatArchController.MarketAdded topic0.

is_wildcat_registry_log(chain_id, address, ...)

Check whether a log is a MarketAdded event of the reviewed registry.

Classes

WildcatMarketCandidate

A version 2 Wildcat market decoded from MarketAdded.

MARKET_ADDED_TOPIC_COUNT = 2

MarketAdded has topic0 and the indexed controller topic.

class WildcatMarketCandidate

Bases: object

A version 2 Wildcat market decoded from MarketAdded.

chain: int

EVM chain id.

address: eth_typing.evm.HexAddress

Lowercased market address. The market is also the lender’s ERC-20 token.

created_block: int

Block of the registry event.

created_at: datetime.datetime

Naive UTC timestamp of the registry event block.

__init__(chain, address, created_block, created_at)
Parameters
Return type

None

fetch_wildcat_market_added_event_topic()

Return the WildcatArchController.MarketAdded topic0.

Returns

Hex-encoded keccak hash of the event signature.

Return type

str

fetch_wildcat_deployment(chain_id)

Return the reviewed Wildcat deployment for a chain.

Parameters

chain_id (int) – EVM chain id.

Returns

Deployment constants, or None when Wildcat is not supported on the chain.

Return type

Optional[eth_defi.erc_4626.vault_protocol.wildcat.constants.WildcatDeployment]

is_wildcat_registry_log(chain_id, address, topic0)

Check whether a log is a MarketAdded event of the reviewed registry.

Parameters
Returns

True for registry MarketAdded events.

Return type

bool

create_wildcat_market_candidate(chain_id, log, timestamp)

Decode a version 2 market from a registry MarketAdded log.

market is not indexed, so it is decoded from the log data. The indexed controller identifies the market version: HooksFactory registers version 2 markets, while per-borrower controllers registered version 1 markets.

Parameters
  • chain_id (int) – EVM chain id of the log.

  • log (Any) – Hypersync log of a registry MarketAdded event, with hex string topics and data.

  • timestamp (datetime.datetime) – Naive UTC timestamp of the log block.

Returns

Market candidate, or None for a version 1 market.

Raises

ValueError – If the log does not have the expected layout.

Return type

Optional[eth_defi.erc_4626.vault_protocol.wildcat.discovery.WildcatMarketCandidate]