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.
Methods
__init__
(web3, hot_wallet)Creates a transaction builder instance to make trades against this asset management model.
fetch_onchain_balances
(assets[, ...])Read the on-chain asset details.
Get the vault address we are using.
get_key_address
()Get the address that identifies the vault/wallet we are using.
Which is the onchain address that identifies this wallet/vault deployment.
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.
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.
- get_main_address()[source]#
Which is the onchain address that identifies this wallet/vault deployment.
See also
get_token_storage_address()
- 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.