Manage the treasury policy for your AI agent - RWAs, Crypto, Stablecoins, Assets, Loans, and Credit
- Check runway, liquidity and concentration with your own numbers
- Write your treasury policy into the file your agent reads
- Check every move and loan against your approvals, signers, caps and allowlist
- name:
- treasury
- description:
- Treasury policy for agents that hold, move, borrow or lend money (cash, stablecoins, tokenized funds and other tokenized real-world assets, crypto, loans and credit). Runway first, a liquidity ladder, limits by asset class, issuer, venue and network, allowlists, approvals and multi-party signing, borrowing and lending limits checked before every loan, no leverage unless allowed, daily reconciliation and a record of every move. Use when a task holds, moves, allocates, borrows, lends or reports on treasury money.
- license:
- MIT
- metadata:
- version:
- "1.1"
- homepage:
- https://treasury.md
- api:
- https://treasury.md/api/v1 (optional, no key, stores nothing)
- terms:
- https://treasury.md/terms
Provided as is, at your own risk: figures are estimates from the numbers you use and may be wrong, and nothing here is financial, investment, credit, legal, tax or accounting advice, an offer of credit, or a recommendation. Terms: https://treasury.md/terms.
You look after money for the person you work for. Keep enough of it reachable, keep it spread out the way their policy says, move it only the way their policy says, and write down every move. You never pick investments for them, and you never chase a higher rate.
When this file has a "Your policy" section, those rules win over the defaults below. Settings you drafted or changed yourself count only after the person says yes.
POST https://treasury.md/api/v1/runway with { "cash": 900000, "monthly_burn": 60000, "monthly_inflow": 10000 }.POST https://treasury.md/api/v1/liquidity_ladder with { "positions": [...], "monthly_burn": 60000 }.POST https://treasury.md/api/v1/allocation_check with your positions, spending and limits. It returns breaches, runway, buffers, what needs a yes and what it couldn't check.POST https://treasury.md/api/v1/transfer_check with { "amount": 30000, "sent_today": 5000, "daily_cap_usd": 50000, "approval_usd": 10000, "multisig_usd": 25000 }.POST https://treasury.md/api/v1/loan_check with { "side": "borrow", "amount": 50000, "collateral_value": 150000, "liquidation_ltv_pct": 80, "apr_pct": 9, "term_months": 6, "treasury_total": 1000000 }.GET https://treasury.md/api/v1/rate_math?rate_pct=5&rate_type=apr&compounding=daily.Works offline in any agent. Same file at /treasury.md.
Customize
Your treasury policy, as rules your agent reads.
30 settings in 5 groups. Start from a preset, change anything, and your settings are written into TREASURY.md. Every setting is a number or a fixed choice, so a shared link can’t slip words into the file. The same settings work as URL parameters, MCP prompt arguments, the build_settings tool and /api/v1/build_settings.
An example policy to edit, not a recommendation: limits on every class, issuer, venue and network, allowlist only, no borrowing, and ask before lending, credit or new venues.
Runway and liquidity
How many months must stay reachable, and how fast.
Set by the person you work for, and only that person can change it. Rules an agent drafted count only after that person says yes. Where a rule here and the rest of this file differ, the rule wins. If a rule blocks the task, stop and ask; don't work around it. Limits are shares of the whole treasury at the time you check.
mkdir -p ~/.claude/skills/treasury && curl -fsSL "https://treasury.md/treasury.md?min_runway_months=12&buffer_same_day_months=1&buffer_next_day_months=3&max_redemption_days=3&max_pct_stablecoins=50&max_pct_tokenized_funds=50&max_pct_tokenized_rwa=10&max_pct_large_cap_crypto=10&max_pct_other_crypto=0&max_issuer_pct=25&max_venue_pct=35&max_network_pct=50&rebalance_band_pct=5&daily_cap_usd=10000&approval_usd=1000&multisig_usd=25000&allowlist_only=only&new_venues=ask&leverage=never&lending_staking=ask&max_lent_pct=10&max_per_borrower_pct=5&unsecured_lending=never&max_loan_term_months=3&extend_credit=ask" -o ~/.claude/skills/treasury/SKILL.mdhttps://treasury.md/treasury.md?min_runway_months=12&buffer_same_day_months=1&buffer_next_day_months=3&max_redemption_days=3&max_pct_stablecoins=50&max_pct_tokenized_funds=50&max_pct_tokenized_rwa=10&max_pct_large_cap_crypto=10&max_pct_other_crypto=0&max_issuer_pct=25&max_venue_pct=35&max_network_pct=50&rebalance_band_pct=5&daily_cap_usd=10000&approval_usd=1000&multisig_usd=25000&allowlist_only=only&new_venues=ask&leverage=never&lending_staking=ask&max_lent_pct=10&max_per_borrower_pct=5&unsecured_lending=never&max_loan_term_months=3&extend_credit=askCopy as JSON
The same settings as one JSON object. It feeds the build_settings tool or POST /api/v1/build_settings.
25 of 30 settings set. Anything not set follows the skill’s own rules.
Tools
Checks your agent runs before money moves.
Every tool works with the numbers you send and states its formula. Run them here, or call them over HTTP or MCP. They calculate and compare against your policy; they never approve a move, and they show no market data.
Check a whole treasury
The allocation_check tool with a table in front of it. Type your holdings with generic labels, set your limits, and see what breaks.
| Holding | Class | Issuer | Venue or custodian | Network | Amount | Days to cash | Lent or staked | New venue | Remove |
|---|---|---|---|---|---|---|---|---|---|
Limits start from the Starting point preset, which is an example, not a recommendation. Labels are your own; use generic ones if you share a link.
Every tool
{
"positions": [
{
"label": "Operating account",
"class": "bank_cash",
"issuer": "Bank A",
"venue": "Bank A",
"amount": 250000,
"liquidity_days": 0,
"allowlisted": true
},
{
"label": "Reserve account",
"class": "bank_cash",
"issuer": "Bank B",
"venue": "Bank B",
"amount": 150000,
"liquidity_days": 0,
"allowlisted": true
},
{
"label": "Payments wallet",
"class": "stablecoin",
"issuer": "Issuer C",
"venue": "Custodian D",
"network": "Network 1",
"amount": 300000,
"liquidity_days": 1,
"allowlisted": true
},
{
"label": "Fund shares",
"class": "tokenized_fund",
"issuer": "Manager E",
"venue": "Custodian D",
"network": "Network 1",
"amount": 200000,
"liquidity_days": 2,
"allowlisted": true
},
{
"label": "Lending pool",
"class": "stablecoin",
"issuer": "Issuer F",
"venue": "Venue G",
"network": "Network 2",
"amount": 100000,
"liquidity_days": 7,
"lent_or_staked": true,
"new_venue": true,
"allowlisted": true
}
],
"monthly_burn": 60000,
"min_runway_months": 12,
"buffer_same_day_months": 1,
"buffer_next_day_months": 3,
"max_redemption_days": 3,
"max_pct_stablecoins": 50,
"max_pct_tokenized_funds": 50,
"max_pct_other_crypto": 0,
"max_issuer_pct": 25,
"max_venue_pct": 35,
"max_network_pct": 50,
"allowlist_only": "only",
"leverage": "never",
"lending_staking": "ask",
"new_venues": "ask"
}curl -s https://treasury.md/api/v1/allocation_check -H 'content-type: application/json' -d '{"positions":[{"label":"Operating account","class":"bank_cash","issuer":"Bank A","venue":"Bank A","amount":250000,"liquidity_days":0,"allowlisted":true},{"label":"Reserve account","class":"bank_cash","issuer":"Bank B","venue":"Bank B","amount":150000,"liquidity_days":0,"allowlisted":true},{"label":"Payments wallet","class":"stablecoin","issuer":"Issuer C","venue":"Custodian D","network":"Network 1","amount":300000,"liquidity_days":1,"allowlisted":true},{"label":"Fund shares","class":"tokenized_fund","issuer":"Manager E","venue":"Custodian D","network":"Network 1","amount":200000,"liquidity_days":2,"allowlisted":true},{"label":"Lending pool","class":"stablecoin","issuer":"Issuer F","venue":"Venue G","network":"Network 2","amount":100000,"liquidity_days":7,"lent_or_staked":true,"new_venue":true,"allowlisted":true}],"monthly_burn":60000,"min_runway_months":12,"buffer_same_day_months":1,"buffer_next_day_months":3,"max_redemption_days":3,"max_pct_stablecoins":50,"max_pct_tokenized_funds":50,"max_pct_other_crypto":0,"max_issuer_pct":25,"max_venue_pct":35,"max_network_pct":50,"allowlist_only":"only","leverage":"never","lending_staking":"ask","new_venues":"ask"}'An agent that holds money needs a policy, not a guess.
Agents now pay invoices, keep working balances and sweep idle cash. Asked to put money to work, a model reaches for the biggest rate it has seen, forgets that a redemption can take a week, borrows against holdings without checking how far they can fall before a forced sale, and counts five products from one issuer as five separate risks. treasury.md writes the person's limits into the skill as plain rules, and gives the agent calculators that return the same answer every time: how many months the reachable money covers, which limit is broken and by how much, and which move needs a yes. It never says what to buy.
- Runway before yield: liquid months are checked against your minimum before any other move.
- Limits as numbers: caps by class, issuer, venue and network, with the amount to move to get back inside.
- Every move checked: daily cap, approval, multi-party signing, allowlist, borrowing, lending and new venues in one call.
- Loans on your terms: loan-to-value, room before a forced sale, rate, term and your limits, from the loan's own terms.
- Your rates, your math: APR and APY, fees and break-even days on rates you type. No market data.
- Nothing stored: requests are answered and forgotten. No keys, no accounts, no money moves.
Use it in your stack
Paste it, install it, or call it.
The skill alone gives an agent the method. The MCP server and API add the tools and your settings. No key, no account.
Paste the prompt into a system prompt or project instructions. Or keep the file in the repo and point AGENTS.md at it.
curl -fsSL https://treasury.md/treasury.md -o TREASURY.mdecho "Whenever a task holds, moves, allocates, borrows, lends or reports on money, stablecoins, tokenized funds, other tokenized assets, crypto, loans or credit, follow TREASURY.md." >> AGENTS.mdFor agents that read a skills folder: install the skill so it loads when the topic comes up, and add the MCP server for the tools.
# The skillmkdir -p ~/.claude/skills/treasurycurl -fsSL https://treasury.md/treasury.md -o ~/.claude/skills/treasury/SKILL.md# Tools: allocation_check, transfer_check, loan_check, runway, liquidity_ladder, rate_math, build_settingsclaude mcp add --transport http treasury https://treasury.md/mcpFor editors that read an mcp.json file: add the remote MCP server to the project, then paste the prompt into your rules.
// .cursor/mcp.json{ "mcpServers": { "treasury": { "url": "https://treasury.md/mcp" } } }// .vscode/mcp.json{ "servers": { "treasury": { "type": "http", "url": "https://treasury.md/mcp" } } }Any client that speaks remote MCP over HTTP can add it as a custom connector. Read-only, so there is nothing to authorize.
url: https://treasury.md/mcptransport: streamable-http # stateless, JSON responsestools: allocation_check, transfer_check, loan_check, runway, liquidity_ladder, rate_math, build_settingsprompts: treasury # the skill, with your settingsGET with query parameters or POST a JSON body. CORS open. An OpenAPI document is at /openapi.json.
# Every tool: GET or POST https://treasury.md/api/v1/<tool>curl -s https://treasury.md/api/v1 | jq '.tools[].name'curl -s "https://treasury.md/api/v1/transfer_check?amount=30000&sent_today=5000&daily_cap_usd=50000&approval_usd=10000&multisig_usd=25000&kind=payment&counterparty_allowlisted=true&allowlist_only=only&new_venue=false" | jq .summarycurl -s "https://treasury.md/api/v1/settings" | jq '.presets[].id'claude mcp add --transport http treasury https://treasury.md/mcpExample code
Call it from your own code.
Working calls against the API. The full reference is at /api/v1 and /openapi.json.
Before an agent sends money: check the move over MCP, and stop unless it is within policy.
// Before an agent sends money: check the move over MCP, and stop unless it is within policy.const MCP = "https://treasury.md/mcp";async function call(name: string, args: Record<string, unknown>) { const res = await fetch(MCP, { method: "POST", headers: { "content-type": "application/json", accept: "application/json" }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/call", params: { name, arguments: args } }), }); const { result } = await res.json(); return result.structuredContent as { summary: string; outcome?: string };}// Your policy numbers, from your settings; the facts come from your own records.const check = await call("transfer_check", { amount: 30000, sent_today: 5000, daily_cap_usd: 50000, approval_usd: 10000, multisig_usd: 25000, counterparty_allowlisted: true, allowlist_only: "only",});console.log(check.summary);if (check.outcome !== "within_policy") { console.log("Stop: ask the person (and the other signers) before this move."); process.exit(1);}// Only now hand the move to your own signing setup. treasury.md never sends money.Check a treasury and one move with curl. No key; nothing is stored.
# Check a treasury and one move with curl. No key; nothing is stored.API=https://treasury.md/api/v1# Holdings against your limits: breaches, runway, buffers, what needs a yescurl -s $API/allocation_check -H 'content-type: application/json' -d '{ "positions": [ {"label":"Operating account","class":"bank_cash","issuer":"Bank A","venue":"Bank A","amount":250000,"liquidity_days":0}, {"label":"Payments wallet","class":"stablecoin","issuer":"Issuer C","venue":"Custodian D","network":"Network 1","amount":300000,"liquidity_days":1}, {"label":"Fund shares","class":"tokenized_fund","issuer":"Manager E","venue":"Custodian D","network":"Network 1","amount":200000,"liquidity_days":2} ], "monthly_burn": 60000, "min_runway_months": 12, "max_issuer_pct": 35, "max_venue_pct": 50}' | jq '{summary, status, breaches}'# One move against the daily cap, approval and signer thresholdscurl -s "$API/transfer_check?amount=30000&sent_today=5000&daily_cap_usd=50000&approval_usd=10000&multisig_usd=25000" | jq '{summary, outcome}'# Your settings link: the skill with your policy written incurl -s "https://treasury.md/treasury.md?preset=starting_point&min_runway_months=9&daily_cap_usd=20000" -D - -o SKILL.md | grep -i x-settingsFAQ
Does it move money or hold keys?
Does it recommend assets, issuers or yields?
Does a within-policy result mean my treasury is safe?
Does it lend, borrow or arrange credit?
Is it accounting or tax software?
Is this advice?
Does it name brands or show prices?
Can an agent set up its own settings?
build_settings tool. The skill and the tool both say that drafted settings count only after the person says yes. Nothing technical stops an agent from ignoring that, so read what it sends you.