HotWalletSyncModel#

API documentation for tradeexecutor.ethereum.hot_wallet_sync_model.HotWalletSyncModel Python class in Trading Strategy framework.

class HotWalletSyncModel[source]#

Bases: AddressSyncModel

V0 prototype version of sync model, only for.

Warning

TODO: This model is unfinished and needs to be migrated to event based.

__init__(web3, hot_wallet)[source]#
Parameters:

Methods

__init__(web3, hot_wallet)

create_transaction_builder()

Creates a transaction builder instance to make trades against this asset management model.

fetch_onchain_balances(assets[, ...])

Read the on-chain asset details.

get_hot_wallet()

Get the vault address we are using.

get_key_address()

Get the address that identifies the vault/wallet we are using.

get_main_address()

Which is the onchain address that identifies this wallet/vault deployment.

get_token_storage_address()

Which is the onchain address having our token balances.

has_async_deposits()

Can deposit land only when we tell so.

has_position_sync()

Do we need to sync positions when we sync treasuty.

init()

is_ready_for_live_trading(state)

Check that the state and sync model is ready for live trading.

reset_deposits(state)

Clear out pending withdrawals/deposits events.

resync_nonce()

Re-read hot wallet nonce before trade execution.

setup_all(state, supported_reserves)

Make sure we have everything set up and initial test balance synced.

sync_initial(state[, reserve_asset, ...])

Set up the initial sync details.

sync_interests(timestamp, state, universe, ...)

Update interest on all tokens that receive interest thru rebase.

sync_positions(timestamp, state, ...)

Detect any position balance changes due to deposit/redemptions of vault users.

sync_treasury(strategy_cycle_ts, state[, ...])

Poll chain for updated treasury token balances.

__init__(web3, hot_wallet)[source]#
Parameters:
get_hot_wallet()[source]#

Get the vault address we are using.

Returns:

None if the executor is not using hot wallet (dummy, backtesting, etc.)

Return type:

Optional[HotWallet]

get_token_storage_address()[source]#

Which is the onchain address having our token balances.

Return type:

Optional[str]

get_main_address()[source]#

Which is the onchain address that identifies this wallet/vault deployment.

See also get_token_storage_address()

Return type:

Optional[str]

resync_nonce()[source]#

Re-read hot wallet nonce before trade execution.

Ensures that if the private key is used outside the trade executor, we are not getting wrong nonce error when broadcasting the transaction.

create_transaction_builder()[source]#

Creates a transaction builder instance to make trades against this asset management model.

Only needed when trades are being executed.

Returns:

Depending on the asset management mode.

Return type:

HotWalletTransactionBuilder