# Supported Metrics

{% hint style="info" %}
ℹ️ **REVIEW NEEDED**: Please verify that all metrics documented here are actually implemented in arb-assist. The profit\_per\_arb metric in particular should be confirmed as it was mentioned in the changelog but may not exist in the actual code.
{% endhint %}

This reference documents all metrics available for sorting and filtering in arb-assist.

## Financial Metrics

### profit

**Type**: Integer (lamports)\
**Range**: 0 to MAX\_U64\
**Description**: Total cumulative arbitrage profit generated by a mint

**Calculation**:

```
profit = Σ(output_amount - input_amount - gas_fees)
```

**Usage**:

```toml
# Sort by highest profit
intermint_sort_strategy = { metric = "profit", direction = "descending" }

# Filter by minimum profit
filter_thresholds = [{ min_profit = 10_000_000 }]
```

**Best for**:

* Maximizing absolute returns
* High-capital strategies
* Long-term value extraction

### roi

**Type**: Float\
**Range**: 0.0 to ∞\
**Description**: Return on Investment - profit relative to costs

**Calculation**:

```
roi = total_profit / total_gas_fees
```

**Usage**:

```toml
# Sort by efficiency
intermint_sort_strategy = { metric = "roi", direction = "descending" }

# Require minimum ROI
filter_thresholds = [{ min_roi = 2.0 }]  # 200% return
```

**Best for**:

* Capital-efficient strategies
* Limited fund operations
* Cost-conscious trading

### profit\_per\_arb

**Type**: Integer (lamports)\
**Range**: 0 to MAX\_U64\
**Description**: Average profit per successful arbitrage

**Calculation**:

```
profit_per_arb = total_profit / successful_arbs_count
```

**Usage**:

```toml
# Find consistent performers
intermint_sort_strategy = { metric = "profit_per_arb", direction = "descending" }

# Filter by consistency
filter_thresholds = [{ min_profit_per_arb = 1_000_000 }]
```

**Best for**:

* Identifying reliable opportunities
* Risk-adjusted strategies
* Consistent returns

### fee

**Type**: Integer (lamports)\
**Range**: 0 to MAX\_U64\
**Description**: Total transaction fees paid

**Calculation**:

```
fee = Σ(priority_fees + base_fees + jito_tips)
```

**Usage**:

```toml
# Sort by lowest fees (ascending)
pool_sort_strategy = { metric = "fee", direction = "ascending" }
```

**Note**: Primarily used internally for ROI calculations

## Volume Metrics

### total\_volume

**Type**: Integer (lamports)\
**Range**: 0 to MAX\_U64\
**Description**: Combined buy and sell volume

**Calculation**:

```
total_volume = buy_volume + sell_volume
```

**Usage**:

```toml
# High activity tokens
intermint_sort_strategy = { metric = "total_volume", direction = "descending" }

# Minimum activity requirement
filter_thresholds = [{ min_total_volume = 1_000_000_000 }]
```

**Best for**:

* Finding active markets
* Liquidity assessment
* Opportunity frequency

### net\_volume

**Type**: Integer (lamports)\
**Range**: 0 to MAX\_U64\
**Description**: Absolute difference between buy and sell volume

**Calculation**:

```
net_volume = |buy_volume - sell_volume|
```

**Usage**:

```toml
# Find trending tokens
intermint_sort_strategy = { metric = "net_volume", direction = "descending" }

# Require directional movement
filter_thresholds = [{ min_net_volume = 100_000_000 }]
```

**Best for**:

* Trend identification
* Directional strategies
* Momentum trading

### buy\_volume

**Type**: Integer (lamports)\
**Range**: 0 to MAX\_U64\
**Description**: Total volume of buy transactions

**Usage**:

```toml
# Focus on buying pressure
intermint_sort_strategy = { metric = "buy_volume", direction = "descending" }
```

### sell\_volume

**Type**: Integer (lamports)\
**Range**: 0 to MAX\_U64\
**Description**: Total volume of sell transactions

**Usage**:

```toml
# Focus on selling pressure
intermint_sort_strategy = { metric = "sell_volume", direction = "descending" }
```

### imbalance

**Type**: Float\
**Range**: 0.0 to 1.0\
**Description**: Ratio of directional volume to total volume

**Calculation**:

```
imbalance = net_volume / total_volume
```

**Usage**:

```toml
# Find imbalanced markets
intermint_sort_strategy = { metric = "imbalance", direction = "descending" }

# Require significant imbalance
filter_thresholds = [{
  min_imbalance_ratio = 0.2,  # At least 20% imbalanced
  max_imbalance_ratio = 0.8   # Not more than 80% one-sided
}]
```

**Best for**:

* Identifying price pressure
* Arbitrage opportunities
* Market inefficiencies

## Success Metrics

### successful\_arbs

**Type**: Integer\
**Range**: 0 to MAX\_U64\
**Description**: Count of successful arbitrage transactions

**Usage**:

```toml
# Most proven opportunities
intermint_sort_strategy = { metric = "successful_arbs", direction = "descending" }

# Require track record
filter_thresholds = [{ min_txns = 10 }]
```

**Best for**:

* Proven opportunities
* Reliability assessment
* Historical validation

### fails

**Type**: Integer\
**Range**: 0 to MAX\_U64\
**Description**: Count of failed arbitrage attempts

**Usage**:

```toml
# Find least risky (sort ascending)
intermint_sort_strategy = { metric = "fails", direction = "ascending" }

# Limit acceptable failures
filter_thresholds = [{ min_fails = 5 }]  # Max 5 failures
```

**Best for**:

* Risk assessment
* Reliability filtering
* Success rate analysis

### buy\_count

**Type**: Integer\
**Range**: 0 to MAX\_U64\
**Description**: Number of buy transactions observed

**Usage**:

```toml
# High buy activity
pool_sort_strategy = { metric = "buy_count", direction = "descending" }
```

### sell\_count

**Type**: Integer\
**Range**: 0 to MAX\_U64\
**Description**: Number of sell transactions observed

**Usage**:

```toml
# High sell activity
pool_sort_strategy = { metric = "sell_count", direction = "descending" }
```

## Market Metrics

### liquidity

**Type**: Integer (lamports)\
**Range**: 0 to MAX\_U64\
**Description**: Total liquidity across all pools for a mint

**Calculation**:

```
liquidity = Σ(pool_base_reserves + pool_quote_reserves)
```

**Usage**:

```toml
# Deepest liquidity first
intermint_sort_strategy = { metric = "liquidity", direction = "descending" }

# Minimum depth requirement
filter_thresholds = [{ min_liquidity = 10_000_000_000 }]  # $10k
```

**Best for**:

* Large position trades
* Slippage minimization
* Stable pricing

### pool\_age

**Type**: Integer (milliseconds)\
**Range**: 0 to MAX\_U64\
**Description**: Time since pool was first detected by arb-assist

**Usage**:

```toml
# Newest pools first
intermint_sort_strategy = { metric = "pool_age", direction = "ascending" }

# Or oldest pools first
intermint_sort_strategy = { metric = "pool_age", direction = "descending" }
```

**Best for**:

* New token discovery
* Launch trading
* Maturity assessment

**Note**: This is detection time, not actual pool creation time

### turnover

**Type**: Float\
**Range**: 0.0 to ∞\
**Description**: Ratio of volume to liquidity

**Calculation**:

```
turnover = total_volume / liquidity
```

**Usage**:

```toml
# High activity relative to size
intermint_sort_strategy = { metric = "turnover", direction = "descending" }

# Minimum activity ratio
filter_thresholds = [{ min_turnover = 2.0 }]  # Volume 2x liquidity
```

**Best for**:

* Finding active pools
* Efficiency metrics
* Opportunity frequency

### volatility

**Type**: Float\
**Range**: 0.0 to ∞\
**Description**: Price movement intensity measure

**Calculation**:

```
volatility = σ(price_changes) / μ(price)
```

**Usage**:

```toml
# Most volatile first
intermint_sort_strategy = { metric = "volatility", direction = "descending" }

# Require minimum volatility
filter_thresholds = [{ min_volatility = 0.01 }]  # 1% minimum
```

**Best for**:

* High opportunity markets
* Risk assessment
* Arbitrage potential

## Metric Combinations

### Composite Strategies

Combine metrics for sophisticated filtering:

```toml
filter_thresholds = [{
  # Profitability
  min_profit = 10_000_000,
  min_roi = 2.0,
  min_profit_per_arb = 500_000,
  
  # Activity
  min_total_volume = 1_000_000_000,
  min_turnover = 1.5,
  
  # Reliability
  min_txns = 10,
  min_fails = 5,  # max 5 fails
  
  # Market quality
  min_liquidity = 5_000_000_000,
  min_volatility = 0.005
}]
```

### Conditional Logic

Different metrics for different conditions:

```toml
# Tier 1: Volume-focused
filter_thresholds = [{
  min_total_volume = 10_000_000_000,
  min_turnover = 3.0
}]

# Tier 2: Profit-focused
filter_thresholds = [{
  min_profit = 100_000_000,
  min_roi = 5.0
}]
```

## Performance Considerations

### Memory Impact

All metrics accumulate historical data over time:

* Controlled by the `halflife` parameter
* Shorter halflife = less memory usage
* Longer halflife = more historical context

### Update Frequency

Metrics are recalculated based on the configured interval:

```toml
update_interval = 10000  # Every 10 seconds
```

* More frequent updates provide fresher data
* Less frequent updates reduce system load
* Balance based on your performance requirements

## Best Practices

1. **Start Simple**: Use basic metrics like profit and volume
2. **Add Complexity Gradually**: Layer in advanced metrics
3. **Monitor Performance**: Some metrics are CPU-intensive
4. **Validate Assumptions**: Backtest metric effectiveness
5. **Combine Wisely**: Multiple metrics can conflict
6. **Document Choices**: Record why you chose specific metrics
7. **Review Regularly**: Market conditions change

## Metric Availability

### By Output Mode

All metrics available in all modes:

* `mode = "smb"`
* `mode = "na"`
* `mode = "both"`

### By Sort Context

**intermint\_sort\_strategy**: All metrics available

**pool\_sort\_strategy**: Subset available:

* profit
* successful\_arbs
* liquidity
* volume metrics
* pool\_age

### Real-time vs Historical

All metrics incorporate historical data with decay:

```toml
halflife = 120000  # 2-minute half-life
```

Recent activity weighted more heavily than old data.
