Retry strategy
- Honour
Retry-Afteron every429and503. - Use exponential backoff (for example 2 s, 4 s, 8 s, capped at 60 s) for
500and for503withoutRetry-After. - Never retry other
4xxresponses: fix the request instead. - For a
202, poll the job (cost 1), not the wallet (cost 5).
200-level outcomes that are not errors
- Partial coverage:
coverage.status: "partial"; one or more protocols have statuserrororskippedwith anerror_code(an open enum, for exampleADAPTER_QUARANTINED,BUDGET_EXCEEDED,DEADLINE_EXCEEDED). - Null values:
value_usd: nullon a leg andtotal_value_usd: nullwithtotal_null_reasons. Unknown is not zero. - Skipped protocols: an adapter can be skipped (not approved, quarantined, disabled, over budget); positions in it are not ruled out.
Handling null and partial values
totals.total_value_usd: nullcomes withtotals.total_null_reasons(for exampleindicative_legswhen a leg is priced from a thin market). Showknown_value_usdinstead, labelled as partial.known_value_usdadds priced and indicative legs. It is not a lower bound when a debt is unpriced.- A leg with
value_usd: nullhas avaluation_statusthat says why (unsupported,no_liquidity,stale, …). - Never treat
nullas zero. Unknown values arenull; a real zero is"0". Amounts and USD values are decimal strings: parse them with a decimal library, not floating point.