🧩Feature Mechanics & AI Formulas
💻 Core algorithms powering real-time DeFi threat detection
1. DeFiWatch: Real-Time DeFi Threat Detection
def defi_watch(defi_data):
price_change = defi_data["priceChange"]
market_liquidity = defi_data["marketLiquidity"]
token_volume = defi_data["tokenVolume"]
risk_factor = (price_change / market_liquidity) * token_volume
alert_threshold = 0.5
# Calculate risk factor based on price change, liquidity, and token volume
if risk_factor > alert_threshold:
return "Alert: Potential DeFi Threat Detected"
else:
return "DeFi Market Stable"
Description: DeFiWatch continuously scans token markets and calculates a dynamic risk factor using three key parameters: price change, market liquidity, and token volume. This helps detect anomalies such as pump-and-dumps, low-liquidity traps, or sudden shifts in market sentiment. If the computed factor crosses the danger line, an instant alert is generated.
2. WakeAlert: Token Behavior Analysis
function wakeAlert(tokenData) {
const fluctuationRatio = Math.abs(tokenData.currentPrice - tokenData.previousPrice) / tokenData.previousPrice;
const volumeImpact = tokenData.transactionVolume / tokenData.marketLiquidity;
// Evaluate the alert based on fluctuation ratio and volume impact
if (fluctuationRatio > 0.1 && volumeImpact > 0.5) {
return 'Alert: Token Behavior Out of Normal Range';
} else {
return 'Token Behavior Normal';
}
}
Description: WakeAlert focuses on sudden price movements and how they relate to current liquidity. When price volatility exceeds normal thresholds — especially during low liquidity phases — this often signals manipulation or coordinated wallet activity. WakeAlert helps users detect tokens acting “off-script” before it becomes obvious to the market.
3. TokenSense: Suspicious Activity Monitoring
def token_sense(token_data):
price_change = token_data["priceChange"]
previous_price = token_data["previousPrice"]
token_volume = token_data["tokenVolume"]
market_liquidity = token_data["marketLiquidity"]
price_impact = price_change / previous_price
volume_ratio = token_volume / market_liquidity
# Monitor for suspicious activity based on price impact and volume ratio
if abs(price_impact) > 0.2 and volume_ratio > 1:
return "Alert: Suspicious Token Activity Detected"
else:
return "Token Activity Normal"
Description: TokenSense detects irregular market behavior by evaluating how aggressively a token’s price is moving in relation to its environment. A spike in volume with disproportionate price movement can indicate wash trading, bot swarms, or stealth launches with malicious intent. TokenSense is calibrated to flag these moments before users fall into a trap.
4. WalletGuard: Risk Alert System
function walletGuard(walletData) {
const walletRiskScore = walletData.totalVolume / walletData.activeTokens;
const alertThreshold = 0.75;
// Calculate wallet risk score based on transaction volume and active token count
if (walletRiskScore > alertThreshold) {
return 'Alert: High-Risk Wallet Detected';
} else {
return 'Wallet Activity Normal';
}
}
Description: WalletGuard identifies wallets acting with suspicious intensity, such as whales rotating through low-cap tokens, multi-token exploits, or sniper contracts. By comparing total transaction volume to the diversity of token holdings, it highlights wallets that pose a potential threat — especially useful in pre-launch and early market phases.
5. DeFiShield: Multi-Chain Risk Detection
function defiShield(defiData) {
const multiChainRisk = (defiData.priceVolatility * defiData.totalVolume) / defiData.marketLiquidity;
const riskThreshold = 1.0;
// Detect multi-chain risk based on volatility, volume, and liquidity
if (multiChainRisk > riskThreshold) {
return 'Alert: Multi-Chain Risk Detected';
} else {
return 'DeFi Safe';
}
}
Description: DeFiShield is BitwakeScan’s upcoming module for cross-chain risk intelligence. It evaluates tokens with bridges or presence on multiple chains, calculating a composite risk level based on volatility, volume surges, and liquidity depth. The model is designed to catch events like synchronized exploits, cross-chain rug setups, and early-stage flashloan attacks before they ripple across ecosystems.
Last updated