Redemption

Documentation for eth_defi.enzyme.events.Redemption Python class.

class Redemption

Bases: eth_defi.enzyme.events.EnzymeBalanceEvent

Enzyme deposit event wrapper.

Currently only supports redeemSharesInKind withdrawal method. This means we get the tokens of the undetlying positions directly to the investor wallet without sellign them.

  • Wraps SharesRedeemed event

  • See ComptrollerLib.sol

  • See redeemSharesInKind()

The solidity event:

event SharesRedeemed(
    address indexed redeemer,
    address indexed recipient,
    uint256 sharesAmount,
    address[] receivedAssets,
    uint256[] receivedAssetAmounts
);

Attributes summary

arguments

Access the non-indexed Solidity event arguments.

denomination_token

Get the denominator token for withdrawal/deposit.

receiver

Address of the user who received the assets.

redeem_amount

Amount of withdrawal in the number of shares.

redeemed_assets

Get the list of assets in this withdrawal.

redeemer

Address of the user who did the redemption transaction.

shares_token

Get the shares token for withdrawal/deposit.

timestamp

Return the block mined at timestamp.

web3

Our web3 connection.

Methods summary

__init__(vault, event_data)

wrap(vault, event_data)

Parse Solidity events to the wrapped format.

property redeem_amount: decimal.Decimal

Amount of withdrawal in the number of shares.

property redeemed_assets: List[Tuple[eth_defi.token.TokenDetails, int]]

Get the list of assets in this withdrawal.

Returns

List of (redeemed token, raw token amount) tuples

property receiver: eth_typing.evm.HexAddress

Address of the user who received the assets.

Can be different from the redeemer.

property redeemer: eth_typing.evm.HexAddress

Address of the user who did the redemption transaction.

Can be different from the receiver.

__init__(vault, event_data)
Parameters
Return type

None

property arguments: List[bytes]

Access the non-indexed Solidity event arguments.

property denomination_token: eth_defi.token.TokenDetails

Get the denominator token for withdrawal/deposit.

Read the token on-chain details.

Returns

Usually ERC-20 details for USDC

property shares_token: eth_defi.token.TokenDetails

Get the shares token for withdrawal/deposit.

Read the token on-chain details.

Returns

ERC-20 details for a token with the fund name/symbol and 18 decimals.

property timestamp: datetime.datetime

Return the block mined at timestamp.

property web3: web3.main.Web3

Our web3 connection.

static wrap(vault, event_data)

Parse Solidity events to the wrapped format.

Parameters
  • event_data (dict) –

    Raw JSON-RPC event data.

    Example:

    {'address': '0xbeaafda2e17fc95e69dc06878039d274e0d2b21a',
     'blockHash': '0x5eee3d7d2f32034955f2db9c2e84c8dfabb89a4001d32d4e01bdae540f5a0c06',
     'blockNumber': 65,
     'chunk_id': 62,
     'context': None,
     'data': '0x000000000000000000000000000000000000000000000000000000001dcd6500000000000000000000000000000000000000000000000000000000001dcd6500000000000000000000000000000000000000000000000000000000001dcd6500',
     'event': <class 'web3._utils.datatypes.SharesBought'>,
     'logIndex': '0x4',
     'removed': False,
     'timestamp': 1679394381,
     'topics': ['0x849165c18b9d0fb161bcb145e4ab523d350e5c98f1dbbb1960331e7ee3ca6767',
                '0x00000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c8'],
     'transactionHash': '0xb430a5546dd43042e3d36526fbd71ebc38c8598f6ee354f17839d3cdddf74530',
     'transactionIndex': '0x0',
     'transactionLogIndex': '0x4'}
    

  • vault (eth_defi.enzyme.vault.Vault) –

Return type

eth_defi.enzyme.events.EnzymeBalanceEvent