-
Notifications
You must be signed in to change notification settings - Fork 0
api
Daksh Kaul edited this page Sep 8, 2026
·
2 revisions
src/catfish/agents/api.py defines MootAPI, imports MootRunner, FinanceAgent, and Portfolio, binds HTTP routes on a FastAPI app, and serves that app with uvicorn.
-
self.last_by_moot[moot_id] = payloadon successfulPOST /v1/moot/run. -
POST /v1/trades/liveandPOST /v1/trades/completemutate portfolio JSON and broker memory throughFinanceAgent.
| Method | Path | Handler |
|---|---|---|
| GET | /health |
health |
| POST | /v1/moot/run |
run_moot |
| GET | /v1/moot/last |
last_moot |
| GET | /v1/trades |
trades |
| POST | /v1/trades/live |
confirm_live |
| POST | /v1/trades/complete |
complete_live |
| GET | /v1/memory |
memory |
| GET | /v1/portfolio |
portfolio |
- Inputs: optional config query; trade JSON body.
- Steps: Builds portfolio/agent for that moot; calls
confirm_live; returns event payload. - Returns:
dict.
- Inputs: optional config query; body with
position_idand/ortrade. - Steps: Calls
complete_live; returns closed position and portfolio snapshot. - Returns:
dict.