Run the stateful trading agent with Grok 4’s advanced reasoning capabilities using OpenRouter API and Foundry Anvil fork for safe paper trading before moving to live markets.
requirements.txt
installedcurl -L https://foundry.paradigm.xyz | bash && foundryup
)config.py
and make these changes:
USE_FORK = True
for testing. Only set it to False
when you’re ready to trade with real funds on BASE mainnet.USE_FORK = True
)
http://localhost:8545
(Anvil fork)USE_FORK = False
)
USE_FORK = False
), configure your BASE RPC endpoints in config.py
:
USE_FORK = True
), the agent automatically uses http://localhost:8545
and these endpoints are not needed.config.py
:
config.py
, you can adjust:
TRADE_INTERVAL
to reduce decision frequencyconfig.py
:
--iterations
to limit trading sessions