Rari

Examples

rari

Reference

async ctc.protocols.rari_utils.async_get_all_pools(block=None, provider=None)
async ctc.protocols.rari_utils.async_get_ctoken_state(ctoken, block='latest', metrics=None, eth_price=None, in_usd=True)
Parameters
  • ctoken (Address) –

  • block (BlockNumberReference) –

  • metrics (CTokenMetricSpec | None) –

  • eth_price (Number | None) –

  • in_usd (bool) –

Return type

CTokenMetrics

async ctc.protocols.rari_utils.async_get_ctoken_state_by_block(ctoken, blocks, metrics=None, eth_price=None, in_usd=True)
Parameters
  • ctoken (Address) –

  • blocks (Sequence[BlockNumberReference]) –

  • metrics (CTokenMetricSpec | None) –

  • eth_price (Number | None) –

  • in_usd (bool) –

Return type

CTokenMetricsByBlock

async ctc.protocols.rari_utils.async_get_pool_ctokens(comptroller, block='latest')
async ctc.protocols.rari_utils.async_get_pool_prices(*, oracle=None, ctokens=None, comptroller=None, block='latest', to_usd=True)
Parameters
  • oracle (Address | None) –

  • ctokens (Sequence[Address] | None) –

  • comptroller (Address | None) –

  • block (BlockNumberReference) –

  • to_usd (bool) –

Return type

dict[Address, Number]

async ctc.protocols.rari_utils.async_get_pool_tvl_and_tvb(*, comptroller=None, ctokens=None, oracle=None, block='latest')
Parameters
  • comptroller (Address | None) –

  • ctokens (Sequence[Address] | None) –

  • oracle (Address | None) –

  • block (BlockNumberReference) –

Return type

dict[str, Number]

async ctc.protocols.rari_utils.async_get_pool_underlying_tokens(*, ctokens=None, comptroller=None, block='latest')
Parameters
  • ctokens (Sequence[Address] | None) –

  • comptroller (Address | None) –

  • block (BlockNumberReference) –

Return type

dict[Address, Address]

async ctc.protocols.rari_utils.async_get_token_multipool_stats(token, block='latest', in_usd=True)
Parameters
  • token (<class 'str'>) –

  • block (Union[SupportsRound, str, int, Literal['latest'], Literal['earliest'], Literal['pending']]) –

  • in_usd (<class 'bool'>) –

Return type

<class ‘dict’>

async ctc.protocols.rari_utils.async_print_all_pool_summary(block='latest', n_display=15)
Parameters
  • block (Union[SupportsRound, str, int, Literal['latest'], Literal['earliest'], Literal['pending']]) –

  • n_display (<class 'int'>) –

Return type

<class ‘NoneType’>

async ctc.protocols.rari_utils.async_print_fuse_token_summary(token, block='latest', in_usd=True)
Parameters
  • token (<class 'str'>) –

  • block (Union[SupportsRound, str, int, Literal['latest'], Literal['earliest'], Literal['pending']]) –

  • in_usd (<class 'bool'>) –

Return type

<class ‘NoneType’>