Diffusal

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 transactions

Backend Service Roles

  • api — public REST edge, auth, API keys, and typed endpoint surface
  • rfq — timed quote auctions, quote validation, and signed quote delivery
  • realtime — public/private websocket delivery, live RFQ relays, and stream snapshots
  • indexer — derived market/account state and canonical event-backed query data
  • operator — relay and order-book execution helpers behind portfolio/operator flows
  • keeper — automated price, volatility, liquidation, settlement, and MM-health jobs
  • market-maker — internal quote-generation and RFQ participation service
  • notifications — internal alerting and operational notification delivery
  • simulator — 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)

OperationPrimary ContractFunction
Deposit collateralDiffusalCollateralVaultdepositToPortfolio()
Withdraw collateralDiffusalCollateralVaultwithdrawFromPortfolio()
Place signed orderDiffusalOptionsOrderBookplaceOrderWithSignature()
Place lazy-series signDiffusalOptionsOrderBookplaceOrderWithSeriesParamsWithSignature()
Cancel signed orderDiffusalOptionsOrderBookcancelOrderWithSignature()
Fill RFQ quoteDiffusalOptionsRFQfillRfqQuoteInPortfolio()
Create portfolioDiffusalPortfolioManagercreatePortfolio()
Transfer collateralDiffusalCollateralVaulttransferCollateralBetweenPortfolios()

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

CategoryBase 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.

Next Steps

On this page