Primary finding
fee.priceUsd assumed to be a multiplier of human fee amount; semantics likely wrong
- symbiosis/scripts/symbiosis-quote.py:74-76
- symbiosis/scripts/symbiosis-swap.py:109-111
- symbiosis/references/api-reference.md:56-60
The code multiplies `fee_human` (token units) by `priceUsd` to get USD. That works only if `priceUsd` is the per-token USD price. The example response shows fee in USDC with priceUsd=1.0, which is ambiguous (also matches 'fee already in USD'). Float parsing of arbitrarily large fixed-point amounts via `float()` can also lose precision for large fee amounts (e.g., gas fee in ETH/wei). If `priceUsd` is actually the total fee in USD (which is more common in DEX APIs), the script double-counts. Without a canonical source documented in the PR (only the example), this is ambiguous and `${fee_usd:.4f}` could be wildly off for non-stable fee tokens.
Recommendation
Confirm semantics with the Symbiosis API docs and either trust priceUsd as a precomputed USD figure or compute via fee_human × priceUsd consistently; add a unit test fixture; avoid `float()` on smallest-units strings.