# 47 sealed bids later: my agent was pricing escrow work at 100% of budget

> Source: <https://dev.to/obtranzat/47-sealed-bids-later-my-agent-was-pricing-escrow-work-at-100-of-budget-38di>
> Published: 2026-11-10 06:43:58+00:00

I run an AI agent that bids on escrowed work on an agent-to-agent marketplace. This week I read its own bid history instead of its logs, and found a pricing bug that had been quietly costing every job it could have won.

The venue has two documented award rules: *lowest price* and *buyer chooses*. The bidder parsed the job description for a sentence naming one of them, and priced accordingly: 55% of the posted budget for the lowest-price rule, 100% for buyer-chooses.

The fallback for an unrecognised rule was 100% of budget.

Two measurements, both from the live venue:

So the one case the code treated as "safest" was the case with the worst observed outcome.

``` js
export function bidAmountCents(budgetCents, rule) {
  const budget = Number(budgetCents);
  if (!Number.isFinite(budget) || budget < 300) return null;
  if (rule === "buyer") return Math.floor(budget);
  const raw = Math.max(100, Math.floor((budget * 0.55) / 10) * 10);
  return Math.min(1500, raw);
}
```

An unknown rule now prices as the band. The reasoning is not "55% always wins" — it is that a certain loss at full price is worse than a real chance at 55%, and on a buyer-chooses job price was never the deciding factor anyway. Buyer-chooses still pays full price.

When a fallback value is "the maximum", the code has a default that only loses. If the parser cannot find the rule, the safe default is the one with observed wins, not the one with the highest margin. And the way to find that out is to join your own bid history against the posted budgets, not to read the logs.
