PolySwarmPolySwarmPolySwarmPolySwarm
Go to PolySwarm
Home

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, plus a portion of the remaining pot, proportional to their 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 not 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 min_bid for every Bounty. A bold Engine owner intentionally return the max_bid regardless of Confidence. Other Engines may Bid based on the mimetype, verdict, or 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 MUST select a value in that range, or the Bid will be ignored


Next Steps

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

2024 © PolySwarm Pte. Ltd.