lisekarimi/prism

๐Ÿ’น AI-powered swap trading monitoring system using CrewAI multi-agent framework

โ˜… 1Forks 0PythonGitHub โ†—Compare

Project website โ†—

agentic-aicrewaillms

README

title PRISM
emoji ๐Ÿ’น
colorFrom purple
colorTo blue
sdk docker
app_port 7860
pinned false
short_description PRISM - Position Risk Intelligence & Swap Monitor

๐Ÿ’น PRISM - Position Risk Intelligence & Swap Monitor

AI-powered swap trading monitoring system using CrewAI multi-agent framework.

๐ŸŒ Live Demo: prism.lisekarimi.com

PRISM Dashboard

๐Ÿ“Š What It Does

PRISM monitors USD SOFR swap trading positions in real-time and automatically generates trading signals when profit/loss thresholds are hit.

Note: This demo is specifically configured for USD SOFR (Secured Overnight Financing Rate) swaps only.

๐Ÿ—๏ธ Architecture

PRISM Workflow

5 AI Agents working together:

  1. Market Data Agent - Fetches current USD SOFR swap rates (2Y, 5Y, 10Y, 30Y)
  2. Position Manager Agent - Loads trader's swap positions from database
  3. Risk Manager Agent - Analyzes market conditions and sets dynamic profit/loss thresholds
  4. Risk Calculator Agent - Calculates P&L for each position
  5. Trading Decision Agent - Generates CLOSE/HOLD signals based on thresholds

Thresholds:

  • Close position when profit โ‰ฅ $50K
  • Close position when loss โ‰ค -$25K
  • Otherwise HOLD

๐Ÿ› ๏ธ Tech Stack

  • CrewAI - Multi-agent orchestration
  • PostgreSQL - Position & rate storage (Neon)
  • Gradio - Web dashboard
  • Python 3.11 - Runtime

๐Ÿš€ Deploy on Hugging Face Spaces

This app is built to run as a Docker Space on Hugging Face.

1. Fork & create a Space

  • Fork this repo on GitHub
  • Create a new Space on huggingface.co/spaces with Docker as the SDK
  • Link it to your forked GitHub repo

2. Set Space secrets

In your Space settings โ†’ Variables and Secrets, add:

Secret Description
DATABASE_URL PostgreSQL connection string (e.g. from Neon)
OPENAI_API_KEY OpenAI API key for the LLM agents
SERPER_API_KEY Serper API key for Google Search (serper.dev)

3. Deploy

Push to your linked branch โ€” HF Spaces will build and deploy automatically.

๐Ÿ“‹ Local Development

Prerequisites:

Setup:

git clone https://github.com/lisekarimi/prism.git
cd prism
cp .env.example .env  # fill in your credentials
make dev

๐Ÿ—„๏ธ Database Schema

  • swap_positions - Trader's swap portfolio
  • market_rates - Historical rate data
  • trade_signals - AI-generated trading decisions

Contributors

lisekarimi

Issues