{"uid":"cap_gTLcQc_wxXG3uCzbjBnDJ","slug":"treasury-risk-analyzer-pay-review-do-not-pay-decision-engine-be068cc3","name":"Treasury Risk Analyzer — PAY/REVIEW/DO_NOT_PAY Decision Engine","description":"Treasury Risk Analyzer — Can we safely execute this payment today? Combines liquidity, FX exposure and treasury risk into a PAY/REVIEW/DO_NOT_PAY decision with confidence.","url":"https://portfolio-risk-analyzer-g9ao.onrender.com/treasury-decision?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"payment":{"type":"object","required":["amount","currency"],"properties":{"date":{"type":"string","format":"date"},"amount":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string"},"description":{"type":"string","maxLength":200}}},"liquidity":{"type":"object","required":["openingCash","horizonDays","minimumCashBuffer"],"properties":{"cashFlows":{"type":"array","items":{"type":"object","required":["date","amount"],"properties":{"date":{"type":"string","format":"date"},"amount":{"type":"number"},"category":{"type":"string","maxLength":50},"description":{"type":"string","maxLength":200}}}},"startDate":{"type":"string","format":"date"},"horizonDays":{"type":"integer","maximum":3650,"minimum":1},"openingCash":{"type":"number"},"workingCapital":{"type":"object","required":["accountsReceivable","accountsPayable","periodCreditSales","periodCOGS","periodDays"],"properties":{"inventory":{"type":"number","minimum":0},"periodCOGS":{"type":"number","minimum":0},"periodDays":{"type":"number","maximum":3650,"exclusiveMinimum":0},"accountsPayable":{"type":"number","minimum":0},"periodCreditSales":{"type":"number","minimum":0},"accountsReceivable":{"type":"number","minimum":0}}},"minimumCashBuffer":{"type":"number","minimum":0}}},"fxExposure":{"type":"object","properties":{"fxRates":{"type":"object","additionalProperties":{"type":"number"}},"positions":{"type":"array","items":{"type":"object","required":["currency","type","amount"],"properties":{"type":{"enum":["receivable","payable","cash"],"type":"string"},"amount":{"type":"number","minimum":0},"hedged":{"type":"boolean","default":false},"currency":{"type":"string"}}}},"stressShockPct":{"type":"number","default":0.1},"totalTreasuryValueBase":{"type":"number"}}},"baseCurrency":{"type":"string","default":"USD"},"treasuryRisk":{"type":"object","required":["returns","weights"],"properties":{"returns":{"type":"object","additionalProperties":{"type":"array","items":{"type":"number"}}},"weights":{"type":"object","additionalProperties":{"type":"number"}},"baseCurrency":{"type":"string","default":"USD"},"riskFreeRate":{"type":"number","default":0},"periodsPerYear":{"type":"number","default":252},"sectorExposure":{"type":"object","additionalProperties":{"type":"number"}},"stressScenarios":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"shocks":{"type":"object","additionalProperties":{"type":"number"}}}}},"benchmarkReturns":{"type":"array","items":{"type":"number"}},"confidenceLevels":{"type":"array","items":{"type":"number"},"default":[0.95,0.99]},"currencyExposure":{"type":"object","additionalProperties":{"type":"number"}},"geographyExposure":{"type":"object","additionalProperties":{"type":"number"}},"minimumAcceptableReturn":{"type":"number","default":0}}}}},"responseSchema":{"type":"json","example":{"status":"success","payment":{"date":"2026-09-14","amount":750000,"currency":"EUR","amount_base_currency":810000},"decision":"PAY","warnings":["[fx_exposure] No existing FX positions were supplied — fx_exposure severity reflects only this pa..."],"timestamp":"2026-11-05T06:08:41.991Z","components":{"liquidity":{"status":"HEALTHY","shortfall":0,"minimum_date":"2026-09-14","required_buffer":1000000,"minimum_cash_position":4190000},"fx_exposure":{"score":2,"context":"payment_only","risk_level":"LOW","currency_concentration_hhi":null,"net_exposure_payment_currency":-810000},"treasury_risk":{"evaluated":false}},"confidence":0.83,"analysis_id":"e066f2bb-a166-424e-95b4-44922de036cb","base_currency":"USD"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"2","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$2/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"2","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"2","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_QmRW3NNSnKIqsPmbni88c","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"2","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Combines liquidity forecasting, FX exposure, and treasury risk metrics into a single PAY/REVIEW/DO_NOT_PAY decision with confidence score for a proposed payment.","exampleAgentPrompt":"Before we wire $250,000 USD to our supplier tomorrow, can you run a full treasury risk check — we have $1.2M opening cash, a minimum buffer of $400k, 90-day horizon, some EUR and GBP payables, and I need a PAY, REVIEW, or DO_NOT_PAY decision with confidence?","exampleUseCases":[{"title":"Pre-approval check for large vendor payment","prompt":"We're about to pay a $750,000 invoice to our logistics partner on Friday — our opening cash is $2M, minimum buffer is $600k, and we have scheduled inflows of $300k next week. We also hold some EUR payables. Should we PAY, REVIEW, or DO_NOT_PAY, and how confident are you?"},{"title":"FX-stressed cross-currency payment decision","prompt":"We need to send £180,000 GBP to a UK supplier today. Our base currency is USD, we have $900k cash, a $250k minimum buffer, and significant EUR receivables hedged at 50%. Can you check whether it's safe to execute this given our FX exposure and give me a confidence-scored decision?"},{"title":"Automated daily treasury payment gate","prompt":"Run a treasury decision on today's planned $50,000 payroll wire — opening cash is $500k, minimum buffer $150k, 30-day horizon with the following projected cash flows: +$80k receivable in 5 days, -$30k rent in 10 days. Tell me PAY, REVIEW, or DO_NOT_PAY with your confidence level."}],"resultDescription":"Returns a structured decision object containing one of three verdicts — PAY, REVIEW, or DO_NOT_PAY — along with a confidence score and supporting breakdown across liquidity (daily cash projection, buffer headroom), FX exposure (gross/net by currency, stress scenario impact), and treasury risk (volatility, Sharpe/Sortino ratios, VaR), explaining why the payment is or is not advisable.","failureModes":["Missing required payment amount or currency returns a 400 validation error","Missing liquidity fields (openingCash, horizonDays, minimumCashBuffer) causes request rejection","Invalid date formats in cashFlows or payment.date return schema validation errors","FX positions referencing currencies not present in fxRates may produce incomplete exposure analysis","Insufficient historical returns data for treasury risk computation may degrade confidence score","Service cold-start latency on Render free tier may cause timeout on first call"],"whenToPreferThis":"Use this endpoint when you need a single authoritative go/no-go verdict on a payment that integrates all three treasury risk dimensions simultaneously — liquidity, FX, and portfolio risk — rather than consulting each in isolation. Prefer this over the individual sibling endpoints (liquidity-only, FX-only, treasury-only) when the payment decision requires a holistic confidence score and you want a machine-readable PAY/REVIEW/DO_NOT_PAY output suitable for automation or audit trails.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-30T12:31:55.491Z","isFirstParty":false,"canonicalSlug":"treasury-risk-analyzer-pay-review-do-not-pay-decision-engine-be068cc3"}