Overview
Integration model for the Diffusal API and on-chain writes
The Diffusal integration surface combines the public REST/auth API with dedicated realtime stream delivery for market data, account updates, authenticated trading helpers, RFQ auctions, and live streaming.
Canonical settlement still lands on protocol contracts, while the backend fans out across nine Encore services: api, indexer, keeper, market-maker, notifications, operator, realtime, rfq, and simulator.
Integration Model
Your App
├─ Reads: REST via the API service, WebSocket via the realtime service
├─ RFQ: Timed quote auctions via /api/rfq/*
├─ Managed trading: /api/mm/*, /api/portfolio/*, /api/strategies/*
└─ Writes: Wallet-signed on-chain transactionsBackend Service Roles
api— public REST edge, auth, API keys, and typed endpoint surfacerfq— timed quote auctions, quote validation, and signed quote deliveryrealtime— public/private websocket delivery, live RFQ relays, and stream snapshotsindexer— derived market/account state and canonical event-backed query dataoperator— relay and order-book execution helpers behind portfolio/operator flowskeeper— automated price, volatility, liquidation, settlement, and MM-health jobsmarket-maker— internal quote-generation and RFQ participation servicenotifications— internal alerting and operational notification deliverysimulator— internal persona-driven trading simulation support
Read Operations (API)
- Markets, order book, trades, ticker, oracle views
- Account portfolios, positions, collateral, fees
- RFQ auction requests and signed quote delivery
- Authenticated MM orders, quotes, portfolio helpers, and strategy prep/place flows
- Leaderboard and rolling window rankings
- Helper endpoints for IDs, ticks, and symbol translation
Write Operations (On-Chain)
| Operation | Primary Contract | Function |
|---|---|---|
| Deposit collateral | DiffusalCollateralVault | depositToPortfolio() |
| Withdraw collateral | DiffusalCollateralVault | withdrawFromPortfolio() |
| Place signed order | DiffusalOptionsOrderBook | placeOrderWithSignature() |
| Place lazy-series sign | DiffusalOptionsOrderBook | placeOrderWithSeriesParamsWithSignature() |
| Cancel signed order | DiffusalOptionsOrderBook | cancelOrderWithSignature() |
| Fill RFQ quote | DiffusalOptionsRFQ | fillRfqQuoteInPortfolio() |
| Create portfolio | DiffusalPortfolioManager | createPortfolio() |
| Transfer collateral | DiffusalCollateralVault | transferCollateralBetweenPortfolios() |
For authenticated API-managed order flows, use the managed order placement reference, which returns either mode: "typed_data" for wallet signing or mode: "relay" for relay-ready submission.
API Surface
| Category | Base Path |
|---|---|
| Health | /api/health |
| Auth | /api/auth/* |
| Markets | /api/markets/* |
| Platform | /api/platform/* |
| Leaderboard | /api/leaderboard/* |
| Account | /api/account/* |
| Helpers | /api/helpers/* |
| API Keys | /api/keys* |
| RFQ | /api/rfq/* |
| Managed MM | /api/mm/* |
| Portfolio | /api/portfolio/* |
| Strategies | /api/strategies/* |
| Points | /api/points/* |
| Referrals | /api/referral/* |
| User | /api/user/* |
| Webhooks | /api/webhooks/* |
For endpoint schemas and latest payloads, use the OpenAPI spec exposed by the API server. Public realtime streams are documented separately on the WebSocket page.