Actions7
Calculate Quote Prices
AI-generatedSummary
Calculate price metrics from the incoming item’s quote data. Reads quote (or treats the item itself as the quote), extracts amounts from a direct quote or the first route, and returns the input-to-output price and minimum price using a 3% default slippage for route-based quotes.
Inputs
- Incoming item JSON (required) — Provide quote data as
quote.amount_inandquote.amount_out(optionallyquote.min_amount_out), or asquote.routeswith at least one route containingswapAmount.quantityandreturnAmount.quantity. Optional top-levelfromToken,toToken, andsettings.humanReadableAmountsaffect token labels and ADA unit conversion.
Output shape
A single item per input item, containing a timestamp and either calculated price metrics or an error.
Successful results include
fromToken,toToken,pricePerToken, andminPricePerToken. Missing token labels default tounknown. Whensettings.humanReadableAmountsis false or absent, amounts are converted between lovelace and ADA only for tokens labeledlovelace. Unparseable quote data returns a timestamp anderrorfield; it does not throw from the calculation helper.
