LighterAPIConfig

Documentation for eth_defi.lighter.constants.LighterAPIConfig Python class.

class LighterAPIConfig

Bases: object

Configuration for one independently indexed Lighter deployment.

Lighter account indexes are only unique within a deployment. In particular, account 281474976710654 exists on both Ethereum Lighter and Robinhood Lighter, so downstream storage must always pair an account index with slug.

Attributes summary

slug

Stable storage identifier for the deployment.

name

Human-readable scanner and scheduling name.

chain_id

Synthetic vault-dataset chain ID.

deployment_chain_id

Real EVM chain associated with this deployment.

api_url

REST API base URL.

app_url

Web application base URL used for vault links.

address_prefix

Synthetic vault address prefix.

denomination

Pool collateral symbol.

lockup

Public-pool withdrawal cooldown reported by systemConfig.

llp_account_index_override

Canonical LLP account override for deployments with unreliable system configuration.

pool_address_pattern

Return the PyArrow regex for this deployment's pool addresses.

Methods summary

__init__(slug, name, chain_id, ...[, ...])

format_pool_address(account_index)

Create a globally unique synthetic pool address.

format_pool_link(account_index)

Create the deployment-specific public-pool application link.

matches_pool_address(address)

Check whether a synthetic pool address belongs to this deployment.

slug: str

Stable storage identifier for the deployment.

name: str

Human-readable scanner and scheduling name.

chain_id: int

Synthetic vault-dataset chain ID.

This remains the primary identity used for price partitions and VaultSpec records.

deployment_chain_id: int

Real EVM chain associated with this deployment.

Do not use this value as the Lighter vault’s primary chain_id. The synthetic chain_id is still required to keep native Lighter price rows separate from ordinary ERC-4626 vaults. Both Lighter deployments share that synthetic ID and use deployment-specific address prefixes for uniqueness. For now this second chain ID supports Lighter on Robinhood in downstream lifetime-metrics exports.

api_url: str

REST API base URL.

app_url: str

Web application base URL used for vault links.

address_prefix: str

Synthetic vault address prefix.

Deployment-specific prefixes prevent address-only metadata rules from leaking between deployments.

denomination: str

Pool collateral symbol.

lockup: datetime.timedelta

Public-pool withdrawal cooldown reported by systemConfig.

llp_account_index_override: Optional[int]

Canonical LLP account override for deployments with unreliable system configuration.

None trusts systemConfig. For now only Lighter on Robinhood uses an override because its live system configuration points at an uninitialised account.

format_pool_address(account_index)

Create a globally unique synthetic pool address.

Parameters

account_index (int) – Deployment-local Lighter account index.

Returns

Synthetic address accepted by eth_defi.vault.base.VaultSpec.

Return type

str

format_pool_link(account_index)

Create the deployment-specific public-pool application link.

Parameters

account_index (int) – Deployment-local Lighter account index.

Returns

Public-pool detail URL.

Return type

str

matches_pool_address(address)

Check whether a synthetic pool address belongs to this deployment.

A numeric suffix is required because the backwards-compatible Ethereum prefix lighter-pool is also the beginning of the Robinhood prefix lighter-pool-robinhood. This exact check lets partial price merges distinguish the two deployments without relying on prefix ordering.

Parameters

address (str) – Synthetic Lighter vault address.

Returns

True when the address has this deployment’s prefix and a numeric Lighter account index.

Return type

bool

property pool_address_pattern: str

Return the PyArrow regex for this deployment’s pool addresses.

Returns

Anchored regular expression matching synthetic pool addresses.

__init__(slug, name, chain_id, deployment_chain_id, api_url, app_url, address_prefix, denomination, lockup, llp_account_index_override=None)
Parameters
Return type

None