Calc Compound
by Saylor Innovations Dev Tools in Other
Compound interest calculator - final balance, interest earned and year-by-year growth for a principal, rate, years and optional monthly contribution
https://saylorinnovations.com/api/calc/compound- Price
- $0.01
- per call in USDC
- Uptime
- 100%
- last 30 days
- Response time
- 248 ms
- 729 ms slowest 5%
- Last check
- Passed
- 3 h ago, next any minute now
Reliability
How to call it
GET https://saylorinnovations.com/api/calc/compound
Each call costs $0.01 in USDC on Base, paid with the request over x402.
Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.
Example request
From the listing.
GET https://saylorinnovations.com/api/calc/compound?monthly_contribution=250&principal=10000&rate=6.5&years=20Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
monthly_contribution | string | No | optional, default 0 |
principal | string | No | Starting amount |
rate | string | No | Annual interest rate in percent |
years | string | No | Years to grow |
Example response
The provider's example. We can't check it without paying.
Example response, 134 lines
{
"annual_rate_percent": 6.5,
"compounds_per_year": 12,
"effective_annual_rate_percent": 6.6972,
"final_balance": 159169.7,
"interest_earned": 89169.7,
"method": "monthly stepping with the nominal rate compounded n times per year; contributions added at month end; no tax or inflation",
"monthly_contribution": 250,
"principal": 10000,
"total_contributions": 70000,
"yearly": [
{
"balance": 13760.73,
"contributions": 13000,
"interest": 760.73,
"year": 1
},
{
"balance": 17773.32,
"contributions": 16000,
"interest": 1773.32,
"year": 2
},
{
"balance": 22054.64,
"contributions": 19000,
"interest": 3054.64,
"year": 3
},
{
"balance": 26622.69,
"contributions": 22000,
"interest": 4622.69,
"year": 4
},
{
"balance": 31496.67,
"contributions": 25000,
"interest": 6496.67,
"year": 5
},
{
"balance": 36697.06,
"contributions": 28000,
"interest": 8697.06,
"year": 6
},
{
"balance": 42245.74,
"contributions": 31000,
"interest": 11245.74,
"year": 7
},
{
"balance": 48166.03,
"contributions": 34000,
"interest": 14166.03,
"year": 8
},
{
"balance": 54482.8,
"contributions": 37000,
"interest": 17482.8,
"year": 9
},
{
"balance": 61222.63,
"contributions": 40000,
"interest": 21222.63,
"year": 10
},
{
"balance": 68413.83,
"contributions": 43000,
"interest": 25413.83,
"year": 11
},
{
"balance": 76086.64,
"contributions": 46000,
"interest": 30086.64,
"year": 12
},
{
"balance": 84273.31,
"contributions": 49000,
"interest": 35273.31,
"year": 13
},
{
"balance": 93008.26,
"contributions": 52000,
"interest": 41008.26,
"year": 14
},
{
"balance": 102328.2,
"contributions": 55000,
"interest": 47328.2,
"year": 15
},
{
"balance": 112272.32,
"contributions": 58000,
"interest": 54272.32,
"year": 16
},
{
"balance": 122882.41,
"contributions": 61000,
"interest": 61882.41,
"year": 17
},
{
"balance": 134203.08,
"contributions": 64000,
"interest": 70203.08,
"year": 18
},
{
"balance": 146281.92,
"contributions": 67000,
"interest": 79281.92,
"year": 19
},
{
"balance": 159169.7,
"contributions": 70000,
"interest": 89169.7,
"year": 20
}
],
"years": 20
}Call it from code
The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.01.
curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i 'https://saylorinnovations.com/api/calc/compound?monthly_contribution=250&principal=10000&rate=6.5&years=20'
# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - 'https://saylorinnovations.com/api/calc/compound?monthly_contribution=250&principal=10000&rate=6.5&years=20' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
// Pays at most $0.01 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.01" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);
// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.01 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fsaylorinnovations.com%2Fapi%2Fcalc%2Fcompound
const res = await pay("https://saylorinnovations.com/api/calc/compound?monthly_contribution=250&principal=10000&rate=6.5&years=20");
console.log(res.status, await res.text());Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
# Pays at most $0.01 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.01"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))
with x402_requests(client) as session:
res = session.get("https://saylorinnovations.com/api/calc/compound?monthly_contribution=250&principal=10000&rate=6.5&years=20")
print(res.status_code, res.text)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 |
|---|---|---|---|---|
| 3 h ago | Passed | 402 | 199 ms | $0.01 |
| 7 h ago | Passed | 402 | 795 ms | $0.01 |
| 11 h ago | Passed | 402 | 684 ms | $0.01 |
| 15 h ago | Passed | 402 | 229 ms | $0.01 |
| 19 h ago | Passed | 402 | 248 ms | $0.01 |
Show 9 older checks
| 23 h ago | Passed | 402 | 303 ms | $0.01 |
| 27 h ago | Passed | 402 | 198 ms | $0.01 |
| 31 h ago | Passed | 402 | 560 ms | $0.01 |
| 35 h ago | Passed | 402 | 339 ms | $0.01 |
| 38 h ago | Passed | 402 | 186 ms | $0.01 |
| 42 h ago | Passed | 402 | 210 ms | $0.01 |
| 45 h ago | Passed | 402 | 729 ms | $0.01 |
| 2 days ago | Passed | 402 | 519 ms | $0.01 |
| 2 days ago | Passed | 402 | 195 ms | $0.01 |