Class BiddingEngine

The bidding engine is used for determining the bidding amount for a given side effect. It expects SFXs that have already been evaluated by the strategy engine and are deemed profitable.

Hierarchy

  • BiddingEngine

Constructors

Properties

bidAggressive: boolean = config.bidding.bidAggressive

Being aggressive when bidding means to oubtbid everyone to get the SFX

bidMeek: boolean = config.bidding.bidMeek

Being meek when bidding means to obtain the max profit

bidPercentile: number = config.bidding.bidPercentile

How close you are to the max profit

closerPercentageBid: number = config.bidding.closerPercentageBid

How close to be when been outbid, but still wants to be place a bid close to last one

equalMinProfitBid: boolean = config.bidding.equalMinProfitBid

If outbid, executor makes the same last bid

numberOfBidsByExecutor: Map<string, number> = ...

Number of bid by executor

numberOfBidsOnSfx: Map<string, number> = ...

Number of bids on each side effect. KEYs: sfx id; VALUEs: number of bids

overrideNoCompetition: boolean = config.bidding.overrideNoCompetition

When there's no competition yet, get the execution by getting the smallest profit

prometheus: Prometheus
timesBeenOutbid: Map<string, number> = ...

At the beginning, it has never been outbid

whoBidsOnWhat: Map<string, string[]> = ...

Which executors are bidding on which side effect. KEYs: sfx id; VALUEs: executor ids array

Methods

  • Keep a record of how many executor have bid into each SFX.

    Parameters

    Returns void

  • Check if the executor has been outbid in the SFX, and if so, updates the map.

    Parameters

    Returns boolean

    true if the top bidder changed

  • Check the scenario the executor+sfx are in to select which behavior to apply.

    Parameters

    Returns Scenario

    The situation to choose the action

  • Clean the data structures after the bidding phase is over. Called in removeFromQueue in executionManager.

    Parameters

    • sfxId: string

      The side effect ID

    Returns void

  • Helper function to remove reduce the count of bids by executor

    Parameters

    • sfxId: string

      The side effect ID

    Returns void

  • When an executor has been undercut, it can choose to: - Undercut again - Keep the previous bid - Exit the bidding process

    Parameters

    Returns number

    The bidding amount in USD

  • Computes the bidding amount for a given SFX for a certain scenario.

    Parameters

    Returns number

    The bidding amount in USD

  • When there are no other bids, the executor maximizes the profit or gets the execution.

    Parameters

    Returns number

    The bidding amount in USD

  • When there are other bids, the executor can choose to: - Outbid everyone - Get % (bidPercentile) close to the top bid - Get the max profit The last two options suppose that executors can exit the bidding process, so someone bidding less would still win it.

    Parameters

    Returns number

    The bidding amount in USD

  • Store who (bidder id) bids on what (sfx id), to keep a "database" to, maybe, implement exclusion rules for bidding (e.g., I don't want to bid if this ID is in there; or bid to keep those people out); and also store how many bids an executor have made in total.

    Parameters

    • sfxId: string

      The side effect ID

    • bidderId: string

      The executor ID

    Returns void

Generated using TypeDoc