> For the complete documentation index, see [llms.txt](https://docs.uniocean.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uniocean.io/protocol-and-infrastructure/protocol/api-integration.md).

# API & Integration

## Unified Command Line Interface (CLI)

The primary entry point for operators and developers is the `unioceand` daemon.

* **Transaction and Query Parity:** Users utilize `unioceand query` for read-only state access and `unioceand tx` for signed transaction submission.
* **Module-Specific Commands:** The Exchange module exposes a granular command set for Spot, Derivative, and Binary Options trading, including complex risk-parameter queries and conditional order management.
* **Operational Tooling:** The ecosystem includes specialized utilities such as the **Price Feeder**, a standalone service designed for Oracle relayers to manage off-chain data ingestion and configuration efficiently.

## Structured gRPC and REST Services

* **High-Performance gRPC:** Native Protobuf RPC endpoints provide the lowest latency for algorithmic trading bots and real-time indexing services.
* **HTTP REST Gateway:** Utilizing `gRPC-Gateway`, Uniocean automatically derives RESTful endpoints from Protobuf annotations (e.g., `GET /exchange/v1/spot_markets`).
* **Documentation and Discovery:** The application supports an integrated Swagger UI, typically mounted at `/swagger/`, allowing developers to interactively discover and test API endpoints.

## Event-Driven Indexing System

State transitions within the `BeginBlocker`, `EndBlocker`, and message handlers emit two forms of signals:

* **Typed Protobuf Events:** Structured, strongly-typed payloads (e.g., `EventBatchSpotExecution`) providing deep execution details including matched quantities, clearing prices, and fee accounting.
* **Lifecycle Signals:** Specific events are emitted for market creations, status updates, and risk alerts (such as liquidation triggers or open-interest invariant breaches).

## Conclusion

The Uniocean architecture represents a complete, chain-native trading ecosystem. By embedding complex financial logic — such as deterministic order matching, automated liquidation management, and decentralized oracle resolution — directly into the Cosmos SDK state machine, Uniocean achieves a rare combination of high-frequency performance and absolute transparency.

The modular design ensures that the platform is not limited to a single asset class, but can scale to support sophisticated financial instruments including Spot, Perpetual Swaps, Expiry Futures, and Binary Options. With its deep integration of the EVM, CosmWasm, and IBC, Uniocean remains fully interoperable with the broader decentralized economy, providing a robust foundation for the next generation of institutional-grade decentralized finance.
