Surflux Documentation

website·Indexed 32 days ago

https://surflux.dev/docs

High-performance developer infrastructure for Sui, featuring Flux Streams for real-time on-chain activity, NFT and Deepbook indexing APIs, and authenticated access to Sui's gRPC API for low-latency data retrieval.

Tokens
59.7K
Snippets
282
Records
371
Agent score
60%

What's inside Surflux

  1. Overview of Surflux Infrastructure for Sui

    Surflux is a developer-first infrastructure platform for the Sui blockchain designed to replace raw RPCs and complex off-chain data plumbing. It provides tools for building DeFi protocols, NFT experiences, Real-World Asset (RWA) solutions, and real-time applications by offering high-performance indexing and event streaming.
  2. Overview of Deepbook Flux Streams

    Deepbook Flux Streams provide real-time, sub-second latency push notifications for trade executions and order book updates from DeepBook (Sui's decentralized Central Limit Order Book). Unlike the Deepbook Indexing API which provides historical snapshots, Flux Streams use Server-Sent Events (SSE) to push live on-chain events without polling. Events typically have a 1-2 second latency from on-chain finalization.
  3. Overview of Surflux Deepbook Indexing API

    The Deepbook Indexing API provides read access to DeepBook, a decentralized Central Limit Order Book (CLOB) on the Sui blockchain. It allows developers to query pool metadata, order book state, historical trades, and OHLCV candlestick data without maintaining their own indexing infrastructure. It is primarily used for building trading interfaces, analytics dashboards, market-making bots, and charting tools.
  4. Overview of DeepBook Margin Indexing API

    The Surflux DeepBook Margin Indexing API provides read access to DeepBook Margin, a fully on-chain margin trading system on Sui. It allows developers to query margin pools, margin managers, active loans, supply positions, and liquidations without running their own indexing infrastructure. It is primarily used for building leveraged trading interfaces, lending dashboards, liquidation bots, and risk monitoring tools.
  5. Overview of Surflux NFT Indexing API

    The Surflux NFT Indexing API provides queryable access to NFT data on the Sui blockchain, eliminating the need for custom indexing infrastructure. It supports all NFT types, including standard NFTs (Display standard), Kiosk-held NFTs, custom NFT types, and cross-package NFTs. The indexer tracks ownership changes, Kiosk listings/transfers, decoded metadata, and collection associations.
  6. Overview of DeepBook Margin Flux Streams

    DeepBook Margin Flux Streams provide real-time, sub-second latency push notifications for margin trading events on Sui using Server-Sent Events (SSE). Unlike the Indexing API which provides historical snapshots, Flux Streams push live events as they occur, eliminating the need for polling.
  7. Overview of Surflux Indexed APIs for Sui

    The Surflux API provides indexed, queryable access to Sui blockchain data, eliminating the need for developers to run their own indexers or parse raw RPC responses. It offers high-performance REST endpoints that return structured data in milliseconds, handling blockchain synchronization and network upgrades automatically.
  8. Overview of Surflux Flux Streams

    Flux Streams provide real-time blockchain events from the Sui network directly to applications via Server-Sent Events (SSE). It eliminates the need for constant RPC polling or custom indexers, delivering events typically within 1-2 seconds of on-chain finalization. Events are delivered in checkpoint order to ensure correct sequencing of state changes.
  9. Understand the Margin Manager response schema

    The API returns a paginated response. Each margin manager object contains details about the manager, its associated loans, and deposits.

    Pagination Fields:

    • items: Array of margin manager objects
    • isLastPage: Boolean indicating if this is the final page
    • currentPage: Current page number
    • perPage: Items per page

    Margin Manager Fields:

    • margin_manager_id: Unique ID
    • balance_manager_id: Associated balance manager ID
    • owner: Owner wallet address
    • deepbook_pool_id: DeepBook trading pool ID
    • checkpoint / checkpoint_timestamp_ms / onchain_timestamp: Timing and synchronization data
    • digest: Transaction digest
    • created_at: ISO timestamp
    • active_loans: Array of active loan objects
    • deposit: Deposit information object or null
  10. Compare Sui JSON-RPC and gRPC API features

    The Sui gRPC API provides several architectural improvements over the JSON-RPC API, moving from a text-based HTTP/1.1 protocol to a binary HTTP/2 protocol using Protocol Buffers (Protobuf). Key improvements include strong compile-time type safety, lower latency, smaller payloads, native HTTP/2 streaming, and the introduction of Field Masks for granular data selection.
  11. Retrieve a single supply referral by ID

    Use the GET /deepbook-margin/supply-referrals/{supplyReferralId} endpoint to retrieve detailed information about a specific supply referral. This is useful for verifying referral eligibility for fee claims or tracking specific referral relationships.
    GET /deepbook-margin/supply-referrals/0x789abc123def456789abc123def456789abc123def456789abc123def456789a
  12. Understand Surflux rate limit mechanics

    Surflux enforces rate limits per API key using a sliding window algorithm. When the requests per second (RPS) cap is exceeded, the API returns an HTTP 429 (Too Many Requests) response. Note that rate limits (frequency) are distinct from credits (total usage volume); both must be sufficient for the API to function. Retries count toward the rate limit, so implementing exponential backoff is recommended.