11# ─── E2E Rebalancer Test Environment ─────────────────────────────────────────
2- # Copy to .env or source before running:
3- # cp .env.e2e .env
2+ # Copy to .env.e2e then fill in wallet keys and addresses:
3+ # cp .env.e2e.example .env.e2e
4+ #
5+ # Run ALL rebalancers in dry-run mode:
6+ # yarn e2e --run-modes all --dry-run
7+ #
8+ # Run a single rebalancer:
49# yarn e2e --run-modes methOnly --dry-run
10+ # yarn e2e --run-modes tacOnly --dry-run
11+ # yarn e2e --run-modes aManUsdeOnly --dry-run
12+ # yarn e2e --run-modes aMansyrupUsdtOnly --dry-run
13+ # yarn e2e --run-modes solanaUsdcOnly --dry-run
14+ #
15+ # Run with JSON config overrides:
16+ # yarn e2e --config ./e2e-config.example.json --dry-run
517#
618# Prerequisites:
719# 1. PostgreSQL: yarn workspace @mark/database db:setup
820# 2. Redis: yarn redis:up
921
1022# ─── Environment ─────────────────────────────────────────────────────────────
23+ # Use 'mainnet' so the config loader fetches the mainnet Everclear hosted config
24+ # (chain definitions, asset addresses, etc.) from S3.
25+ # MARK_CONFIG_MAINNET={} prevents SSM lookup for the mark config JSON — env vars below are used instead.
1126ENVIRONMENT=mainnet
1227STAGE=development
1328LOG_LEVEL=info
29+ MARK_CONFIG_MAINNET={}
30+ SHARD_MANIFEST=
31+
32+ # ─── SSM-backed optional params (set empty to prevent SSM lookups) ────────
33+ FILL_SERVICE_SIGNER_URL=
34+ BINANCE_API_KEY=
35+ BINANCE_API_SECRET=
36+ COINBASE_API_KEY=
37+ COINBASE_API_SECRET=
38+ KRAKEN_API_KEY=
39+ KRAKEN_API_SECRET=
40+ NEAR_JWT_TOKEN=
41+ STARGATE_API_URL=
42+ TAC_TON_RPC_URL=
43+ TAC_NETWORK=mainnet
44+ TON_MNEMONIC=
45+ TON_RPC_URL=
46+ TON_API_KEY=
47+ TON_SIGNER_ADDRESS=
1448
1549# ─── Wallet ──────────────────────────────────────────────────────────────────
16- # Test wallet private key (hex). For dry-run, this just needs to be a valid key
17- # to initialize adapters — no real transactions are submitted
18- WEB3_SIGNER_PRIVATE_KEY=
19- SIGNER_URL=
20- SIGNER_ADDRESS=
21- SOL_SIGNER_ADDRESS=
50+ # For dry-run, these just need to be valid keys/addresses to initialize adapters.
51+ # No real transactions are submitted.
52+ WEB3_SIGNER_PRIVATE_KEY= # hex private key (EVM)
53+ SIGNER_URL= # web3signer URL (optional, can be empty for dry-run)
54+ SIGNER_ADDRESS= # EVM address corresponding to WEB3_SIGNER_PRIVATE_KEY
55+ SOL_SIGNER_ADDRESS= # Solana address corresponding to SOLANA_PRIVATE_KEY
56+
57+ # Fill Service signer (if different from main signer; leave empty to use main signer)
58+ FILL_SERVICE_WEB3_SIGNER_PRIVATE_KEY= # hex private key for FS wallet (optional)
59+ FILL_SERVICE_SIGNER_URL= # web3signer URL for FS wallet (optional)
2260
2361# ─── RPC Providers ───────────────────────────────────────────────────────────
24- # At minimum, provide chains used by the rebalancers you want to test.
25- # mETH rebalancer uses chains 1 (ETH mainnet) and 5000 (Mantle)
62+ # Provide RPC URLs for all chains used by the rebalancers.
63+ # Multiple URLs can be separated by commas for fallback.
64+
65+ # Ethereum mainnet (required by: mETH, TAC, aManUSDe, aMansyrupUSDT, Solana)
2666CHAIN_1_PROVIDERS=https://1rpc.io/eth
67+
68+ # Mantle (required by: mETH, aManUSDe, aMansyrupUSDT)
2769CHAIN_5000_PROVIDERS=https://mantle.drpc.org
2870
29- # TAC rebalancer (if testing tacOnly )
30- # CHAIN_728126428_PROVIDERS = # Tron
71+ # TAC / Tron (required by: TAC USDT )
72+ CHAIN_239_PROVIDERS = # TAC RPC URL
3173
32- # Solana (if testing solanaUsdcOnly )
33- SOLANA_PRIVATE_KEY=# base58 Solana private key
74+ # Solana (required by: Solana ptUSDe )
75+ SOLANA_PRIVATE_KEY= # base58 Solana private key
3476SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
3577CHAIN_1399811149_PROVIDERS=https://api.mainnet-beta.solana.com
3678
3779# ─── Chain Configuration ────────────────────────────────────────────────────
38- CHAIN_IDS=1,5000,1399811149
80+ # Include all chain IDs used by the rebalancers you want to test
81+ CHAIN_IDS=1,5000,239,1399811149
3982SUPPORTED_SETTLEMENT_DOMAINS=1,5000
40- SUPPORTED_ASSET_SYMBOLS=USDC,USDT,WETH
83+ SUPPORTED_ASSET_SYMBOLS=USDC,USDT,WETH,mETH,USDe,syrupUSDT,aManUSDe,aMansyrupUSDT
4184
42- # Chain assets (format: SYMBOL,address,decimals,ticker,isNative)
85+ # Chain assets (format: SYMBOL,address,decimals,TICKER,isNative)
86+ # ETH mainnet — USDC, USDT, WETH
4387CHAIN_1_ASSETS=USDC,0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48,6,USDC,false;WETH,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2,18,WETH,false;USDT,0xdAC17F958D2ee523a2206206994597C13D831ec7,6,USDT,false
44- CHAIN_5000_ASSETS=USDC,0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9,6,USDC,false;WETH,0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111,18,WETH,false;USDT,0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE,6,USDT,false
88+
89+ # Mantle — USDC, USDT, WETH, mETH, USDe, syrupUSDT, aManUSDe, aMansyrupUSDT
90+ # NOTE: aManUSDe and aMansyrupUSDT addresses are Aave lending pool receipt tokens on Mantle.
91+ # These are loaded from chaindata at runtime. The values below are for local fallback only.
92+ # Replace with real addresses from your deployment if chaindata is not available.
93+ CHAIN_5000_ASSETS=USDC,0x09Bc4E0D864854c6aFB6eB9A9cdF58aC190D0dF9,6,USDC,false;WETH,0xdEAddEaDdeadDEadDEADDEAddEADDEAddead1111,18,WETH,false;USDT,0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE,6,USDT,false;mETH,0xcDA86A272531e8640cD7F1a92c01839911B90bb0,18,mETH,false
94+
95+ # TAC / Tron — USDT
96+ CHAIN_239_ASSETS=USDT,0xdAC17F958D2ee523a2206206994597C13D831ec7,6,USDT,false
4597
4698# ─── Database ────────────────────────────────────────────────────────────────
47- # Uses the same DB as local dev (docker-compose on port 5433)
4899DATABASE_URL=postgresql://postgres:postgres@localhost:5433/mark_dev?sslmode=disable
49100DATABASE_MIGRATION_PATH=db/migrations
50101
@@ -57,41 +108,83 @@ PUSH_GATEWAY_URL=http://localhost:9091
57108PROMETHEUS_ENABLED=false
58109
59110# ─── Everclear API ──────────────────────────────────────────────────────────
60- # Not needed for rebalance-only testing, but required by config loader
61111EVERCLEAR_API_URL=https://api.everclear.org
62112
63113# ─── Routes ─────────────────────────────────────────────────────────────────
64114# Leave unset — routes are not needed for rebalancer-only testing.
65- # Falls back to S3 then to empty routes, which is fine.
66115# ROUTES_LOCAL_YAML=
67116
68- # ─── mETH Rebalancer ────────────────────────────────────────────────────────
117+ # ═══════════════════════════════════════════════════════════════════════════════
118+ # REBALANCER CONFIGURATIONS
119+ # All rebalancers enabled with high thresholds so they always trigger in dry-run.
120+ # Fill in addresses with your test wallet address.
121+ # ═══════════════════════════════════════════════════════════════════════════════
122+
123+ # ─── mETH Rebalancer (chains: 1 ↔ 5000) ────────────────────────────────────
69124METH_REBALANCE_ENABLED=true
70- METH_REBALANCE_MARKET_MAKER_ADDRESS=
125+ METH_REBALANCE_MARKET_MAKER_ADDRESS= # your EVM wallet address
71126METH_REBALANCE_MARKET_MAKER_ON_DEMAND_ENABLED=false
72127METH_REBALANCE_MARKET_MAKER_THRESHOLD_ENABLED=false
73- METH_REBALANCE_FILL_SERVICE_ADDRESS=
128+ METH_REBALANCE_FILL_SERVICE_ADDRESS= # your EVM wallet address (or FS address)
129+ METH_REBALANCE_FILL_SERVICE_SENDER_ADDRESS= # FS sender on mainnet (optional, defaults to FS address)
74130METH_REBALANCE_FILL_SERVICE_THRESHOLD_ENABLED=true
75131METH_REBALANCE_FILL_SERVICE_THRESHOLD=999000000000000000000
76132METH_REBALANCE_FILL_SERVICE_TARGET_BALANCE=999000000000000000000
77133METH_REBALANCE_BRIDGE_MIN_REBALANCE_AMOUNT=100000000000000
78134METH_REBALANCE_BRIDGE_MAX_REBALANCE_AMOUNT=100000000000000
79135METH_REBALANCE_BRIDGE_SLIPPAGE_DBPS=500
80136
81- # ─── Solana ptUSDe Rebalancer ───────────────────────────────────────────────
137+ # ─── TAC USDT Rebalancer (chains: 1 ↔ 239) ─────────────────────────────────
138+ TAC_REBALANCE_ENABLED=true
139+ TAC_REBALANCE_MARKET_MAKER_ADDRESS= # your EVM wallet address
140+ TAC_REBALANCE_MARKET_MAKER_ON_DEMAND_ENABLED=false
141+ TAC_REBALANCE_MARKET_MAKER_THRESHOLD_ENABLED=true
142+ TAC_REBALANCE_MARKET_MAKER_THRESHOLD=999000000000000000000
143+ TAC_REBALANCE_MARKET_MAKER_TARGET_BALANCE=999000000000000000000
144+ TAC_REBALANCE_FILL_SERVICE_ADDRESS= # your EVM wallet address
145+ TAC_REBALANCE_FILL_SERVICE_SENDER_ADDRESS=
146+ TAC_REBALANCE_FILL_SERVICE_THRESHOLD_ENABLED=true
147+ TAC_REBALANCE_FILL_SERVICE_THRESHOLD=999000000000000000000
148+ TAC_REBALANCE_FILL_SERVICE_TARGET_BALANCE=999000000000000000000
149+ TAC_REBALANCE_BRIDGE_MIN_REBALANCE_AMOUNT=100000
150+ TAC_REBALANCE_BRIDGE_MAX_REBALANCE_AMOUNT=100000
151+ TAC_REBALANCE_BRIDGE_SLIPPAGE_DBPS=500
152+
153+ # ─── aManUSDe Rebalancer (chains: 1 → 5000, Stargate + DexSwap + AaveSupply) ─
154+ AMANUSDE_REBALANCE_ENABLED=true
155+ AMANUSDE_REBALANCE_FILL_SERVICE_ADDRESS= # your EVM wallet address
156+ AMANUSDE_REBALANCE_FILL_SERVICE_SENDER_ADDRESS= # FS sender on mainnet (optional)
157+ AMANUSDE_REBALANCE_FILL_SERVICE_THRESHOLD_ENABLED=true
158+ AMANUSDE_REBALANCE_FILL_SERVICE_THRESHOLD=999000000000000000000
159+ AMANUSDE_REBALANCE_FILL_SERVICE_TARGET_BALANCE=999000000000000000000
160+ AMANUSDE_REBALANCE_BRIDGE_MIN_REBALANCE_AMOUNT=100000
161+ AMANUSDE_REBALANCE_BRIDGE_MAX_REBALANCE_AMOUNT=100000
162+ AMANUSDE_REBALANCE_BRIDGE_SLIPPAGE_DBPS=50
163+ AMANUSDE_AAVE_POOL_ADDRESS=0x90df02551bB792286e8D4f13E0e357b4Bf1D6a26
164+ AMANUSDE_DEX_SWAP_SLIPPAGE_BPS=100
165+
166+ # ─── aMansyrupUSDT Rebalancer (chains: 1 → 5000, Stargate + DexSwap + AaveSupply) ─
167+ AMANSYRUPUSDT_REBALANCE_ENABLED=true
168+ AMANSYRUPUSDT_REBALANCE_FILL_SERVICE_ADDRESS= # your EVM wallet address
169+ AMANSYRUPUSDT_REBALANCE_FILL_SERVICE_SENDER_ADDRESS=
170+ AMANSYRUPUSDT_REBALANCE_FILL_SERVICE_THRESHOLD_ENABLED=true
171+ AMANSYRUPUSDT_REBALANCE_FILL_SERVICE_THRESHOLD=999000000
172+ AMANSYRUPUSDT_REBALANCE_FILL_SERVICE_TARGET_BALANCE=999000000
173+ AMANSYRUPUSDT_REBALANCE_BRIDGE_MIN_REBALANCE_AMOUNT=100000
174+ AMANSYRUPUSDT_REBALANCE_BRIDGE_MAX_REBALANCE_AMOUNT=100000
175+ AMANSYRUPUSDT_REBALANCE_BRIDGE_SLIPPAGE_DBPS=50
176+ AMANSYRUPUSDT_AAVE_POOL_ADDRESS=0x90df02551bB792286e8D4f13E0e357b4Bf1D6a26
177+ AMANSYRUPUSDT_DEX_SWAP_SLIPPAGE_BPS=100
178+
179+ # ─── Solana ptUSDe Rebalancer (chains: 1399811149 → 1 → 1399811149) ─────────
82180SOLANA_PTUSDE_REBALANCE_ENABLED=true
83181SOLANA_PTUSDE_REBALANCE_THRESHOLD=1000000000
84182SOLANA_PTUSDE_REBALANCE_TARGET=1000000000
85183SOLANA_PTUSDE_REBALANCE_BRIDGE_MIN_REBALANCE_AMOUNT=100000
86184SOLANA_PTUSDE_REBALANCE_BRIDGE_MAX_REBALANCE_AMOUNT=100000
87185SOLANA_PTUSDE_REBALANCE_BRIDGE_SLIPPAGE_DBPS=500
88186
89- # ─── Other Rebalancers (disabled) ──────────────────────────────────────────
90- TAC_REBALANCE_ENABLED=false
91- AMANUSDE_REBALANCE_ENABLED=false
92- AMANSYRUPUSDT_REBALANCE_ENABLED=false
93-
94187# ─── E2E Runner Defaults ────────────────────────────────────────────────────
95- # These can also be set via CLI flags (--dry-run, --config)
96- # DRY_RUN=true
188+ # These can also be set via CLI flags (--dry-run, --config, --run-modes, --sequential )
189+ DRY_RUN=true
97190# E2E_CONFIG_PATH=./e2e-config.example.json
0 commit comments