agentcoinorg / AutoTx

A personal assistant for planning and executing on-chain transactions.
MIT License
107 stars 20 forks source link

buy 1 usdc (on optimism) #201

Closed rihp closed 7 months ago

rihp commented 7 months ago

ran to this issue trying autotx on optimism

safe has 5$ in ETH ready

Do you want the above transactions to be sent to your smart account? (y/n): y Sending transactions to your smart account... Cannot estimate gas with eth_estimateGas: {'code': -32003, 'message': 'Insufficient funds for gas * price + value'}

(autotx-py3.10) ➜  AutoTx git:(main) ✗ poetry run ask       
What do you want to do?: buy 1 usdc
Network: OPTIMISM
Agent address: 0x4bfF0DD00579E72c9bc47Ab0776229e21d2a897F
Smart account connected: 0x4FB2a4D47EDfb2d834B56AAeAc4d4b35dAC01b47
Running AutoTx with the following prompt:  buy 1 usdc
Prepared transaction: Buy 1 usdc with eth
==================================================
Batched transactions:
1. Swap 0.000298987430646399 WETH for 1 USDC (nonce: 0)
Do you want the above transactions to be sent to your smart account? (y/n): y
Sending transactions to your smart account...
Cannot estimate gas with `eth_estimateGas`: {'code': -32003, 'message': 'Insufficient funds for gas * price + value'}
(autotx-py3.10) ➜  AutoTx git:(main) ✗ poetry run ask --verbose
What do you want to do?: buy 1 usdc
Network: OPTIMISM
Agent address: 0x4bfF0DD00579E72c9bc47Ab0776229e21d2a897F
Smart account connected: 0x4FB2a4D47EDfb2d834B56AAeAc4d4b35dAC01b47
Running AutoTx with the following prompt:  buy 1 usdc
user_proxy (to chat_manager):

My goal is: buy 1 usdc
Advisor reworded: Buy 1 USDC using ETH from the user's address: 0x4FB2a4D47EDfb2d834B56AAeAc4d4b35dAC01b47.

--------------------------------------------------------------------------------
swap-tokens (to chat_manager):

***** Suggested tool call (call_uVX7ZBbwYfIHhxLBKrLeAKoh): prepare_swap_transaction *****
Arguments: 
{"token_to_sell":"ETH","token_to_buy":"1 USDC"}
*****************************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION prepare_swap_transaction...
Prepared transaction: Buy 1 usdc with eth
user_proxy (to chat_manager):

user_proxy (to chat_manager):

***** Response from calling tool (call_uVX7ZBbwYfIHhxLBKrLeAKoh) *****
Transaction to buy 1 usdc with eth has been prepared
**********************************************************************

--------------------------------------------------------------------------------
verifier (to chat_manager):

TERMINATE

--------------------------------------------------------------------------------
==================================================
Batched transactions:
1. Swap 0.000298987430646399 WETH for 1 USDC (nonce: 0)
Do you want the above transactions to be sent to your smart account? (y/n): y
Sending transactions to your smart account...
Cannot estimate gas with `eth_estimateGas`: {'code': -32003, 'message': 'Insufficient funds for gas * price + value'}
rihp commented 7 months ago

tried with main today and its fixed