Sidechain Proposal - Real-Time Notifications, Smarter Consensus, and Uniswap-Style Liquidity Pools

in steemdev •  2 days ago  (edited)

🔥 Echelon Sidechain: Real-Time Notifications, Smarter Consensus, and Uniswap-Style Liquidity Pools

Echelon Banner

We’re excited to announce a major set of upgrades to the Echelon sidechain, including a full Uniswap-style liquidity pool system and significant improvements to our P2P networking layer.


⚙️ Real-Time Notifications

Kafka-Powered Transaction Alerts

  • Subscribe to the tx-notifications Kafka topic to receive live transaction events.
  • Simple *Docker Compose setup (since Kafka runs beside the sidechain).

WebSocket Server Built-In

  • Echelon now runs a consumer/producer WS server for direct real-time updates.
  • Ideal for the upcoming Dex UI and/or external tools.

📨 Why We Use Kafka for Notifications

As Echelon evolves and as we start to build a full-featured DEX (Decentralized Exchange) for Steem, real-time notifications become critical for both users and external services. Here’s why Kafka is the right tool for the job:

Real-Time Transaction Feedback

When users submit transactions (swaps, liquidity adds, etc.), those transactions are first broadcast to the Steem blockchain as custom_json operations.
There is no magic way to get notified of the status of a transaction and there can be a delay before these transactions are picked up, validated, and executed on the Echelon sidechain.
Thanks to Kafka which provides a robust, scalable pub/sub system, UIs, bots, and services can instantly know when a transaction is accepted, executed, or fails on the sidechain after they have been sent to Steem.

Decoupled, Scalable Architecture

Kafka allows multiple consumers (UIs, bots, analytics, explorers) to subscribe to the same stream of transaction events without interfering with each other. A node owner (witness) can choose to run or not the notification service.
This decoupling means the core node can focus on consensus and block production, while Kafka handles high-throughput notification delivery.

Reliable Delivery & Replay

Kafka ensures that no notifications are lost, even if a UI or service is temporarily offline—they can catch up from where they left off.
This is essential for a DEX, where users and bots need reliable, real-time updates on swaps, pool changes, and order status.

Unified Notification System

When a transaction is submitted via Steem to the sidechain, Kafka provides a single, unified channel for all transaction-related events.
This makes it easy for frontends and third-party services to track transaction status, confirmations, and market/pool updates.

Future-Proofing

As Echelon grows, Kafka can scale horizontally to handle thousands of events per second, supporting more users, more transactions, and more integrations.


🧠 Smarter Consensus and Chain Integrity

Improved Consensus Logic

  • Outlier nodes no longer affect the consensus percentage.
  • Reflects the true majority state of the network.

Enhanced Chain Consistency

  • Blocks are now strictly ordered — no more out-of-sequence acceptance.
  • Improved error handling and peer health diagnostics.

🌐P2P Networking Improvements

Outlier-Resistant Consensus

Consensus percentage now excludes outlier nodes (e.g., lagging or misbehaving peers).
Network health metrics now reflect the true state of the majority, not skewed by a single slow node.

Robust Peer Discovery & Connection

Improved peer discovery and connection logic for more reliable network formation.
Automatic reconnection and peer sharing (gossip protocol) to maintain a healthy mesh.

Reliable Block Propagation

Enhanced logic to ensure blocks are only accepted and processed in strict sequential order.
Out-of-order blocks are buffered and only processed when all previous blocks are present, maintaining chain integrity even during sync or recovery.

Health Checks & Metrics

Periodic health checks for all peers, with automatic cleanup of stale or unresponsive connections.
Detailed network metrics and logging for easier monitoring and debugging.

Cleaner, More Maintainable Code

Refactored P2P code for readability, modularity, and easier future upgrades.


💱 Uniswap-Style Liquidity Pools — DeFi on Steem

Echelon now supports automated market maker (AMM) pools like Uniswap v2. This opens the door to native token swaps, staking, and LP rewards — all directly on the sidechain.

image.png

🧩 1. Create a Pool

  • Anyone can launch a pool for any token pair.
  • Choose your own fee tier: 0.01%, 0.05%, 0.3%, or 1%.

💧 2. Add Liquidity

  • Deposit both tokens to receive LP tokens.
  • First staker sets the initial price.
  • LP tokens track your share and can be burned to exit.

🔄 3. Swap Tokens

  • Swap tokens instantly using the Uniswap v2 formula.
  • Includes slippage protection (minOutput supported).
  • All swaps are fully on-chain and auditable.

🔓 4. Remove Liquidity

  • Burn LP tokens to withdraw your share.
  • Earned fees are split proportionally among LPs.

🧭 5. Advanced Routing

  • Multi-hop swaps supported.
  • Routes are calculated for optimal trades across pools.

🐞 Bug Fixes & Robustness

  • Enhanced error diagnostics during sync.
  • Better consensus and peer health metrics.

🧭 What’s Next?

  • More DeFi features and pool analytics. (we are going to include farms for LP's)
  • Performance tweaks and sync optimizations
  • Transactions tests

⚠️Missing Updates

What you see here is just a glimpse — these updates represent less than half of the total improvements we’ve made recently. To explore all the changes, fixes, and features under development, check out our GitHub repository:

🔗 Echelon GitHub: FutureShockco/echelon


Thanks for supporting Echelon & Steem — we’re just getting started. 🚀

This summary was generated with help from AI using real testnet logs and GitHub commits to ensure accuracy and technical depth.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!