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
|
Functions
|
Decode a version 2 market from a registry |
|
Return the reviewed Wildcat deployment for a chain. |
Return the |
|
|
Check whether a log is a |
Classes
A version 2 Wildcat market decoded from |
- MARKET_ADDED_TOPIC_COUNT = 2
MarketAddedhas topic0 and the indexed controller topic.
- class WildcatMarketCandidate
Bases:
objectA version 2 Wildcat market decoded from
MarketAdded.- address: eth_typing.evm.HexAddress
Lowercased market address. The market is also the lender’s ERC-20 token.
- created_at: datetime.datetime
Naive UTC timestamp of the registry event block.
- __init__(chain, address, created_block, created_at)
- Parameters
chain (int) –
address (eth_typing.evm.HexAddress) –
created_block (int) –
created_at (datetime.datetime) –
- Return type
None
- fetch_wildcat_market_added_event_topic()
Return the
WildcatArchController.MarketAddedtopic0.- Returns
Hex-encoded keccak hash of the event signature.
- Return type
- fetch_wildcat_deployment(chain_id)
Return the reviewed Wildcat deployment for a chain.
- Parameters
chain_id (int) – EVM chain id.
- Returns
Deployment constants, or
Nonewhen 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
MarketAddedevent of the reviewed registry.
- create_wildcat_market_candidate(chain_id, log, timestamp)
Decode a version 2 market from a registry
MarketAddedlog.marketis not indexed, so it is decoded from the log data. The indexed controller identifies the market version:HooksFactoryregisters 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
MarketAddedevent, with hex stringtopicsanddata.timestamp (datetime.datetime) – Naive UTC timestamp of the log block.
- Returns
Market candidate, or
Nonefor 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]