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


---

# Agent Instructions: 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://uniocean.gitbook.io/uniocean-docs/api-integration.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.
