hackquest logo

Sentrix

AI-powered DeFi position monitor for Injective. Detects liquidation risks in real time, explains them in plain English, and alerts you via Telegram or Discord before you get wiped.

视频

项目图片 1
项目图片 2
项目图片 3
项目图片 4

技术栈

Python

描述

Every DeFi trader on Injective faces the same silent threat: positions deteriorate while you sleep, travel, or live your life. Unlike centralized exchanges with push notifications, on-chain DeFi has no native alerting.

Sentrix is a headless AI agent that continuously monitors your Injective derivative positions and delivers natural-language risk alerts via Telegram or Discord — before liquidation hits.

How it works:

1. Polls live on-chain position data every 30s via injective-py (official gRPC SDK)

2. Calculates margin ratio, distance to liquidation, and balance exposure in real time

3. When risk thresholds are crossed, GPT-4o-mini or Gemini Flash generates a specific action plan

4. Delivers the alert to Telegram, Discord, or terminal instantly

Example alert: "⚠️ Your INJ/USDT perp is 12% from liquidation. Add $2,100 margin to reach safety, or reduce position by 40%."

Injective SDK Integration (5 methods):

- IndexerGrpcDerivativeApi — perpetual position tracking + liquidation price

- ChainGrpcBankApi — on-chain native balance queries

- IndexerGrpcAccountApi — subaccount portfolio monitoring

- IndexerGrpcSpotApi — spot balance checks for margin coverage

- IndexerGrpcOracleApi — real-time price feeds

Key properties:

- Strictly read-only: no private keys, no transaction signing, zero custody risk

- Demo mode (--demo flag): judges can test instantly without a funded wallet

- 100% test coverage across 14 test suite files

- pip install sentrix

本次黑客松进展

Built entirely from scratch during the sprint:

  • Injective SDK integration: async gRPC client wrapping 5 IndexerGrpc/ChainGrpc APIs with demo mock mode

  • Risk Detector: deterministic rule engine evaluating margin ratio, liquidation proximity, and balance drops

  • LLM Client: dual-provider (OpenAI GPT-4o-mini + Google Gemini Flash) with template fallback for reliability

  • Alert Delivery: Telegram bot + Discord webhook with formatted messages and severity classification

  • CLI: Click + Rich terminal interface with sentrix watch, sentrix status, sentrix history commands

  • Storage: SQLite via aiosqlite for persistent alert history

  • Testing: 109 tests across 14 files, 100% coverage, GitHub Actions CI + CodeQL security scanning

  • Performance: p50 risk detection = 0.01ms, full cycle p50 = 0.08ms (measured via scripts/bench.py)

  • Deployment: Railway-ready with railway.json config and full DEPLOYMENT.md guide

融资状态

Not raising. This is an open-source tool submitted as a solo hackathon project.

队长
EEdy Cu
项目链接
部署生态
InjectiveInjective
赛道
DeFiAI