Crypto Profit
workflow.run_crypto_profitProfit or loss on a spot crypto trade (coins bought and sold outright, no leverage, no funding) after both fees. Give exactly one of investment (total cash spent, buy fee included) or quantity (coins bought). Each fee is a fraction of that fill's trade value (0.001 = 0.1%): the buy fee is paid on top of the coins' cost, the sell fee comes out of the sale value. For a leveraged perpetual futures position see workflow.run_pnl_planning. Use when user asks "I bought BTC at $X, what is my profit if I sell at $Y?" or "what price do I need to sell at to break even after fees?". Returns: quantity, totalCost, proceeds, totalFees, profit, roiPct and priceChangePct (fractions), priceMultiple, breakevenSellPrice, annualizedReturnPct (a fraction, only when holdingDays is given and is at least 30, null otherwise: annualizing a shorter hold gives meaningless figures).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buyPrice | Yes | Price paid per coin, in the quote currency (e.g. 60000 for BTC in USD) | |
| quantity | No | Number of coins bought (e.g. 0.5). Give this or investment, not both | |
| buyFeePct | No | Buy fee as a fraction of the trade value, 0 to 0.05 (0.001 = 0.1%). Default 0 | |
| sellPrice | Yes | Price per coin at the sale, or the price to test, same currency | |
| investment | No | Total cash spent on the buy, buy fee included (e.g. 1000). Give this or quantity, not both | |
| sellFeePct | No | Sell fee as a fraction of the trade value, 0 to 0.05 (0.001 = 0.1%). Default 0 | |
| holdingDays | No | Optional: days the coins were held; 30 or more also returns the annualized return |