75trust / 100

Cash On Cash Return Calculator

by Sindri in News & content

x402 APIPassing, checked 3 h ago

Cash-on-cash return calculator for real estate investing. Runs a full multi-year deal analysis (per-category rent/expense growth, a sale scenario, IRR) and headlines the first-year cash-on-cash return: operating cash flow divided by invested cash.

POST https://ppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws/cashOnCashReturnCalculator

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
404 ms typical, 578 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://ppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws/cashOnCashReturnCalculator" \
  -H "content-type: application/json" \
  -d '{"annualInsurance":0,"annualMaintenance":0,"annualPropertyTaxes":0,"closingCosts":0,"downPaymentPercent":0.2,"hoaAnnualIncrease":0,"holdingLengthYears":2,"insuranceAnnualIncrease":0,"interestRate":0,"loanTermYears":10,"maintenanceAnnualIncrease":0,"monthlyHOA":0,"monthlyRent":2000,"otherAnnualExpenses":0,"otherAnnualIncrease":0,"propertyManagementFeeRate":0,"purchasePrice":200000,"rehabCosts":0,"rentAnnualIncrease":0,"saleExpensesRate":0,"salePrice":200000,"taxesAnnualIncrease":0,"vacancyRate":0}'
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%2FcashOnCashReturnCalculator
const res = await pay("https://ppu43fkyhimq5fiqpmo42eh5ri0yypid.lambda-url.us-east-1.on.aws/cashOnCashReturnCalculator", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"annualInsurance":0,"annualMaintenance":0,"annualPropertyTaxes":0,"closingCosts":0,"downPaymentPercent":0.2,"hoaAnnualIncrease":0,"holdingLengthYears":2,"insuranceAnnualIncrease":0,"interestRate":0,"loanTermYears":10,"maintenanceAnnualIncrease":0,"monthlyHOA":0,"monthlyRent":2000,"otherAnnualExpenses":0,"otherAnnualIncrease":0,"propertyManagementFeeRate":0,"purchasePrice":200000,"rehabCosts":0,"rentAnnualIncrease":0,"saleExpensesRate":0,"salePrice":200000,"taxesAnnualIncrease":0,"vacancyRate":0}),
});
console.log(await res.json());

Example input

{
  "annualInsurance": 0,
  "annualMaintenance": 0,
  "annualPropertyTaxes": 0,
  "closingCosts": 0,
  "downPaymentPercent": 0.2,
  "hoaAnnualIncrease": 0,
  "holdingLengthYears": 2,
  "insuranceAnnualIncrease": 0,
  "interestRate": 0,
  "loanTermYears": 10,
  "maintenanceAnnualIncrease": 0,
  "monthlyHOA": 0,
  "monthlyRent": 2000,
  "otherAnnualExpenses": 0,
  "otherAnnualIncrease": 0,
  "propertyManagementFeeRate": 0,
  "purchasePrice": 200000,
  "rehabCosts": 0,
  "rentAnnualIncrease": 0,
  "saleExpensesRate": 0,
  "salePrice": 200000,
  "taxesAnnualIncrease": 0,
  "vacancyRate": 0
}

Example output

{
  "data": {
    "firstYear": {
      "NOI": 24000,
      "capRate": 0.12,
      "cashFlow": 8000,
      "cashOnCashReturn": 0.2
    },
    "investedCash": 40000,
    "irr": 0.5177,
    "monthlyMortgagePayment": 1333.33,
    "params": {
      "annualInsurance": 0,
      "annualMaintenance": 0,
      "annualPropertyTaxes": 0,
      "closingCosts": 0,
      "downPaymentPercent": 0.2,
      "hoaAnnualIncrease": 0,
      "holdingLengthYears": 2,
      "insuranceAnnualIncrease": 0,
      "interestRate": 0,
      "loanTermYears": 10,
      "maintenanceAnnualIncrease": 0,
      "monthlyHOA": 0,
      "monthlyRent": 2000,
      "otherAnnualExpenses": 0,
      "otherAnnualIncrease": 0,
      "propertyManagementFeeRate": 0,
      "purchasePrice": 200000,
      "rehabCosts": 0,
      "rentAnnualIncrease": 0,
      "saleExpensesRate": 0,
      "salePrice": 200000,
      "taxesAnnualIncrease": 0,
      "vacancyRate": 0
    },
    "sale": {
      "impliedAnnualGrowthRate": 0,
      "netProceeds": 72000,
      "totalProfitAfterSale": 48000
    },
    "totals": {
      "NOI": 48000,
      "expenses": 0,
      "mortgagePayments": 32000,
      "operatingCashFlow": 16000,
      "rentalIncome": 48000
    },
    "yearByYear": [
      {
        "NOI": 24000,
        "annualCashFlow": 8000,
        "annualCoCReturn": 0.2,
        "annualExpenses": 0,
        "annualIncome": 24000,
        "annualMortgagePayment": 16000,
        "interestPortion": 0,
        "loanBalance": 144000,
        "principalPortion": 16000,
        "totalEquity": 56000,
        "year": 1
      }
    ]
  },
  "ok": true
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402397 ms$0.01
6 h agoPassed402459 ms$0.01
10 h agoPassed402446 ms$0.01
13 h agoPassed402364 ms$0.01
17 h agoPassed402485 ms$0.01
21 h agoPassed402578 ms$0.01
24 h agoPassed402158 ms$0.01
28 h agoPassed4021.0 s$0.01
32 h agoPassed402182 ms$0.01
35 h agoPassed402404 ms$0.01
40 h agoPassed402116 ms$0.01