Back to ER Diagram
Reverse Auction

Reverse Auction Logic

Real-time competitive bidding with SignalR WebSocket, auto-extension, vendor ranking, and bid validation for cost optimization through dynamic price discovery.

5 Tables
SignalR Real-Time
Auto-Extension
Anonymized Bidding

Overview

The Reverse Auction module enables competitive real-time bidding among vendors where they compete by lowering their prices. The system provides live updates via SignalR WebSocket connections, ensuring all participants see bids in real-time.

Real-Time Updates via SignalR

Key Features

  • Live countdown timer synchronized across all participants
  • Real-time bid updates pushed to all connected vendors
  • Auto-extension on last-minute bids
  • Anonymized vendor identities (Vendor A, B, C)
  • Minimum decrement enforcement (% or amount)

Participants

  • RFQ Creator: Creates and manages reverse auctions
  • RFQ Approver: Approves auction setup (if required)
  • Vendors: Participate in auctions, submit competitive quotes

Auction Lifecycle Flow

Shortlist Bids
From RFQ Response
Create Auction
Configure Parameters
Scheduled
Awaiting Start
LIVE
Real-Time Bidding
Completed
Results Available
Award
Select Winner(s)

Auction Status States

Status Code Description Allowed Actions
DRAFT 0 Auction created but not yet scheduled Edit, Delete, Schedule
SCHEDULED 1 Auction scheduled, vendors notified Modify (before start), Cancel
ACTIVE 2 Live auction in progress View Only, Auto-Extend
EXTENDED 3 Auction extended due to last-minute bid View Only, Auto-Extend Again
COMPLETED 4 Auction ended, results available View Results, Shortlist, Award
CANCELLED 5 Auction terminated before completion View Only
NO_PARTICIPATION 6 No vendors participated Restart, Cancel
RESERVE_NOT_MET 7 Lowest bid above reserve price Negotiate, Cancel

SignalR Real-Time Architecture

Vendor Client A
Browser/SignalR Client
Vendor Client B
Browser/SignalR Client
Buyer Dashboard
Live Monitoring
WebSocket Connections
ChatHub (SignalR)
Real-Time Hub
ReverseAuctionServices
Business Logic Layer
PostgreSQL
Stored Procedures

SignalR Hub Implementation

public class ChatHub : Hub
{
    // Called when a vendor submits a new bid
    [HubMethodName("sendBid")]
    public void SendBid()
    {
        IHubContext context = GlobalHost.ConnectionManager.GetHubContext<ChatHub>();
        context.Clients.All.updatedData();  // Broadcast to all
    }

    // Called for general data updates (rank changes, time extensions)
    [HubMethodName("sendData")]
    public void SendData()
    {
        IHubContext context = GlobalHost.ConnectionManager.GetHubContext<ChatHub>();
        context.Clients.All.send();
    }
}

Client-Side Real-Time Events

// Initialize SignalR connection
var hubNotif = $.connection.chatHub;

// Handle real-time bid updates
hubNotif.client.updatedData = function() {
    $.ajax({
        url: RootUrl + 'ReverseAuction/VendorLiveRA',
        data: { RASlno: RASlno, SignalRChat: "true" },
        success: function(data) {
            $('#vendorRank').text(data.InitialRank);  // Update rank
            $('#RAToMinute').val(data.ToTimeMinutes);  // Update time if extended
        }
    });
};

// Start connection and submit bids
$.connection.hub.start().done(function() {
    $("#btn_save").click(function() {
        $.ajax({
            url: RootUrl + 'ReverseAuction/VendorLiveRA',
            type: 'POST',
            data: formData,
            success: function() {
                hubNotif.server.sendBid();   // Broadcast to all
                hubNotif.server.sendData();
            }
        });
    });
});

Bid Validation Rules

BR-RA-001: Minimum Vendors

At least 2 shortlisted vendors required to create reverse auction

BR-RA-005: Quote Must Be Lower

New quote must be lower than current lowest bid

BR-RA-006: Minimum Decrement

Must meet minimum decrement requirement (percentage or fixed amount)

BR-RA-007: Deadline Lock

Quotes are locked after auction deadline (unless extended)

BR-RA-008: T&C Acceptance

Terms & Conditions acceptance is mandatory before quoting

Discount Validation Logic

function validateDiscount(discountType, discountValue, initialBid, minDecrement) {
    if (discountType === 'P') {  // Percentage-based
        if (discountValue < minDecrement || discountValue >= 100) {
            return { valid: false,
                     error: `Discount must be >= ${minDecrement}% and < 100%` };
        }
        var newBidPrice = initialBid - (initialBid * discountValue / 100);
    } else if (discountType === 'A') {  // Amount-based
        if (discountValue < minDecrement || discountValue >= initialBid) {
            return { valid: false,
                     error: `Discount must be >= ${minDecrement} and < ${initialBid}` };
        }
        var newBidPrice = initialBid - discountValue;
    }
    return { valid: true, newBidPrice: newBidPrice };
}

Auto-Extension Logic

01:23:45
Time Remaining (Auto-extends on last-minute bids)

Extension Configuration

  • Extension Window: Typically 5 minutes before end
  • Extension Duration: Usually 3 minutes added
  • Max Extensions: Configurable limit (default: 10)

Extension Trigger

  • Bid received within extension window
  • Auction end time automatically extended
  • All participants notified via SignalR
  • Timer resets to new end time

Database Tables

Table Schema Purpose Key Columns
reverse_auctions procurement Auction header with configuration auction_id, rfq_id, start_time, end_time, min_decrement
auction_participants procurement Vendor participation tracking auction_id, vendor_id, terms_accepted, final_rank
auction_bids procurement Individual bid submissions auction_id, vendor_id, bid_amount, bid_time, bid_sequence
auction_line_items procurement Items being auctioned auction_id, product_id, quantity, starting_price
rfqs procurement Source RFQ (rfq_type = 'REVERSE_AUCTION') rfq_id, rfq_type, is_sealed_bid, submission_deadline

Stored Procedures (USPs)

Procedure Name Purpose Key Parameters
PROC_INSERT_TReverseAuction Create new reverse auction ReverseAuctionNo, RADate, TargetPrice, MinDiscount
PROC_INSERT_TVENDORRA Insert vendor bid during live auction RASlno, VendorSlno, InitialBid, DiscountPer, NewBidPrice
PROC_UPDATE_TOTIME Extend auction end time RADate, ToTimeHour, ToTimeMinute, RASlno
PROC_SELECT_VENDORDETAILSSUMMARY Get all vendor bids for ranking RASlno
PROC_MODIFY_TRAAcceptPaymentsTerms Record vendor T&C acceptance RASlno, VendorSlno
PROC_SELECT_LiveRAList Get list of active/live auctions PageNumber, PageSize, SearchText

Security & Fair Play

Vendor Anonymity

  • Vendors cannot see other vendor identities
  • Displayed as "Vendor A", "Vendor B", "Vendor C"
  • Only final rankings visible to all
  • Prevents bid collusion

Bid Integrity

  • All bids encrypted in transit (TLS)
  • Server-side time synchronization
  • Rate limiting on bid submissions
  • Complete audit trail maintained

Audit Trail

  • Every bid timestamped with sequence
  • Extension events logged
  • T&C acceptance recorded
  • IP addresses captured