Deposit

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

class Deposit

Bases: eth_defi.enzyme.events.EnzymeBalanceEvent

Enzyme deposit event wrapper.

  • Wraps SharesBought event

  • See ComptrollerLib.sol

The solidity event:

event SharesBought(
    address indexed buyer,
    uint256 investmentAmount,
    uint256 sharesIssued,
    uint256 sharesReceived
);

Attributes summary

arguments

Access the non-indexed Solidity event arguments.

denomination_token

Get the denominator token for withdrawal/deposit.

investment_amount

Amount of deposit/withdrawal in the denominator token.

receiver

Address of the user who received the bought shares.

shares_issued

Amount of deposit/withdrawal in the denominator token.

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 investment_amount: decimal.Decimal

Amount of deposit/withdrawal in the denominator token.

property shares_issued: decimal.Decimal

Amount of deposit/withdrawal in the denominator token.

property receiver: eth_typing.evm.HexAddress

Address of the user who received the bought shares.

__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