diff --git a/prediction_market_agent_tooling/markets/omen/omen.py b/prediction_market_agent_tooling/markets/omen/omen.py index 7c65b65b..3110880c 100644 --- a/prediction_market_agent_tooling/markets/omen/omen.py +++ b/prediction_market_agent_tooling/markets/omen/omen.py @@ -408,8 +408,12 @@ def redeem_winnings(api_keys: APIKeys) -> None: @staticmethod def get_trade_balance(api_keys: APIKeys, web3: Web3 | None = None) -> xDai: - return wei_to_xdai( - KEEPING_ERC20_TOKEN.balanceOf(api_keys.bet_from_address, web3=web3) + native_token_balance = get_balances(api_keys.public_key, web3=web3).xdai + return xdai_type( + wei_to_xdai( + KEEPING_ERC20_TOKEN.balanceOf(api_keys.bet_from_address, web3=web3) + ) + + native_token_balance ) @staticmethod diff --git a/prediction_market_agent_tooling/tools/tokens/main_token.py b/prediction_market_agent_tooling/tools/tokens/main_token.py index a04e44fb..cbef68a8 100644 --- a/prediction_market_agent_tooling/tools/tokens/main_token.py +++ b/prediction_market_agent_tooling/tools/tokens/main_token.py @@ -7,6 +7,7 @@ # This is the token where agents will hold their funds, # except for a small portion that will be kept in the native token of the network to pay for the fees. +# Auto deposit must work from native token into this token. # If changed, then keep in mind that we assume this token is equal to 1 USD. # Also if changed, `withdraw_wxdai_to_xdai_to_keep_balance` will require update. KEEPING_ERC20_TOKEN = ContractDepositableWrapperERC20OnGnosisChain(