Apy Apr Converter
workflow.run_apy_apr_converterConvert an APR (nominal yearly rate) to an APY (effective yearly rate) or back, for a compounding you choose. APY = (1 + APR / m)^m - 1 for m periods a year, e^APR - 1 when continuous. The same APY is a different APR at every compounding frequency, so the frequency is required: give periodsPerYear (365 daily, 12 monthly) or continuous true, not both. Rates are fractions (0.12 = 12%). It converts rate arithmetic only: it does not include fees, token price moves or the risk that a pool rate changes. Edge cases: rate a fraction from -periodsPerYear (APR) or above -1 (APY) up to 1000; give periodsPerYear (1 to 365) or continuous true, never both and never neither; the rate per period must stay above -100%; a continuous APR above 709 (70,900%) is an error. Not covered: fees, token price moves, a pool rate that changes, taxes, and compounding that is not regular. Use when user asks "what APR is an 8% APY compounded daily?" or "what is 12% APR monthly as an APY?". Returns: apr, apy, periodsPerYear, continuous, ratePerPeriod, apyMinusApr, byCompounding (the same APY as an APR at annual, semiannual, quarterly, monthly, weekly, daily and continuous compounding).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"direction": "<direction>",
"rate": "<rate>"
},
"name": "workflow.run_apy_apr_converter"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rate | Yes | The rate you have, as a fraction per year (0.12 = 12%), up to 1000. An APY must be above -1; an APR must satisfy APR / periodsPerYear above -1 | |
| direction | Yes | apr_to_apy converts the given APR into an APY; apy_to_apr the reverse | |
| continuous | No | True for continuous compounding; then omit periodsPerYear | |
| periodsPerYear | No | Compounding periods a year, 1 to 365 (12 monthly, 365 daily). Omit when continuous is true |