LCF Protocol

A platform to invest your assets and forget about them, until they get DOUBLED!

LCF Protocol

Created At

ETHGlobal New Delhi

Project Description

Elevator pitch

LCF Protocol autonomously manages user capital by executing adaptive TWAP limit orders through the 1inch Limit Order Protocol, validates market truth with Pyth price feeds (pull via Pull Oracle + on‑chain updates), and stores all executions as a Knowledge Graph for audit, analytics and composable integrations. The result is a fully integrated investment orchestration stack: reliable price oracle signals, MEV-aware limit-order execution, and a graph-native analytics layer for performance reporting and composability.

What problem it solves

Retail and institutional users lack a turnkey, auditable way to execute large executions with minimized market impact, while guaranteeing verifiable pricing and rich post-trade analytics. LCF solves this by combining oracle-grade price truth (Pyth), secure decentralized order execution (1inch Limit Order Protocol), and structured, queryable trade data (Knowledge Graph) so funds can be invested automatically, safely, and transparently.

Core capabilities

  • Adaptive TWAP orchestration: -- Multi-order TWAP scheduler with execution windows, adaptive order sizing, interval shaping, and MEV-aware safeguards. -- Creates typed Limit Orders with MakerTraits (expiration, partial fills), signs with EIP‑712-compatible signing, computes making/taking amounts and submits via 1inch Limit Order SDK. -- Runtime order monitoring, partial-fill handling, expiration/cancellation and retry/backoff flows.

-Oracle integration (Pyth) --Pull-mode integration to Pull Oracle for low-latency price fetches and canonical on‑chain update flows. --Price validation used to gate executions and to detect oracle anomalies; repo includes Pyth price receiver contract and local pyth tooling (pyth/).

-Knowledge Graph analytics (The Graph / GRC-style schema) --Executions, strategies, sessions, and users modeled as entities+relations following a graph-first schema (files under schema.ts and mapping.ts). --Trade and backtest outputs exported as structured JSON (src/backtest-reports and frontend/public/backtest-reports) ready for indexing and composable queries.

-Backtester and reporting --Multi-asset, multi-timeframe backtester (7/14/30/90/180d) that simulates slippage, gas dynamics, MEV events and produces detailed trade logs, APY and risk metrics (reports in src/backtest-reports and frontend/public/backtest-reports).

-Operability --CLI-first orchestration (node src/twap-bot.js) and light Python backend endpoints (backend/main.py) for strategy lifecycle management. --Command-line and scripted flows meet 1inch qualification (no UI required).

Demo / how to run (ready-to-run)

-Prereqs: Node 18+, Python 3.10+, .env values: PRIVATE_KEY, RPC_URL, ONEINCH_API_KEY, CHAIN_ID -Start backend API: python main.py -Run orchestrator & TWAP flow: npm install && node twap-bot.js (CLI accepts config for pair, totalAmount, numberOfOrders, intervalMinutes, executionWindow, slippageTolerance) -View analytics: open src/backtest-reports/ or frontend/public/backtest-reports/ (JSON reports and summarized metrics ready for indexing)

Delivered artifacts in repository

-Execution/Orchestration: src/twap-bot.js, src/types.js, deploy.js -Oracle tooling: pyth/ (docker-compose, price-config.yaml, PythPriceReceiver.sol) -Backtester & reports: TWAP_BACKTESTER_README.md, src/twap-backtester.js, src/backtest-reports/.json, frontend/public/backtest-reports/.json -Knowledge Graph artifacts: ethglobal/app/schema.ts, ethglobal/app/mapping.ts, app/page.tsx (explore-public-knowledge) -Lightweight API: main.py

Security, risk & governance controls

-MEV detection and reaction logic: strategy reduces order size or delays execution when probabilistic MEV events are detected. -Price sanity checks: Pyth feed validation before submission; fallbacks and alerting on oracle divergence. -Partial-fill and expiration safety: MakerTraits configured for partial fills with expirations; orchestrator cancels/renews when safe. -Developer notes: strategy includes configurable limits (min/max order size, maxExecutionTime, slippage thresholds) and pre-execution validations (balance, allowance).

How it's Made

Technical summary (implementation highlights)

-Execution: twap-bot.js — UltraRealisticTWAPStrategy class -Builds and signs typed 1inch Limit Orders, submits via Api.submitOrder, monitors order status via Limit Order API. -Adaptive sizing, slippage modeling, MEV detection hooks, and realistic gas/slippage simulation are implemented. -Oracle: pyth/ and pyth-provider.js -Pull Oracle integration, price-config, Python and Solidity helper contract for receiving/updating feeds. -Analytics & Graph: ethglobal/app/schema.ts, ethglobal/app/mapping.ts, and JSON outputs -Graph-ready schema and mapping + backtest reports in src/backtest-reports and frontend/public/backtest-reports. -Backtesting: src/twap-backtester.js, TWAP_BACKTESTER_README.md -Multi-asset backtests that output net returns, trade logs, drawdown and APY metrics across standard windows. Example reports are already present in repo.

Why this aligns with sponsors

-1inch New functionality built on top of Limit Order Protocol: an adaptive TWAP orchestration layer that constructs, signs and submits typed limit orders, supports partial fills, expiration policies and a submission/monitoring CLI. Uses the 1inch Limit Order SDK (LimitOrder, MakerTraits, submitOrder) and includes robust error/validation handling and proper commit history. -Pyth Integrates Pyth pull via Pull Oracle and includes a path for updatePriceFeeds on-chain (contract in pyth/PythPriceReceiver.sol). Price feeds are consumed to gate execution decisions and to power analytics; pyth/ contains config and tooling to run local price pushing/pulling. -The Graph Trade and session data modeled as entity-relations, exportable for indexing with the Knowledge Graph Framework. Data outputs follow a structured format (trade, strategy, session entities) to enable GRC-20-like composability and cross-dataset linking for investor/DAO analytics.

background image mobile

Join the mailing list

Get the latest news and updates