REST API
This page summarizes the current REST surface exposed by the Gateway service.
Status
The Gateway is the HTTP entry point for the backend stack. It validates X-API-Key headers and proxies requests to internal services.
Current write routes support the invite-only closed beta and route through the Broadcast service for registered users. Read routes are broader and include health, market, and account queries.
Base Environments
The current OpenAPI spec lists these environments:
| Environment | Base URL |
|---|---|
| Local | http://localhost:8080 |
| Development | https://dev.ollo.finance |
| Production | https://ollo.finance |
Availability depends on environment and access policy.
Authentication
Most protected routes require:
X-API-Key: your-key
Main Endpoint Groups
Health
GET /healthGET /health/{service}
Accounts
POST /v1/accounts/createGET /v1/accounts/{id}POST /v1/accounts/{id}/depositPOST /v1/accounts/{id}/withdraw
Orders
POST /v1/accounts/{account_id}/tradeGET /v1/accounts/{account_id}/ordersPOST /v1/accounts/{account_id}/orders/cancel
Markets
GET /v1/marketsGET /v1/markets/{market_id}/orderbookGET /v1/markets/{market_id}/funding
Liquidation
GET /v1/liquidation/accounts/{id}/healthGET /v1/liquidation/market/{market_id}GET /v1/liquidation/account/{account_id}GET /v1/liquidation/position/{position_id}POST /v1/liquidation/account/{account_id}/liquidatePOST /v1/liquidation/position/{position_id}/liquidate
Request-Format Notes
The current Gateway route definitions use large integer fields as strings. For order placement:
market_idis abytes32hex stringcollateralis a large integer stringsideuses0 = LONG,1 = SHORTorder_typeuses0 = MARKET,1 = LIMITlimit_priceis only relevant for limit orders
Example: Create An Account
curl -X POST \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"owner":"0x..."}' \
https://dev.ollo.finance/v1/accounts/create
Example: List Markets
curl https://dev.ollo.finance/v1/markets
Example: Place A Trade
curl -X POST \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"market_id":"0x...",
"collateral":"1000000000",
"side":0,
"leverage":5,
"order_type":0,
"limit_price":"0"
}' \
https://dev.ollo.finance/v1/accounts/1/trade
Source Of Truth
The Gateway OpenAPI file and route definitions are authoritative for the current route shape:
services/gateway/openapi.yamlservices/gateway/src/routes/*