> For the complete documentation index, see [llms.txt](https://docs.flashback.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flashback.tech/flashgate-platform/isp-market/orchestrator.md).

# Orchestrator

## Architecture Diagram

```mermaid
flowchart LR
    subgraph I[Inputs]
        D[Demand - Requests]
        P[Policies - Quotas and Budgets]
        S[SLAs/QoS Targets]
        T[Telemetry - Latency Cost Capacity]
    end

    subgraph DE[Decision Engine]
        N[Normalization]
        SC[Scoring & Provider Selection]
        PL[Placement / Allocation]
        MP[Migration Planner]
    end

    subgraph EX[Execution]
        PA[Provider Adapters]
        PR[Provisioning / Allocation]
        RU[Routing & Configuration Updates]
    end

    subgraph O[Outputs]
        AR[Allocation Result]
        AL[Audit Log]
        ME[Metrics Events]
    end

    D --> N
    P --> N
    S --> N
    T --> N
    N --> SC --> PL --> MP
    MP --> PA --> PR --> RU
    PR --> AR
    RU --> AL
    PR --> ME
    T --> ME
```

***

The architecture below represents the core logic integrated into smart contracts, acting as an on-chain and trustless orchestrator for the decentralized network of Consumers and Providers. The **Orchestrator** is a smart contract. It is the backbone of the ecosystem, ensuring transparency, compliance, and fair financial transactions through tokenomics. It is critical in maintaining trust and reliability between providers and consumers.

The orchestrator will be deployed on other blockchains and other promising ecosystems. This multi-chain approach allows providers and clients to select the ecosystem they prefer and to optimize their costs and performances by balancing with the networks' load.

Here is the current integration status:

* Stellar (testnet),
* Suite API integrations for Data Unit-compatible access flows (rolling deployment).

***

## **Management of Payments**

The smart contract is the best decentralized technology to support payments and other escrow-like services. In ISP Market operations, smart contracts are used for payment management, traceability, and compliance. It manages the financial and operational aspects of the ecosystem, including:

* **Escrow**: Holds payments securely until conditions in the Service Level Agreements (SLAs) are fulfilled. SLAs must properly specify the conditions of payments, and the Flashgate platform allows for the best agreements.
* **Pricing**: Determines the cost of services, ensuring fairness and market-driven adjustments. Providers must dynamically adapt their pricing according to their resources and services. The integration of AI-driven pricing mechanisms is recommended, and Flashgate will propose some of them.
* **Slashing:** Penalizes data providers or consumers who violate SLAs or fail to meet quality standards. This mechanism is essential to guaranteeing a healthy ecosystem. Meanwhile, the Flashgate platform will be a possible provider intermediary to solve disputes.

***

## **More About Data Units**

Data units represent the storage resources (e.g., storage servers or systems) or compute resources (in future releases) managed by the data providers. Like the sectors in Filecoin, the providers will commit their available spaces with the QoS specifications attached to every data unit. Data units are tracked and managed via reservations, ensuring efficient allocation and availability. There are 4 different states for a data unit:

* **Reserved**: Data sector allocated but not yet in use. It allows the providers to allocate and support the best quality of services. The providers may still decide on the allocation for a user, and then, have the freedom of doing the best business.
* **In Use**: This state means it is actively storing data for consumers.
* **Maintenance**: Undergoing updates or repairs of the data unit which is fundamental to ensure a good quality of services.
* **Decommissioning**: Being removed from the active pool of resources. This state is mainly because the smart contract is memorizing all the data units and then, the decommissioning is needed to not use the data unit again.

***

## **Interactions**

1. **Providers ↔ SLAs ↔ Orchestrator**:
   * Providers register their resources and agree to SLAs enforced by the orchestrator.
   * QoS metrics are monitored to ensure compliance and penalties (slashing) are applied for breaches.
2. **Consumers ↔ Scoring ↔ Orchestrator**:
   * Consumers use the scoring system to select reliable providers.
   * Payments are handled via the payment module (escrow ensures funds are secure until SLAs are fulfilled).
3. **Orchestrator ↔ Data Units**:
   * The orchestrator tracks and manages data units through their lifecycle (reserved, in use, maintenance, decommissioning).
   * Ensures optimal resource utilization and availability for consumers.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flashback.tech/flashgate-platform/isp-market/orchestrator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
