Skip to content
V

Vyara

#whenAMMGotIntelligent

Created on 25th January 2026

•

V

Vyara

#whenAMMGotIntelligent

The problem Vyara solves

#Problem Statement

Trading on AMMs like Uniswap is not just about price — it’s about execution risk.
When you submit a swap, you are exposed to:
→ Slippage spikes
→ Liquidity imbalance
→ Volatility shocks
→ Sudden volume surges
→ MEV and sandwich pressure
→ Bad timing during unstable blocks
Most bots and scripts today rely on:
Fixed slippage tolerance
Static thresholds
Hardcoded heuristics
External data pipelines
No real-time risk feedback
This makes automated execution fragile and unsafe in fast-changing on-chain markets.

#What This Engine Solves
This engine acts as a real-time execution risk layer for on-chain trading systems.
Instead of blindly executing swaps, it continuously evaluates:
Is this a good moment to trade — or should we wait?
It converts live pool state into structured risk intelligence and actionable decisions.

##Native On-Chain Compatibility
The engine is designed to work directly with AMM contracts.

Instead of relying on third-party indexers or off-chain APIs:
>It can subscribe directly to pool state
>Read reserves, swaps, and volume from smart contracts
>Build snapshots directly from on-chain events
>Eliminate dependency on external data providers
>Reduce trust assumptions and data latency
>This allows seamless integration with custom AMMs, private pools, or protocol-owned liquidity, making the system fully composable and trust-minimized.

##What It Analyzes
The engine continuously evaluates:

Liquidity Trend
Detects liquidity inflow / outflow behavior
Identifies thinning pools before slippage spikes
Market Stability
Measures short-term volatility using log returns
Penalizes unstable price regimes
Trading Activity
Captures abnormal volume and swap bursts
Helps detect crowding and congestion
Order Flow Pressure
Buy vs sell dominance inside the pool
Shock Detection
Z-score detection on volume and price jumps
Flags abnormal regime changes
Execution Impact
Simulates real swap slippage and worst-case slippage

##What It Produces
For every snapshot, the engine outputs:
→ Quantitative Signals
→ Adaptive Slippage Margin (epsilon)
→ Execution Quality Score (Q ∈ [0,1])
→ Decision Classification

EXECUTE
CAUTION
WAIT

→ Confidence Score (smoothed + risk adjusted)
This allows any system to reason about when to trade, not just how to trade.

##Who Can Use This
This engine can plug into:
Automated trading bots
Arbitrage engines
Custom AMMs
DeFi dashboards
Execution routers
Treasury automation
Risk monitoring systems
Anywhere you need adaptive execution intelligence instead of static heuristics.

##What we are using for
we are using it for our custom build AMM , our algorithm uses the data fetched from blockchain . Our AMM function like a Uniswap v2 and usues the data to give user inner insights of the latest trends.

Challenges we ran into

Challenges Faced

  1. Parameter Tuning Without Machine Learning
    A major challenge was selecting the constants and weights used across the engine — including stability decay, EMA factors, scoring weights, and decision thresholds.
    These parameters directly influence how the engine reacts to volatility, liquidity changes, and execution risk. In a production-grade system, these values should ideally be learned and optimized using:

Historical datasets
Reinforcement learning or optimization pipelines
Continuous backtesting and calibration
Due to limited time and compute resources during the hackathon, implementing a full ML calibration pipeline was not feasible. Instead, the constants were tuned manually through iterative testing and stress simulations to achieve stable and interpretable behavior.
This limitation was acknowledged early and the system was designed so that these parameters can later be learned automatically.

  1. Lack of Native Data From Our Own AMM

Our own AMM did not yet have sufficient live trading activity to generate meaningful datasets for signal extraction, visualization, and stress testing.

To overcome this:

Initial testing was done using fully simulated market snapshots.
The engine was then migrated to partially simulated + real Uniswap transaction data using the Etherscan API.
Finally, live snapshots were streamed using WebSocket connections to observe real-time behavior.

This progressive data pipeline allowed validation of the engine logic even before real liquidity existed in our own protocol.
The architecture is designed so that once liquidity grows, the engine can directly connect to the AMM contract without any third-party dependency.

  1. Real-Time Infrastructure and Deployment Limitations

The live WebSocket pipeline worked locally for streaming Uniswap data and updating graphs in real time.
However, after deployment, persistent WebSocket connections required managed infrastructure (e.g., Railway / long-running services / persistent sockets), which was outside the scope of the hackathon deployment environment.
As a result, the final demo focuses on deterministic replay and snapshot-based visualization rather than continuous live streaming.

  1. High Mathematical Complexity Under Time Constraints

The engine integrates multiple mathematical components:

Exponential moving averages
Log-return volatility modeling
Z-score shock detection
Liquidity normalization
Slippage simulation
Risk-weighted scoring

Understanding, validating, and correctly implementing these models within a very limited time window was one of the biggest challenges. Much of the mathematical reasoning, stability testing, and parameter validation had to be done in a single night.
This required careful debugging, numerical sanity checks, and iterative refinement to ensure correctness and stability.

Tracks Applied (3)

Open Track

All team members are students in IITR

Freshers

All the team members are 1y in IITR

Forge Build

All team members were part of Forge-Build cohort

Discussion

Builders also viewed

See more projects on Devfolio