Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
6696983
feat: first version of the poc-offline-mode
Nov 7, 2025
2dd2558
feat: making the deploy work all over again, with add liquidity
Nov 10, 2025
c977540
feat: concluindo o state management;
Nov 10, 2025
65dd677
feat: Finally getting back to the error I got of no liquidity;
Nov 10, 2025
3d75908
fix: Fixing some more problems related with the baseline solver and d…
Nov 10, 2025
8f1f38f
feat: Making the test almost work, but the autopilot is not settling …
Nov 11, 2025
6cfe3de
feat: Making the quote work, finally;
Nov 11, 2025
82acbc0
feat: Finally the poc-offline-mode is running correctly;
Nov 12, 2025
8ed55a9
fix: cleaning cache and broadcast
Nov 12, 2025
b542e5c
feat: adding a .md file explaining the UniswapV2Library error.
Nov 12, 2025
ffc47e1
refactor: changing the config file of the driver and baseline to poin…
Nov 12, 2025
135ee65
refactor: removing old files;
Nov 12, 2025
2c7a9e3
chore: adding solidity outputs to gitignore;
Nov 13, 2025
c4eb6c3
chore: fixing, adding back uniswap-v2-periphery back and putting unis…
Nov 13, 2025
4451f77
chore: Adding README.md file, removing the UniswapV2LibraryErrorNote.…
Nov 13, 2025
95cf550
fix: fixing the driver and baseline deployment config location, readd…
Nov 13, 2025
9b08c41
feat: Improving the docker-compose.offline.yml behavior;
Nov 21, 2025
6fc87e4
feat: Reducing the state size (it was being constantly updated before…
Nov 21, 2025
16bdf44
feat: Adding GNO, USDT, and the respective uniswap v2 pairs, to cover…
Nov 21, 2025
0d96efe
feat: creating the coingecko mock API;
Nov 25, 2025
8a0e5d3
feat: Adding packages via npm, instead of foundry;
Nov 26, 2025
8a1b331
feat: Adding cow hooks trampoline;
Nov 26, 2025
bc3e103
chore: removing duplicated addresses.json;
Nov 26, 2025
38d40b8
Merge branch 'luizhatem/cow-539-add-additional-tokens-usdt-gno-and-un…
Nov 26, 2025
5569c39
Merge branch 'luizhatem/cow-542-implement-coingecko-api-mock-for-offl…
Nov 26, 2025
4847275
Merge branch 'luizhatem/npm-dependencies' into luizhatem/cow-543-depl…
Nov 26, 2025
b0645b5
feat: adding test to the cow hooks trampoline;
Nov 26, 2025
0d0ed11
refactor: removing COIN_GECKO_URL autogeneration, not needed;
Nov 26, 2025
0252bb3
refactor: removing unused coin_gecko_url env variable from .env.offline;
Nov 26, 2025
2f73879
Merge branch 'luizhatem/cow-542-implement-coingecko-api-mock-for-offl…
Nov 26, 2025
4b9aa13
Merge branch 'luizhatem/npm-dependencies' into luizhatem/cow-543-depl…
Nov 26, 2025
183c521
feat: replacing the balances contract by GPv2TradeSimulator;
Nov 27, 2025
fdc64ca
feat: Fixing the docker-compose.offline.yml not loading hooks contrac…
Nov 27, 2025
e6f439e
Merge branch 'luizhatem/cow-543-deploy-cowhookstrampoline-contract' i…
Nov 27, 2025
cb44aee
feat: updating the init pool code;
Nov 27, 2025
5d4d4ae
Merge branch 'luizhatem/npm-dependencies' into luizhatem/cow-543-depl…
Nov 27, 2025
f7feca9
Merge branch 'luizhatem/cow-543-deploy-cowhookstrampoline-contract' i…
Nov 27, 2025
1259983
feat: Deploying official Balances contract, instead of mocked, removi…
Nov 28, 2025
1f8079b
feat: cowshed deployment with tests;
Dec 3, 2025
04a8d91
feat: Trying to split the deployment into multiple typescript files;
Dec 4, 2025
33c5dcb
chore: Changing the README.md file;
Dec 8, 2025
257ee04
Merge branch 'offline-mode' into luizhatem/split-deployment
Dec 8, 2025
98d8f1c
feat: Adding surplus in the test-playground-order.ts
Dec 9, 2025
d27a133
feat: centralizing the addresses into .env.offline;
Dec 10, 2025
c43053b
feat: Adding a deployer via docker-compose;
Dec 11, 2025
96ca6c6
fix: Fixing cowshed order;
Dec 11, 2025
cf3e87b
Update playground/offline-mode/test/test-cowshed-order.ts
lgahdl Dec 11, 2025
9c0526c
Update playground/offline-mode/test/test-cowshed-order.ts
lgahdl Dec 11, 2025
7e73801
fix: fixing the weth address handler in the solvers contracts.rs file;
Dec 15, 2025
b3e59dd
chore: Removing backup files;
Dec 15, 2025
ace6fcc
fix: throwing error in case some of the necessary addresses are not s…
Dec 15, 2025
19833fd
Merge pull request #14 from bleu/luizhatem/fix-cowshed-order
lgahdl Dec 15, 2025
196290a
Merge pull request #13 from bleu/luizhatem/docker-compose-deployer
lgahdl Dec 15, 2025
f1b3f75
Merge pull request #12 from bleu/luizhatem/split-deployment
lgahdl Dec 15, 2025
84280af
chore: removing claude settings;
Dec 15, 2025
11b3021
chore: removed unused gitmodules file;
Dec 15, 2025
781ac97
chore: removing unused dockerfile;
Dec 15, 2025
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
4 changes: 1 addition & 3 deletions crates/chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ impl Chain {
| Self::Optimism => U256::from(10u128.pow(17)),
Self::Gnosis | Self::Avalanche | Self::Lens => U256::from(10u128.pow(18)),
Self::Polygon | Self::Plasma => U256::from(10u128.pow(20)),
Self::Hardhat => {
panic!("unsupported chain for default amount to estimate native prices with")
}
Self::Hardhat => U256::from(10u128.pow(17)), // Use same as testnets for local testing
}
}

Expand Down
4 changes: 3 additions & 1 deletion crates/shared/src/price_estimation/native/coingecko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ impl CoinGecko {
Chain::Lens => "lens".to_string(),
Chain::Linea => "linea".to_string(),
Chain::Plasma => "plasma".to_string(),
Chain::Sepolia | Chain::Goerli | Chain::Hardhat => {
// Hardhat/Anvil is a local Ethereum fork, use ethereum pricing for offline development
Chain::Hardhat => "ethereum".to_string(),
Chain::Sepolia | Chain::Goerli => {
anyhow::bail!("unsupported network {}", chain.name())
}
};
Expand Down
8 changes: 7 additions & 1 deletion crates/solvers/src/infra/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ impl Contracts {
Self {
weth: eth::WethAddress(
WETH9::deployment_address(&chain.id())
.expect("there should be a contract address for all supported chains")
.or_else(|| {
std::env::var("WETH_ADDRESS")
.or_else(|_| std::env::var("NATIVE_TOKEN_ADDRESS"))
.ok()
.and_then(|addr| addr.parse().ok())
})
.expect("no WETH address for chain - set WETH_ADDRESS or NATIVE_TOKEN_ADDRESS environment variable")
.into_legacy(),
),
}
Expand Down
32 changes: 32 additions & 0 deletions playground/.env.offline
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Auto-generated by deploy-all.ts
# Generated at: 1765463809

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

# Token Addresses
WETH_ADDRESS=0x2affea51aaf12ef2df1253d5f4f1137488f266df
DAI_ADDRESS=0x40ad751bdc22ebdfdd41afa3ced2260e12485de9
USDC_ADDRESS=0xa40d523b294f92b09d066e6679fda4ddf79ba26c
USDT_ADDRESS=0x4142ef2d123cd994f4bca7b06bcae6c441e764f2
GNO_ADDRESS=0xc242f5cb5fb5c43143f97c8da44ce2f067adb4b7
NATIVE_TOKEN_ADDRESS=0x2affea51aaf12ef2df1253d5f4f1137488f266df

# Uniswap V2 Addresses
UNISWAP_V2_FACTORY_ADDRESS=0x75bb62d11fc5aa893827203d977e0931d269580d
UNISWAP_V2_ROUTER_ADDRESS=0x205200ad9c2f01fee2f8f5a0ca3ea24395530bbb

# CoW Protocol Addresses
SETTLEMENT_CONTRACT_ADDRESS=0x73fce72b0d67ca1b22b81f07440c71a018aaa0f1
AUTHENTICATOR_ADDRESS=0xee308bbdaafbd435312741abed5883278aa6a783
VAULT_RELAYER_ADDRESS=0x477468f95f2de81d0e8482940c8a2c8f2bf41928
BALANCER_VAULT_ADDRESS=0x77604580e57a1632a3fe5d899fc81ea197beae43
BALANCES_CONTRACT_ADDRESS=0xc0aaa2bafd66721e583c7b41002d0771aa95f6bf
SIGNATURES_CONTRACT_ADDRESS=0x74b0d030c84a587ded98abec87bbbbb4d0790037
HOOKS_CONTRACT_ADDRESS=0x11a17c3b360ad70a7c8fff06d2d858f31031f8be

# CoWShed Addresses
COWSHED_FACTORY_ADDRESS=0xdb086a44b9db2650e9e3c1f21fc7ba6b7d4b6681
COWSHED_IMPLEMENTATION_ADDRESS=0xceeea420f4dae4e0405f0e218b8da6114d01dde3
48 changes: 48 additions & 0 deletions playground/.env.offline.services
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# CoW Protocol Services Configuration
# Common environment variables for orderbook, autopilot, driver, and baseline

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

# Price Estimation Configuration
PRICE_ESTIMATORS=None
PRICE_ESTIMATION_DRIVERS=baseline|http://driver/baseline
NATIVE_PRICE_ESTIMATORS=baseline|http://driver/baseline,CoinGecko
COIN_GECKO_URL=http://coingecko-mock:3000/api/v3/simple/token_price
AMOUNT_TO_ESTIMATE_PRICES_WITH=100000000000000000

# Baseline Solver Configuration
BASELINE_SOURCES=UniswapV2
TOKEN_OWNER_FINDERS=liquidity

# Drivers Configuration
DRIVERS=baseline|http://driver/baseline

# Debugging & Tracing
RUST_BACKTRACE=1
TOML_TRACE_ERROR=1
TRACING_COLLECTOR_ENDPOINT=http://tempo:4317

# Tokio Console
TOKIO_CONSOLE=true
TOKIO_CONSOLE_RETENTION=600sec
TOKIO_CONSOLE_BIND=0.0.0.0:6669

# Autopilot Specific
SETTLE_INTERVAL=15s
GAS_ESTIMATORS=Native,Web3
BLOCK_STREAM_POLL_INTERVAL=1s
NATIVE_PRICE_CACHE_MAX_UPDATE_SIZE=100
NATIVE_PRICE_CACHE_MAX_AGE=20m
SOLVER_TIME_LIMIT=5
RUN_LOOP_NATIVE_PRICE_TIMEOUT=5s
NATIVE_PRICE_ESTIMATION_RESULTS_REQUIRED=1
DISABLE_ORDER_FILTERING=true
SKIP_EVENT_SYNC=true

# Orderbook Specific
SKIP_TRACE_API=true
EIP1271_SKIP_CREATION_VALIDATION=true
ENABLE_EIP1271_ORDERS=true
BIND_ADDRESS=0.0.0.0:80
Loading