Built for OKX hackathon
Forma is an Agent Service Provider (ASP) built for the OKX AI Marketplace. It transforms raw ideas, startup concepts, or unorganized founder notes into executive-ready business deliverables in seconds.
Instead of spending days designing pitch decks, drafting investment memos, or writing complex spreadsheet formulas, Web3 founders and developers can prompt Forma to instantly generate polished, production-ready files—including PowerPoint decks (.pptx), PDF investment memos (.pdf), and formula-driven Excel financial models (.xlsx).
Forma implements the OKX Onchain OS 3-service registration model, monetization via the x402 Payment Protocol in X Layer USDT.
| Service | Endpoint | Fee (x402) | Deliverable | Design & Value Specification |
|---|---|---|---|---|
| Investor Pitch Deck | POST /api/deck/generate |
1.00 USDT | .pptx PowerPoint |
Premium Designed Output: Dark-mode Web3 master slide template, vector graphics, multi-column layouts, and McKinsey/a16z-style structured content. |
| Tokenomics Model | POST /api/deck/financials |
0.10 USDT | .xlsx Excel |
Active Formulas & Calculations: Dynamically formatted spreadsheet with active Excel formulas (=SUM, =IF) modeling vesting cliffs, token distribution, and cap tables. |
| Executive One-Pager | POST /api/deck/onepager |
0.05 USDT | .pdf Document |
Vector Document Layout: Clean, single-page investment memo with strict typography (Helvetica/Inter), section dividers, and institutional formatting. |
Forma enforces a strict Separation of Concerns between AI content generation and visual file rendering:
┌─────────────────┐ 1. Prompt ┌────────────────────────┐ 2. Generate JSON ┌────────────────────────┐
│ OKX Client / │ ────────────────────► │ Forma Express Backend │ ───────────────────────────► │ DeepSeek AI Engine │
│ User Agent │ ◄──────────────────── │ (@okxweb3/x402-express)│ ◄─────────────────────────── │ (deepseek-chat) │
└─────────────────┘ 5. Deliver └───────────┬────────────┘ 3. JSON Blueprint └────────────────────────┘
Binary File │
(base64 stream) ▼
┌────────────────────────┐
│ File Rendering Engines │
│ pptxgenjs / pdfkit │
│ exceljs │
└────────────────────────┘
4. Apply Design Rules &
Active Formulas
- AI Intelligence Layer (
src/services/ai.ts): DeepSeek generates strict JSON blueprints (slide content, sections, vesting rules, layout hints) with built-in retry mechanisms and high-density prompts. - File Rendering Layer (
src/services/*Engine.ts): Hardcoded TypeScript design templates (pptxgenjs,pdfkit,exceljs) convert the JSON blueprints into native, beautiful binary files. The code controls the design, the AI controls the content. - x402 Payment Layer (
@okxweb3/x402-express): Official OKX Web3 Payment SDK for seamless EIP-3009 challenge generation, automatic pricing resolution, and on-chain payment settlement.
- Runtime & Language: Node.js, Express, TypeScript (ES2020)
- AI Model: DeepSeek API (
deepseek-chat) via OpenAI Node SDK - Payment Verification: Official OKX Onchain OS Payment SDK (
@okxweb3/x402-express,@okxweb3/x402-core) - File Engines:
pptxgenjs— Native PowerPoint presentation builderpdfkit— Vector PDF document generatorexceljs— Spreadsheet engine with formula calculation support
- Node.js v18+
- DeepSeek API Key
Clone the repository and install dependencies:
git clone https://github.com/Cryptojigi/forma.git
cd forma
npm installCreate a .env file in the root directory:
PORT=3002
DEEPSEEK_API_KEY=your_deepseek_api_key_here
# OKX API Credentials
OKX_API_KEY=your_okx_api_key
OKX_SECRET_KEY=your_okx_secret_key
OKX_PASSPHRASE=your_okx_passphrase
# Wallet Config
RECEIVING_WALLET_ADDRESS=your_wallet_addressnpm run devThe server will start at http://localhost:3002.
Forma endpoints return HTTP 402 Payment Required challenges per the OKX x402 specification. For testing purposes, you must provide valid EIP-3009 signatures.
curl -X POST http://localhost:3002/api/deck/generate \
-H "Content-Type: application/json" \
-d '{"prompt": "A decentralized lending protocol on X Layer with automated liquidation vaults"}'curl -X POST http://localhost:3002/api/deck/onepager \
-H "Content-Type: application/json" \
-d '{"prompt": "An AI-powered automated yield aggregator on X Layer"}'curl -X POST http://localhost:3002/api/deck/financials \
-H "Content-Type: application/json" \
-d '{"prompt": "Tokenomics for FORMA token with 1,000,000,000 total supply"}'Log in and register Forma as an Agent on the OKX Marketplace:
onchainos login
onchainos agent create --role asp --name "Forma" --description "Autonomous Executive Pitch Deck, PDF Memo & Tokenomics Sheet Generator"Register the 3 services:
Pitch Deck:POST https://your-domain.com/api/deck/generate(1.00 USDT)Tokenomics Sheet:POST https://your-domain.com/api/deck/financials(0.10 USDT)Executive Memo:POST https://your-domain.com/api/deck/onepager(0.05 USDT)
To ensure Forma stays Online on the OKX marketplace 24/7, deploy @okxweb3/a2a-node to a cloud server:
npm install -g @okxweb3/a2a-node@latest
okx-a2a doctor --fixMIT License. Built for OKX hackathon.