{"openapi":"3.1.0","info":{"title":"Lahamu Agent Tools","description":"Five callable tools: orderbook calculations, a historical WhaleScope sample, on-demand crypto snapshots and trends, and macro reference data. HTTP/OpenAPI access; ACP execution is not connected. Only Orderbook Audit uses Base Sepolia test payments. No trade execution.","version":"0.3.1"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/service":{"get":{"summary":"Contract","operationId":"contract_v1_service_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/tools":{"get":{"tags":["Tool discovery"],"summary":"Discover the callable functions and their data/payment scope","operationId":"list_tools","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/source-notices/macro_context":{"get":{"tags":["Source notices"],"summary":"Read macro source notices without fetching market data","description":"© 2026 Federal Reserve Bank of New York. Content from the New York Fed subject to the Terms of Use at newyorkfed.org.\n\nThe SOFR and EFFR data is subject to the Terms of Use posted at newyorkfed.org. The New York Fed is not responsible for publication of the SOFR and EFFR data by Lahamu, does not sanction or endorse any particular republication, and has no liability for your use.\n\nLahamu is not affiliated with the New York Fed. The New York Fed does not sanction, endorse, or recommend any products or services offered by Lahamu.\n\nThe Secured Overnight Financing Rate (SOFR) Data and Broad General Collateral Rate (BGCR) Data are calculated using data provided under a license granted to the New York Fed by DTCC Solutions LLC (“Solutions”), an affiliate of The Depository Trust & Clearing Corporation. Solutions, its affiliates, and third parties from which they obtained data have no liability for the content of this material.\n\nNY Fed content remains available under the same permissions, conditions and restrictions in its Terms of Use; Lahamu adds no restrictions to that content.\n\nOriginal SOFR/EFFR observations are published by the New York Fed. Basis-point changes are calculated by Lahamu as (current rate minus previous rate) × 100; these changes are not calculations published by the New York Fed. Age/status screening is also performed by Lahamu.\n\n[Original source data](https://www.newyorkfed.org/markets/reference-rates) · [Source terms](https://www.newyorkfed.org/privacy/termsofuse.html)\n\nSource: ECB statistics. © European Central Bank, Frankfurt am Main, Germany.\n\nOriginal ECB observations are available free of charge from the ECB.\n\nKeep ECB attribution and reproduce observations accurately. Identify modifications. For sold material, display the free-source notice before payment and on each access. ECB links must open outside embedded frames.\n\nEUR/USD and observation dates are original ECB observations. USD/KRW is calculated by Lahamu as (KRW per EUR) / (USD per EUR) for the same observation date. USD/KRW percentage change is calculated by Lahamu against the previous observation. Age/status screening is also performed by Lahamu. These are reference rates, not executable FX quotes.\n\n[Original source data](https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml) · [Source terms](https://www.ecb.europa.eu/services/using-our-site/disclaimer/html/index.en.html)","operationId":"macro_notices_v1_source_notices_macro_context_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SourceNotice"},"type":"array","title":"Response Macro Notices V1 Source Notices Macro Context Get"}}}}}}},"/v1/whalescope-demo":{"get":{"tags":["Free historical demo"],"summary":"Read a free historical WhaleScope signal sample","description":"No wallet or payment. Fixed July 2026 records; collector_status=paused, sample_mode=historical, eligible_for_live_use=false. Evaluation time does not refresh source observations. Decimal values are strings. Inspect limitations and per-item timestamps before use.","operationId":"whalescope_sample","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/crypto/snapshot":{"get":{"tags":["Free on-demand context"],"summary":"Read an Upbit BTC or ETH market snapshot","description":"USDT quote asset. A bounded 5-second cache; inspect source fetch and observation timestamps. No wallet or payment. Errors are explicit; no historical fallback.","operationId":"crypto_snapshot","parameters":[{"name":"asset","in":"query","required":false,"schema":{"enum":["BTC","ETH"],"type":"string","default":"BTC","title":"Asset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextResponse_Union_Snapshot__Unavailable__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/crypto/trend":{"get":{"tags":["Free on-demand context"],"summary":"Calculate a 30- or 90-day trend from completed daily candles","description":"Upbit USDT market. Missing UTC days suppress metrics. 5-minute cache. Returns the exact interval and formulas, not a forecast.","operationId":"crypto_trend","parameters":[{"name":"asset","in":"query","required":false,"schema":{"enum":["BTC","ETH"],"type":"string","default":"BTC","title":"Asset"}},{"name":"days","in":"query","required":false,"schema":{"enum":["30","90"],"type":"string","default":"30","title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextResponse_Union_Trend__Unavailable__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/macro/context":{"get":{"tags":["Free on-demand context"],"summary":"Read US overnight reference rates and ECB reference FX","description":"SOFR and EFFR are not policy target rates. EUR/USD and derived USD/KRW are informational reference rates. Published_at remains null when unknown; dates and per-source failures are explicit. 30-minute cache.\n\n© 2026 Federal Reserve Bank of New York. Content from the New York Fed subject to the Terms of Use at newyorkfed.org.\n\nThe SOFR and EFFR data is subject to the Terms of Use posted at newyorkfed.org. The New York Fed is not responsible for publication of the SOFR and EFFR data by Lahamu, does not sanction or endorse any particular republication, and has no liability for your use.\n\nLahamu is not affiliated with the New York Fed. The New York Fed does not sanction, endorse, or recommend any products or services offered by Lahamu.\n\nThe Secured Overnight Financing Rate (SOFR) Data and Broad General Collateral Rate (BGCR) Data are calculated using data provided under a license granted to the New York Fed by DTCC Solutions LLC (“Solutions”), an affiliate of The Depository Trust & Clearing Corporation. Solutions, its affiliates, and third parties from which they obtained data have no liability for the content of this material.\n\nNY Fed content remains available under the same permissions, conditions and restrictions in its Terms of Use; Lahamu adds no restrictions to that content.\n\nOriginal SOFR/EFFR observations are published by the New York Fed. Basis-point changes are calculated by Lahamu as (current rate minus previous rate) × 100; these changes are not calculations published by the New York Fed. Age/status screening is also performed by Lahamu.\n\n[Original source data](https://www.newyorkfed.org/markets/reference-rates) · [Source terms](https://www.newyorkfed.org/privacy/termsofuse.html)\n\nSource: ECB statistics. © European Central Bank, Frankfurt am Main, Germany.\n\nOriginal ECB observations are available free of charge from the ECB.\n\nKeep ECB attribution and reproduce observations accurately. Identify modifications. For sold material, display the free-source notice before payment and on each access. ECB links must open outside embedded frames.\n\nEUR/USD and observation dates are original ECB observations. USD/KRW is calculated by Lahamu as (KRW per EUR) / (USD per EUR) for the same observation date. USD/KRW percentage change is calculated by Lahamu against the previous observation. Age/status screening is also performed by Lahamu. These are reference rates, not executable FX quotes.\n\n[Original source data](https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml) · [Source terms](https://www.ecb.europa.eu/services/using-our-site/disclaimer/html/index.en.html)","operationId":"macro_context","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextResponse_Macro_"}}}}}}},"/v1/orderbook-audit":{"post":{"tags":["Orderbook Audit"],"summary":"Report","operationId":"orderbook_audit","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Access":{"properties":{"price_usd":{"type":"string","const":"0","title":"Price Usd"},"payment_required":{"type":"boolean","const":false,"title":"Payment Required"}},"additionalProperties":false,"type":"object","required":["price_usd","payment_required"],"title":"Access"},"AuditRequest":{"properties":{"base":{"type":"string","pattern":"^[A-Z0-9]{2,12}$","title":"Base"},"quote":{"type":"string","pattern":"^[A-Z0-9]{2,12}$","title":"Quote"},"snapshot_at":{"type":"string","format":"date-time","title":"Snapshot At"},"side":{"type":"string","enum":["buy","sell"],"title":"Side"},"amount_base":{"anyOf":[{"type":"number","maximum":1e+18,"exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,18}|(?=[\\d.]{1,37}0*$)\\d{0,18}\\.\\d{0,18}0*$)"}],"title":"Amount Base"},"taker_fee_bps":{"anyOf":[{"type":"number","maximum":1000.0,"minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,4}|(?=[\\d.]{1,23}0*$)\\d{0,4}\\.\\d{0,18}0*$)"}],"title":"Taker Fee Bps"},"max_age_ms":{"type":"integer","maximum":3600000.0,"minimum":1.0,"title":"Max Age Ms","default":10000},"bids":{"items":{"$ref":"#/components/schemas/Level"},"type":"array","maxItems":200,"minItems":1,"title":"Bids"},"asks":{"items":{"$ref":"#/components/schemas/Level"},"type":"array","maxItems":200,"minItems":1,"title":"Asks"}},"additionalProperties":false,"type":"object","required":["base","quote","snapshot_at","side","amount_base","taker_fee_bps","bids","asks"],"title":"AuditRequest"},"ContextResponse_Macro_":{"properties":{"schema_version":{"type":"string","const":"1","title":"Schema Version"},"kind":{"type":"string","enum":["crypto_snapshot","crypto_trend","macro_context"],"title":"Kind"},"evaluated_at":{"type":"string","format":"date-time","title":"Evaluated At"},"access":{"$ref":"#/components/schemas/Access"},"data":{"$ref":"#/components/schemas/Macro"},"notices":{"items":{"$ref":"#/components/schemas/SourceNotice"},"type":"array","title":"Notices","description":"Source attribution, required notices and original/derived field ownership. Preserve on redistribution."}},"additionalProperties":false,"type":"object","required":["schema_version","kind","evaluated_at","access","data"],"title":"ContextResponse[Macro]"},"ContextResponse_Union_Snapshot__Unavailable__":{"properties":{"schema_version":{"type":"string","const":"1","title":"Schema Version"},"kind":{"type":"string","enum":["crypto_snapshot","crypto_trend","macro_context"],"title":"Kind"},"evaluated_at":{"type":"string","format":"date-time","title":"Evaluated At"},"access":{"$ref":"#/components/schemas/Access"},"data":{"anyOf":[{"$ref":"#/components/schemas/Snapshot"},{"$ref":"#/components/schemas/Unavailable"}],"title":"Data"},"notices":{"items":{"$ref":"#/components/schemas/SourceNotice"},"type":"array","title":"Notices","description":"Source attribution, required notices and original/derived field ownership. Preserve on redistribution."}},"additionalProperties":false,"type":"object","required":["schema_version","kind","evaluated_at","access","data"],"title":"ContextResponse[Union[Snapshot, Unavailable]]"},"ContextResponse_Union_Trend__Unavailable__":{"properties":{"schema_version":{"type":"string","const":"1","title":"Schema Version"},"kind":{"type":"string","enum":["crypto_snapshot","crypto_trend","macro_context"],"title":"Kind"},"evaluated_at":{"type":"string","format":"date-time","title":"Evaluated At"},"access":{"$ref":"#/components/schemas/Access"},"data":{"anyOf":[{"$ref":"#/components/schemas/Trend"},{"$ref":"#/components/schemas/Unavailable"}],"title":"Data"},"notices":{"items":{"$ref":"#/components/schemas/SourceNotice"},"type":"array","title":"Notices","description":"Source attribution, required notices and original/derived field ownership. Preserve on redistribution."}},"additionalProperties":false,"type":"object","required":["schema_version","kind","evaluated_at","access","data"],"title":"ContextResponse[Union[Trend, Unavailable]]"},"Fx":{"properties":{"source_url":{"type":"string","title":"Source Url"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"},"cache_hit":{"type":"boolean","title":"Cache Hit"},"cache_age_seconds":{"type":"number","title":"Cache Age Seconds"},"observation_date":{"type":"string","format":"date","title":"Observation Date"},"published_at":{"type":"null","title":"Published At"},"status":{"type":"string","enum":["stale","recent_observation"],"title":"Status"},"calendar_age_days":{"type":"integer","title":"Calendar Age Days"},"eur_usd":{"type":"string","title":"Eur Usd"},"usd_krw":{"type":"string","title":"Usd Krw"},"usd_krw_change_pct":{"type":"string","title":"Usd Krw Change Pct"},"previous_observation_date":{"type":"string","format":"date","title":"Previous Observation Date"},"units":{"$ref":"#/components/schemas/FxUnits"},"cross_rate_formula":{"type":"string","title":"Cross Rate Formula"},"limitations":{"items":{"type":"string"},"type":"array","title":"Limitations"}},"additionalProperties":false,"type":"object","required":["source_url","fetched_at","cache_hit","cache_age_seconds","observation_date","published_at","status","calendar_age_days","eur_usd","usd_krw","usd_krw_change_pct","previous_observation_date","units","cross_rate_formula","limitations"],"title":"Fx"},"FxUnits":{"properties":{"eur_usd":{"type":"string","const":"USD per EUR","title":"Eur Usd"},"usd_krw":{"type":"string","const":"KRW per USD","title":"Usd Krw"}},"additionalProperties":false,"type":"object","required":["eur_usd","usd_krw"],"title":"FxUnits"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Level":{"properties":{"price":{"anyOf":[{"type":"number","maximum":1e+18,"exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,18}|(?=[\\d.]{1,37}0*$)\\d{0,18}\\.\\d{0,18}0*$)"}],"title":"Price"},"size":{"anyOf":[{"type":"number","maximum":1e+18,"exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*(?:\\d{0,18}|(?=[\\d.]{1,37}0*$)\\d{0,18}\\.\\d{0,18}0*$)"}],"title":"Size"}},"additionalProperties":false,"type":"object","required":["price","size"],"title":"Level"},"Macro":{"properties":{"status":{"type":"string","enum":["ok","partial","unavailable"],"title":"Status"},"sofr":{"anyOf":[{"$ref":"#/components/schemas/Rate"},{"$ref":"#/components/schemas/Unavailable"}],"title":"Sofr"},"effr":{"anyOf":[{"$ref":"#/components/schemas/Rate"},{"$ref":"#/components/schemas/Unavailable"}],"title":"Effr"},"fx":{"anyOf":[{"$ref":"#/components/schemas/Fx"},{"$ref":"#/components/schemas/Unavailable"}],"title":"Fx"},"limitations":{"items":{"type":"string"},"type":"array","title":"Limitations"}},"additionalProperties":false,"type":"object","required":["status","sofr","effr","fx","limitations"],"title":"Macro"},"Rate":{"properties":{"source_url":{"type":"string","title":"Source Url"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"},"cache_hit":{"type":"boolean","title":"Cache Hit"},"cache_age_seconds":{"type":"number","title":"Cache Age Seconds"},"indicator":{"type":"string","enum":["SOFR","EFFR"],"title":"Indicator"},"observation_date":{"type":"string","format":"date","title":"Observation Date"},"published_at":{"type":"null","title":"Published At"},"value":{"type":"string","title":"Value"},"unit":{"type":"string","const":"percent_per_annum","title":"Unit"},"previous_observation_date":{"type":"string","format":"date","title":"Previous Observation Date"},"change_basis_points":{"type":"string","title":"Change Basis Points"},"calendar_age_days":{"type":"integer","title":"Calendar Age Days"},"status":{"type":"string","enum":["stale","recent_observation"],"title":"Status"},"definition":{"type":"string","title":"Definition"},"limitations":{"items":{"type":"string"},"type":"array","title":"Limitations"}},"additionalProperties":false,"type":"object","required":["source_url","fetched_at","cache_hit","cache_age_seconds","indicator","observation_date","published_at","value","unit","previous_observation_date","change_basis_points","calendar_age_days","status","definition","limitations"],"title":"Rate"},"Snapshot":{"properties":{"market":{"type":"string","title":"Market"},"venue":{"type":"string","const":"Upbit","title":"Venue"},"quote_currency":{"type":"string","const":"USDT","title":"Quote Currency"},"status":{"type":"string","enum":["ok","degraded"],"title":"Status"},"observed_at":{"type":"string","format":"date-time","title":"Observed At"},"ticker_observed_at":{"type":"string","format":"date-time","title":"Ticker Observed At"},"last_trade_at":{"type":"string","format":"date-time","title":"Last Trade At"},"book_freshness":{"type":"string","enum":["fresh","stale","future"],"title":"Book Freshness"},"ticker_freshness":{"type":"string","enum":["fresh","stale","future"],"title":"Ticker Freshness"},"best_bid":{"type":"string","title":"Best Bid"},"best_ask":{"type":"string","title":"Best Ask"},"spread_bps":{"type":"string","title":"Spread Bps"},"reported_depth_levels_per_side":{"type":"integer","title":"Reported Depth Levels Per Side"},"reported_bid_notional":{"type":"string","title":"Reported Bid Notional"},"reported_ask_notional":{"type":"string","title":"Reported Ask Notional"},"reported_depth_imbalance":{"type":"string","title":"Reported Depth Imbalance"},"last_trade_price":{"type":"string","title":"Last Trade Price"},"change_since_previous_daily_close_pct":{"type":"string","title":"Change Since Previous Daily Close Pct"},"rolling_24h_volume_base":{"type":"string","title":"Rolling 24H Volume Base"},"limitations":{"items":{"type":"string"},"type":"array","title":"Limitations"},"sources":{"items":{"$ref":"#/components/schemas/Source"},"type":"array","title":"Sources"}},"additionalProperties":false,"type":"object","required":["market","venue","quote_currency","status","observed_at","ticker_observed_at","last_trade_at","book_freshness","ticker_freshness","best_bid","best_ask","spread_bps","reported_depth_levels_per_side","reported_bid_notional","reported_ask_notional","reported_depth_imbalance","last_trade_price","change_since_previous_daily_close_pct","rolling_24h_volume_base","limitations","sources"],"title":"Snapshot"},"Source":{"properties":{"source_url":{"type":"string","title":"Source Url"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"},"cache_hit":{"type":"boolean","title":"Cache Hit"},"cache_age_seconds":{"type":"number","title":"Cache Age Seconds"}},"additionalProperties":false,"type":"object","required":["source_url","fetched_at","cache_hit","cache_age_seconds"],"title":"Source"},"SourceNotice":{"properties":{"provider":{"type":"string","title":"Provider"},"attribution":{"type":"string","title":"Attribution"},"terms_url":{"type":"string","title":"Terms Url"},"original_data_url":{"type":"string","title":"Original Data Url"},"notices":{"items":{"type":"string"},"type":"array","title":"Notices"},"reuse_conditions":{"type":"string","title":"Reuse Conditions"},"original_fields":{"items":{"type":"string"},"type":"array","title":"Original Fields"},"derived_fields":{"items":{"type":"string"},"type":"array","title":"Derived Fields"},"calculation_notice":{"type":"string","title":"Calculation Notice"}},"additionalProperties":false,"type":"object","required":["provider","attribution","terms_url","original_data_url","notices","reuse_conditions","original_fields","derived_fields","calculation_notice"],"title":"SourceNotice"},"Trend":{"properties":{"source_url":{"type":"string","title":"Source Url"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"},"cache_hit":{"type":"boolean","title":"Cache Hit"},"cache_age_seconds":{"type":"number","title":"Cache Age Seconds"},"market":{"type":"string","title":"Market"},"venue":{"type":"string","const":"Upbit","title":"Venue"},"quote_currency":{"type":"string","const":"USDT","title":"Quote Currency"},"window_start":{"type":"string","format":"date-time","title":"Window Start"},"window_end_exclusive":{"type":"string","format":"date-time","title":"Window End Exclusive"},"requested_days":{"type":"integer","enum":[30,90],"title":"Requested Days"},"completed_candles":{"type":"integer","title":"Completed Candles"},"missing_dates":{"items":{"type":"string","format":"date"},"type":"array","title":"Missing Dates"},"status":{"type":"string","enum":["ok","insufficient_data"],"title":"Status"},"metrics":{"anyOf":[{"$ref":"#/components/schemas/TrendMetrics"},{"type":"null"}]},"limitations":{"items":{"type":"string"},"type":"array","title":"Limitations"}},"additionalProperties":false,"type":"object","required":["source_url","fetched_at","cache_hit","cache_age_seconds","market","venue","quote_currency","window_start","window_end_exclusive","requested_days","completed_candles","missing_dates","status","metrics","limitations"],"title":"Trend"},"TrendMetrics":{"properties":{"window_open_to_close_return_pct":{"type":"string","title":"Window Open To Close Return Pct"},"daily_close_max_drawdown_pct":{"type":"string","title":"Daily Close Max Drawdown Pct"},"annualized_daily_log_volatility_pct":{"type":"number","title":"Annualized Daily Log Volatility Pct"},"sma_7_close":{"type":"string","title":"Sma 7 Close"},"sma_30_close":{"type":"string","title":"Sma 30 Close"},"volume_base":{"type":"string","title":"Volume Base"},"volatility_method":{"type":"string","title":"Volatility Method"}},"additionalProperties":false,"type":"object","required":["window_open_to_close_return_pct","daily_close_max_drawdown_pct","annualized_daily_log_volatility_pct","sma_7_close","sma_30_close","volume_base","volatility_method"],"title":"TrendMetrics"},"Unavailable":{"properties":{"status":{"type":"string","const":"unavailable","title":"Status"},"error":{"type":"string","title":"Error"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"}},"additionalProperties":false,"type":"object","required":["status","error"],"title":"Unavailable"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}