Pavan’s story

Smart Exit: Ordering Asynchronous Trade Actions

Reworked a trading alert into an automated exit workflow and resolved duplicate actions under load.

  • Event-Driven Systems
  • Kafka
  • Concurrency Control
  • Trading Infrastructure

Pavan Kumar Segu

Senior Software Engineer 1 at FYERS

FFYERS
CCoinSwitch
3+ years of experience

From their time as

F

Software Engineer 1

FYERS • 2023 - 2025

Overview

Pavan redesigned Smart Exit from a notification feature into an automated position-management workflow. He resolved out-of-order processing and duplicate square-offs, then validated the fix with a 100,000-message load test.

The Story

Pavan joined Smart Exit when the feature tracked real-time PnL and notified users after a target or stop-loss threshold was reached. The next step was to automate the resulting action so users did not have to respond manually.

He revamped the Go backend into three services. The creator handled user commands, the engine tracked positions, and the watcher executed square-offs, alerts, or continued monitoring through Kafka events.

Load testing exposed an ordering problem. Concurrent goroutines could process messages for the same user out of sequence, causing the same position to be squared off more than once.

Pavan introduced a dedicated sequential pipeline for each user. Messages could still run concurrently across users, while events for one user were processed in order.

The team reproduced the issue by sending 100,000 messages at once. They reran the same test after the change and confirmed that the duplicate-action failure was resolved.

Ownership Snapshot

Broad role

Backend engineer designing the Go services behind Smart Exit.

Goal

Turn PnL alerts into reliable automated position-management actions.

Direct ownership

Reworked the service flow and designed per-user message-processing pipelines.

Team execution

Integrated creator, engine, and watcher services through Kafka and validated the flow with load tests.