Skip to content
Merged
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
19 changes: 11 additions & 8 deletions harnesses/bridge-monitor/cmd/monitor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ type Config struct {
WalletSOLAddress string

// Execution Configuration
ExecutionMode string // "dry-run", "single-test", "production"
Freq3USD time.Duration // Frequency for $3 tests
Freq30USD time.Duration // Frequency for $30 tests
EnableDebridge bool // Execute Debridge (expensive)
EnableR4RoundTrip bool // Execute R4 TRUMP<->BRETT round-trip (memes, not fee-neutral)
EnableR5Hypercore bool // Execute R5 Arb<->HyperCore round-trip (needs HL withdraw path)
MaxDailySpendUSD float64 // Safety cap
TestAmountUSD float64 // Override test amount (for testing with small amounts)
ExecutionMode string // "dry-run", "single-test", "production"
Freq3USD time.Duration // Frequency for $3 tests
Freq30USD time.Duration // Frequency for $30 tests
EnableDebridge bool // Execute Debridge (expensive)
EnableR4RoundTrip bool // Execute R4 TRUMP<->BRETT round-trip (memes, not fee-neutral)
EnableR5Hypercore bool // Execute R5 Arb<->HyperCore round-trip (needs HL withdraw path)
EnableNearIntentsExec bool // Execute the USDC-only triangle via Near Intents 1Click
MaxDailySpendUSD float64 // Safety cap
TestAmountUSD float64 // Override test amount (for testing with small amounts)

// General
MonitorRegion string
Expand Down Expand Up @@ -114,6 +115,7 @@ func loadEnv() (*Config, error) {
// stay quote-only until deliberately enabled and validated in single-test.
config.EnableR4RoundTrip = os.Getenv("ENABLE_R4_ROUNDTRIP_EXEC") == "true"
config.EnableR5Hypercore = os.Getenv("ENABLE_R5_HYPERCORE_EXEC") == "true"
config.EnableNearIntentsExec = os.Getenv("ENABLE_NEARINTENTS_EXEC") == "true"

// Max daily spend (default: $10/day for safety)
config.MaxDailySpendUSD = parseFloat(os.Getenv("MAX_DAILY_SPEND_USD"), 10.0)
Expand Down Expand Up @@ -237,6 +239,7 @@ func (c *Config) LogConfig() {
log.Printf(" Debridge Execution: %v", c.EnableDebridge)
log.Printf(" R4 Round-trip Execution: %v", c.EnableR4RoundTrip)
log.Printf(" R5 HyperCore Execution: %v", c.EnableR5Hypercore)
log.Printf(" Near Intents Execution: %v", c.EnableNearIntentsExec)
log.Printf(" Max Daily Spend: $%.2f", c.MaxDailySpendUSD)
if c.TestAmountUSD > 0 {
log.Printf(" Test Amount Override: $%.2f", c.TestAmountUSD)
Expand Down
3 changes: 3 additions & 0 deletions harnesses/bridge-monitor/cmd/monitor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type Executor struct {
relay *RelayBridge
lifi *LiFiBridge
debridge *DebridgeBridge
nearIntents *NearIntentsBridge
region string
slack *SlackNotifier
spend *SpendTracker
Expand Down Expand Up @@ -396,6 +397,8 @@ func (e *Executor) executeOnBridge(bridge string, route TestRoute, amount, amoun
result, txHash, err = e.executeRelay(route, rawUnits, quoteStart)
case "lifi":
result, txHash, err = e.executeLiFi(route, rawUnits, quoteStart)
case "near-intents":
result, txHash, err = e.executeNearIntents(route, amountUSD, rawUnits, quoteStart)
}

// Populate route fields for Slack (do this before error check so failed results have route info)
Expand Down
4 changes: 4 additions & 0 deletions harnesses/bridge-monitor/cmd/monitor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ func main() {
var hlClient *HyperliquidClient
if executor != nil {
hlClient = NewHyperliquidClient(executor.txExecutor)
executor.SetNearIntents(nearIntentsBridge)
}

// Pre-seed the self-healing series so alerting rules match from startup.
Expand Down Expand Up @@ -407,6 +408,9 @@ func runLoopTier(executor *Executor, bc *BalanceChecker, slack *SlackNotifier,
if config.EnableR5Hypercore {
runR5RoundTrip(executor, bc, slack, hl, tier)
}
if config.EnableNearIntentsExec {
runNearIntentsTriangle(executor, tier)
}
}

// runR4RoundTrip executes R4 (TRUMP->BRETT) and immediately its return leg
Expand Down
Loading
Loading