Go to PolySwarm

Optimizing Your Bidding Strategy

How you bid in the PolySwarm Marketplace determines your reward. The pot in any Bounty is made up of an initial reward plus all the Microengine bids.

The Microengines with assertions that match the ground truth, as determined by the Arbiters, split the pot. Each Winning Microengine gets their own bid back, and a portion of the remaining pot, according bid size. Accurate Engines that bid the most, win the most.

Engine owners will want to optimize their bid strategy for the biggest wins and smallest losses. These optimizations go into the compute_bid() function, assuming the Engine was built using microengine-webhooks-py.

Compute Bid

The default bid implementation in microengine-webhooks-py computes the bid as a function of confidence.

def compute_bid(bounty: Bounty, scan_result: ScanResult) -> int:
    max_bid = bounty.rules.get(settings.MAX_BID_RULE_NAME, settings.DEFAULT_MAX_BID)
    min_bid = bounty.rules.get(settings.MIN_BID_RULE_NAME, settings.DEFAULT_MIN_BID)

    bid = min_bid + max(scan_result.confidence * (max_bid - min_bid), 0)
    bid = min(bid, max_bid)
    return bid

Many Engines do not have a confidence value to work with. If a confidence value is ot provided, the default confidence in ScanResult will yield the max value at all times. An Engine may want to create their own custom bid strategy. A very conservative Engine owner may just return the minbid for every bounty. A bold Engine owner intentionally return the maxbid regardless of confidence. Other Engines may bid based on the mimetype, verdict, malware family in the ScanResult metadata.

Engines should optimize towards the maximum NCT yield, and a bid strategy may change based on real results in the marketplace.

Keep in mind that the Bounty object's rules normally include a MAX_BID and a MIN_BID, so your bidding logic should select a value in that range.

Next Steps

Interested in Developing an Engine in another Language or Framework? Take a look at the protocols required to talk with PolySwarm.

2021 © PolySwarm Pte. Ltd.