Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions configs/offline/baseline.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
chain-id = "31337" # Anvil local chain
base-tokens = [
"0x5fbdb2315678afecb367f032d93f642f64180aa3", # WETH (auto-generated from deployment)
"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9", # DAI (auto-generated from deployment)
"0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0", # USDC (auto-generated from deployment)
"0xb3af08c783c4d9c380893257980b5e26657f2317", # WETH (auto-generated from deployment)
"0xb12812c0cad46d18b669b31059d485fe90b1a839", # DAI (auto-generated from deployment)
"0xb04afbcd351a0a7e4ff658b3772ee5f3f5b6e4ae", # USDC (auto-generated from deployment)
"0x171a30524fd943df1a12cbb9da291bf4e34ac84b", # USDT (auto-generated from deployment)
"0x51a53858a4a8b81814da35c4604eb9003d56a895", # GNO (auto-generated from deployment)
]
max-hops = 2
max-partial-attempts = 5
Expand Down
18 changes: 10 additions & 8 deletions configs/offline/driver.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@ gas-price-cap = "1000000000000"
mempool = "public"

[contracts]
gp-v2-settlement = "0xb7f8bc63bbcad18155201308c8f3540b07f84f5e"
weth = "0x5fbdb2315678afecb367f032d93f642f64180aa3"
balances = "0xbd5a6618df333f8f66702daadc9a953e2b52a65d"
signatures = "0x7377795aa7b4a8fca5e4e194f54eaff667db45f0"
gp-v2-settlement = "0x5113d53be0167ad02f9db0e415e210f11a6cb2ba"
weth = "0xb3af08c783c4d9c380893257980b5e26657f2317"
balances = "0x25106ea0c291520c2888cecf5154eec057602191"
signatures = "0xca8afa27a121c57ec9c8317551a11bead55dbc19"

[liquidity]
base-tokens = [
"0x5fbdb2315678afecb367f032d93f642f64180aa3", # WETH (auto-generated from deployment)
"0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9", # DAI (auto-generated from deployment)
"0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0", # USDC (auto-generated from deployment)
"0xb3af08c783c4d9c380893257980b5e26657f2317", # WETH (auto-generated from deployment)
"0xb12812c0cad46d18b669b31059d485fe90b1a839", # DAI (auto-generated from deployment)
"0xb04afbcd351a0a7e4ff658b3772ee5f3f5b6e4ae", # USDC (auto-generated from deployment)
"0x171a30524fd943df1a12cbb9da291bf4e34ac84b", # USDT (auto-generated from deployment)
"0x51a53858a4a8b81814da35c4604eb9003d56a895", # GNO (auto-generated from deployment)
]

[[liquidity.uniswap-v2]] # Uniswap V2 configuration (auto-generated from deployment)
router = "0x5fc8d32690cc91d4c39d9d3abcbd16989f875707"
router = "0x6c2014489c8479a8a36be65e3ccad07fa3cec029"
pool-code = "0xb6912aa8f91da604bdd903b3484a9f6bb569baa993085fc590133487ff27f91e" # Uniswap V2 init code hash
missing-pool-cache-time = "1h"
28 changes: 15 additions & 13 deletions playground/.env.offline
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
# Auto-generated by deploy-all.sh
# Generated at: 1763735432
# Generated at: 1763768150

# Network Configuration
CHAIN_ID=31337
NODE_URL=http://chain:8545
SIMULATION_NODE_URL=http://chain:8545

# Token Addresses (from deployment)
WETH_ADDRESS=0x5fbdb2315678afecb367f032d93f642f64180aa3
DAI_ADDRESS=0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9
USDC_ADDRESS=0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0
NATIVE_TOKEN_ADDRESS=0x5fbdb2315678afecb367f032d93f642f64180aa3
WETH_ADDRESS=0xb3af08c783c4d9c380893257980b5e26657f2317
DAI_ADDRESS=0xb12812c0cad46d18b669b31059d485fe90b1a839
USDC_ADDRESS=0xb04afbcd351a0a7e4ff658b3772ee5f3f5b6e4ae
USDT_ADDRESS=0x171a30524fd943df1a12cbb9da291bf4e34ac84b
GNO_ADDRESS=0x51a53858a4a8b81814da35c4604eb9003d56a895
NATIVE_TOKEN_ADDRESS=0xb3af08c783c4d9c380893257980b5e26657f2317

# Uniswap V2 Addresses (from deployment)
UNISWAP_V2_FACTORY_ADDRESS=0xdc64a140aa3e981100a9beca4e685f962f0cf6c9
UNISWAP_V2_ROUTER_ADDRESS=0x5fc8d32690cc91d4c39d9d3abcbd16989f875707
UNISWAP_V2_FACTORY_ADDRESS=0x7fb9dcdea3bec40d02e25ae230a64d7e8ddaa304
UNISWAP_V2_ROUTER_ADDRESS=0x6c2014489c8479a8a36be65e3ccad07fa3cec029

# CoW Protocol Addresses (from deployment)
SETTLEMENT_CONTRACT_ADDRESS=0xb7f8bc63bbcad18155201308c8f3540b07f84f5e
AUTHENTICATOR_ADDRESS=0x610178da211fef7d417bc0e6fed39f05609ad788
VAULT_RELAYER_ADDRESS=8daf17a20c9dba35f005b6324f493785d239719d
BALANCER_VAULT_ADDRESS=0x8A791620dd6260079BF849Dc5567aDC3F2FdC318
BALANCES_CONTRACT_ADDRESS=0xbd5a6618df333f8f66702daadc9a953e2b52a65d
SIGNATURES_CONTRACT_ADDRESS=0x7377795aa7b4a8fca5e4e194f54eaff667db45f0
SETTLEMENT_CONTRACT_ADDRESS=0x5113d53be0167ad02f9db0e415e210f11a6cb2ba
AUTHENTICATOR_ADDRESS=0x5fe5f7f937b63189bd0d33d78b264d4608973c8c
VAULT_RELAYER_ADDRESS=1b683f6f3015913cff36b5d789080e0890a8ab94
BALANCER_VAULT_ADDRESS=0xf30858ad95986bd3986529291e59d53a369e9700
BALANCES_CONTRACT_ADDRESS=0x25106ea0c291520c2888cecf5154eec057602191
SIGNATURES_CONTRACT_ADDRESS=0xca8afa27a121c57ec9c8317551a11bead55dbc19
17 changes: 9 additions & 8 deletions playground/docker-compose.offline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ services:
command:
- -c
- |
if [ -f /state/poc-state.json ]; then
if [ -f ./state/anvil-state.json ]; then
echo "📂 Loading existing blockchain state..."
anvil --load-state ./state/poc-state.json --host 0.0.0.0 --port 8545 --chain-id 31337 --block-time 1 --gas-limit 30000000 --code-size-limit 50000 --accounts 10
anvil --load-state ./state/anvil-state.json --host 0.0.0.0 --port 8545 --chain-id 31337 --block-time 1 --gas-limit 30000000 --code-size-limit 50000 --accounts 10
else
echo "Error: No state file found at /state/poc-state.json. Please run locally with start-anvil.sh and deploy-all.sh scripts to create the state first."
echo "Error: No state file found at /state/anvil-state.json. Please run locally with start-anvil.sh and deploy-all.sh scripts to create the state first."
exit 1
fi
environment:
- ANVIL_IP_ADDR=0.0.0.0
volumes:
- ./poc-offline-mode/state:/state
- ./offline-mode/state:/state
ports:
- 8545:8545
healthcheck:
Expand Down Expand Up @@ -120,7 +120,8 @@ services:
- 9586:9586 # metrics
- 6669:6669 # tokio console
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:80/api/v1/version || exit 1"]
test:
["CMD-SHELL", "curl -f http://localhost:80/api/v1/version || exit 1"]
interval: 5s
timeout: 3s
retries: 12
Expand All @@ -146,7 +147,7 @@ services:
environment:
- DB_WRITE_URL=postgres://db:5432/?user=${POSTGRES_USER}&password=${POSTGRES_PASSWORD}
- DB_READ_URL=postgres://db:5432/?user=${POSTGRES_USER}&password=${POSTGRES_PASSWORD}
- LOG_FILTER=trace,autopilot=trace,shared=debug,shared::price_estimation=trace,autopilot::solvable_orders=trace,autopilot::run=trace
- LOG_FILTER=info,autopilot=trace,shared=debug,shared::price_estimation=trace,autopilot::solvable_orders=trace,autopilot::run=trace
- NODE_URL=http://chain:8545
- SIMULATION_NODE_URL=http://chain:8545
- SETTLE_INTERVAL=15s
Expand Down Expand Up @@ -204,7 +205,7 @@ services:
environment:
- ETHRPC=http://chain:8545
- ADDR=0.0.0.0:80
- RUST_LOG=driver=trace,shared=trace
- RUST_LOG=driver=info,shared=trace
- RUST_BACKTRACE=1
- TOML_TRACE_ERROR=1
- TRACING_COLLECTOR_ENDPOINT=http://tempo:4317
Expand Down Expand Up @@ -240,7 +241,7 @@ services:
env_file: .env.offline
environment:
- ADDR=0.0.0.0:80
- LOG=solvers=trace,shared=trace
- LOG=solvers=info,shared=trace
- RUST_BACKTRACE=1
- TOML_TRACE_ERROR=1
- TOKIO_CONSOLE=true
Expand Down
32 changes: 32 additions & 0 deletions playground/offline-mode/config/addresses.json
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the difference between this file and the playgrond/offline-mode/addresses.json ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are duplicated, will remove one of them

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"chainId": "31337",
"tokens": {
"WETH": "0xB3AF08c783C4D9c380893257980b5E26657F2317",
"USDC": "0xb04AfbCD351A0a7e4fF658b3772eE5f3F5b6e4AE",
"DAI": "0xB12812C0CAD46D18b669B31059D485fE90B1A839",
"USDT": "0x171a30524Fd943Df1a12CbB9da291bf4E34Ac84b",
"GNO": "0x51A53858A4a8b81814Da35C4604eB9003D56a895"
},
"uniswapV2": {
"factory": "0x7fB9DCDea3BEc40d02e25AE230A64d7e8DdaA304",
"router": "0x6c2014489C8479a8A36bE65e3ccAd07Fa3Cec029",
"pairs": {
"WETH-USDC": "0x4a77eB944F3dDC5669D2BbE7dbF9dcbDA45Ab05e",
"WETH-DAI": "0x8558Fc228Bb9Fa5f24A8fbEE76b7044DeA8b92B9",
"WETH-USDT": "0xbf88a9B221dC5f93545FbaFa9b21199943380dd7",
"WETH-GNO": "0xFB7b2868Afa489Bcba909678AaD0A39386C7b4c9",
"USDC-DAI": "0x945a1afA368781DF3BDa23D13e88ff0904981049",
"USDC-USDT": "0x59c536486C96b046547e2D76c45f4867Ba0f6659",
"USDC-GNO": "0x12D1eBB852912a2C1715dA1dB4d21A7e867F6A34",
"DAI-USDT": "0xf2e737f8328faede847E2Ccf9A5E3Dc4E54fC5EB",
"DAI-GNO": "0xE60D514D0aE6E40f2D8366E81e7838b96aee2B6d",
"USDT-GNO": "0x4a8c7645a1423a6553969fcCdB0377F848D016aF"
}
},
"cowProtocol": {
"settlement": "0x5113d53be0167ad02f9db0E415e210F11a6cB2bA",
"authenticator": "0x5fe5f7F937b63189BD0D33D78B264d4608973C8C",
"vaultRelayer": "0x1B683f6F3015913CFf36b5d789080e0890A8ab94",
"balancerVault": "0xf30858AD95986bD3986529291E59D53a369E9700"
}
}
Loading