Redemption
Documentation for eth_defi.enzyme.events.Redemption Python class.
- class Redemption
Bases:
eth_defi.enzyme.events.EnzymeBalanceEventEnzyme 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
Access the non-indexed Solidity event arguments.
Get the denominator token for withdrawal/deposit.
Address of the user who received the assets.
Amount of withdrawal in the number of shares.
Get the list of assets in this withdrawal.
Address of the user who did the redemption transaction.
Get the shares token for withdrawal/deposit.
Return the block mined at timestamp.
Our web3 connection.
Methods summary
- 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
vault (eth_defi.enzyme.vault.Vault) –
event_data (dict) –
- 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