tokenised_fund.securitize.redstone

Documentation for eth_defi.tokenised_fund.securitize.redstone Python module.

Read Securitize fund NAV from RedStone on-chain push feeds.

RedStone publishes reviewed Securitize fundamental-value feeds through Chainlink-compatible contracts. Reading latestRoundData() at an archive block returns the value that was available at that block, so the vault history scanner can backfill NAV without relying on RedStone’s 30-day REST retention.

Feed catalogue: https://app.redstone.finance/app/feeds/

Module Attributes

REDSTONE_SECURITIZE_FEEDS

Reviewed Securitize products with RedStone fundamental NAV push feeds.

Functions

fetch_redstone_feed_contract(web3, feed)

Create a contract proxy for a reviewed RedStone push feed.

fetch_redstone_price_at(web3, feed[, ...])

Fetch the RedStone NAV observation available at an archive block.

Classes

RedstonePricePoint

One RedStone on-chain fundamental NAV observation.

RedstoneSecuritizeFeed

One reviewed Securitize NAV push feed.

Exceptions

RedstoneFeedError

Raised when a RedStone NAV feed returns an unusable value.

exception RedstoneFeedError

Bases: RuntimeError

Raised when a RedStone NAV feed returns an unusable value.

__init__(*args, **kwargs)
__new__(**kwargs)
add_note(note, /)

Add a note to the exception

with_traceback(tb, /)

Set self.__traceback__ to tb and return self.

class RedstoneSecuritizeFeed

Bases: object

One reviewed Securitize NAV push feed.

RedStone push feeds expose the Chainlink aggregator interface. The first_block boundary is the first block where latestRoundData() returned a positive observation, which can be later than contract deployment.

chain_id: int

EVM chain hosting both the Securitize token and feed.

token: eth_typing.evm.HexAddress

Lower-case Securitize token address.

feed_id: str

RedStone fundamental feed identifier.

oracle_address: eth_typing.evm.HexAddress

Chainlink-compatible RedStone push-feed contract.

first_block: int

First block with a valid feed observation.

decimals: int

Number of decimals used by the oracle answer.

__init__(chain_id, token, feed_id, oracle_address, first_block, decimals=8)
Parameters
Return type

None

class RedstonePricePoint

Bases: object

One RedStone on-chain fundamental NAV observation.

timestamp: datetime.datetime

Naive UTC time at which RedStone published the value.

share_price: decimal.Decimal

Fund NAV per share in USD.

__init__(timestamp, share_price)
Parameters
Return type

None

REDSTONE_SECURITIZE_FEEDS: dict[tuple[int, eth_typing.evm.HexAddress], eth_defi.tokenised_fund.securitize.redstone.RedstoneSecuritizeFeed] = {(1, '0x17418038ecf73ba4026c4f428547bf099706f27b'): RedstoneSecuritizeFeed(chain_id=1, token='0x17418038ecf73ba4026c4f428547bf099706f27b', feed_id='ACRED_FUNDAMENTAL', oracle_address='0xd6bcbbc87bfb6c8964ddc73dc3eae6d08865d51c', first_block=21888488, decimals=8), (1, '0x1f41e42d0a9e3c0dd3ba15b527342783b43200a9'): RedstoneSecuritizeFeed(chain_id=1, token='0x1f41e42d0a9e3c0dd3ba15b527342783b43200a9', feed_id='BCAP_FUNDAMENTAL', oracle_address='0x46f1b5f29a2dc1a730508a1b41a8b5b93e316eb2', first_block=25494164, decimals=8), (1, '0x2255718832bc9fd3be1caf75084f4803da14ff01'): RedstoneSecuritizeFeed(chain_id=1, token='0x2255718832bc9fd3be1caf75084f4803da14ff01', feed_id='VBILL_ETHEREUM_FUNDAMENTAL', oracle_address='0xa569e68b5d110f2a255482c2997dfdbe1b2ab912', first_block=22537814, decimals=8), (1, '0x51c2d74017390cbbd30550179a16a1c28f7210fc'): RedstoneSecuritizeFeed(chain_id=1, token='0x51c2d74017390cbbd30550179a16a1c28f7210fc', feed_id='STAC_FUNDAMENTAL', oracle_address='0xedc6287d3d41b322af600317628d7e226dd3add4', first_block=23734437, decimals=8), (1, '0xda2ffa104356688e74d9340519b8c17f00d7752e'): RedstoneSecuritizeFeed(chain_id=1, token='0xda2ffa104356688e74d9340519b8c17f00d7752e', feed_id='HLScope_FUNDAMENTAL', oracle_address='0x1f14a50ba904a28cf6088e71b6a15561074398d7', first_block=21888488, decimals=8), (5000, '0x671642ac281c760e34251d51bc9eef27026f3b7a'): RedstoneSecuritizeFeed(chain_id=5000, token='0x671642ac281c760e34251d51bc9eef27026f3b7a', feed_id='MI4_MANTLE_FUNDAMENTAL', oracle_address='0x24c8964338deb5204b096039147b8e8c3aea42cc', first_block=86247628, decimals=8)}

Reviewed Securitize products with RedStone fundamental NAV push feeds.

fetch_redstone_feed_contract(web3, feed)

Create a contract proxy for a reviewed RedStone push feed.

Parameters
Returns

Chainlink-compatible feed contract.

Raises

ValueError – If the connection is for a different chain.

Return type

web3.contract.contract.Contract

fetch_redstone_price_at(web3, feed, block_identifier='latest')

Fetch the RedStone NAV observation available at an archive block.

The push-feed contract stores its current answer. Archive-node state makes the same call point-in-time correct for both initial backfills and normal incremental scans.

Parameters
  • web3 (web3.main.Web3) – Archive-capable connection to the feed chain.

  • feed (eth_defi.tokenised_fund.securitize.redstone.RedstoneSecuritizeFeed) – Reviewed Securitize feed configuration.

  • block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], eth_typing.evm.BlockNumber, eth_typing.evm.Hash32, eth_typing.encoding.HexStr, int]) – Historical block number or latest.

Returns

Positive USD NAV/share and its publication timestamp.

Raises

RedstoneFeedError – If the feed has not published a valid observation at the block.

Return type

eth_defi.tokenised_fund.securitize.redstone.RedstonePricePoint