80trust / 100
Coast Fire Calculator
by Sindri in Markets & finance
x402 APIPassing, checked 5 min ago
Coast FIRE calculator. Computes the lump sum needed today, invested with zero further contributions, to grow into your full retirement number by your target retirement age, plus (given an ongoing monthly contribution) a year-by-year projection of when your actual trajectory crosses that lump sum.
POST https://ppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws/coastFireCalculator
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 159 ms typical, 416 ms slowest 5%
- Last check
- 5 min ago
- Next check
- in 23 min
How to call it
# See the payment challenge (nothing is charged)
curl -i -X POST "https://ppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws/coastFireCalculator" \
-H "content-type: application/json" \
-d '{"currentAge":30,"currentNetWorth":100000,"retirementAge":65,"retirementAnnualSpending":40000}'import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client().register(
"eip155:8453",
new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws%2FcoastFireCalculator
const res = await pay("https://ppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws/coastFireCalculator", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"currentAge":30,"currentNetWorth":100000,"retirementAge":65,"retirementAnnualSpending":40000}),
});
console.log(await res.json());Example input
{
"currentAge": 30,
"currentNetWorth": 100000,
"retirementAge": 65,
"retirementAnnualSpending": 40000
}Example output
{
"data": {
"coastFireMessage": "You need to increase your monthly contribution to reach Coast FIRE before age 65",
"coastFireNumberToday": 253415.47072729058,
"fireNumberAtRetirement": 1000000,
"hasCoastFired": false,
"params": {
"currentAge": 30,
"currentNetWorth": 100000,
"inflationRate": 0.03,
"investmentReturnRate": 0.07,
"monthlyContribution": 0,
"retirementAge": 65,
"retirementAnnualSpending": 40000,
"swr": 0.04
},
"surplusOrDeficit": -153415.47072729058,
"yearsToCoastFire": null
},
"ok": true
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 5 min ago | Passed | 402 | 159 ms | $0.01 |
| 4 h ago | Passed | 402 | 362 ms | $0.01 |
| 7 h ago | Passed | 402 | 122 ms | $0.01 |
| 11 h ago | Passed | 402 | 133 ms | $0.01 |
| 14 h ago | Passed | 402 | 416 ms | $0.01 |
| 19 h ago | Passed | 402 | 414 ms | $0.01 |
| 22 h ago | Passed | 402 | 142 ms | $0.01 |
| 25 h ago | Passed | 402 | 462 ms | $0.01 |
| 30 h ago | Passed | 402 | 138 ms | $0.01 |