{"id":37144344,"url":"https://github.com/fox-one/ocean.one","last_synced_at":"2026-01-14T16:56:59.594Z","repository":{"id":57487802,"uuid":"138694279","full_name":"fox-one/ocean.one","owner":"fox-one","description":"Ocean ONE is a decentralized exchange built on Mixin Network ","archived":false,"fork":true,"pushed_at":"2019-01-03T08:18:39.000Z","size":10953,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T01:56:48.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ocean.one","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"MixinNetwork/ocean.one","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fox-one.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-26T06:29:09.000Z","updated_at":"2024-06-20T01:56:48.225Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fox-one/ocean.one","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fox-one/ocean.one","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-one%2Focean.one","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-one%2Focean.one/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-one%2Focean.one/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-one%2Focean.one/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fox-one","download_url":"https://codeload.github.com/fox-one/ocean.one/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fox-one%2Focean.one/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28427159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T16:56:58.997Z","updated_at":"2026-01-14T16:56:59.586Z","avatar_url":"https://github.com/fox-one.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ocean ONE\n\nOcean ONE is a decentralized exchange built on Mixin Network, it's almost the first time that a decentralized exchange gain the same user experience as a centralized one.\n\nOcean ONE accepts all assets in Mixin Network as base currencies, and the only supported quote currencies are Mixin XIN (c94ac88f-4671-3976-b60a-09064f1811e8), Bitcoin BTC (c6d0c728-2624-429b-8e0d-d9d19b6592fa) and Omni USDT (815b0b1a-2764-3736-8faa-42d694fa620a).\n\nAll order and trade data are encoded in the Mixin snapshots' memo field, the memo is base64 encoded [MessagePack](https://github.com/msgpack).\n\n\n## Create Order\n\nTo sell 0.7 XIN with price 0.1 BTC/XIN, send a 0.7 XIN transfer to Ocean ONE with base64 encoded MessagePack data as the memo.\n\n```golang\ntype OrderAction struct {\n  S string    // side\n  A uuid.UUID // asset\n  P string    // price\n  T string    // type\n  O uuid.UUID // order\n}\n\nmemo = base64.StdEncoding.EncodeToString(msgpack(OrderAction{\n  T: \"L\",\n  P: \"0.1\",\n  S: \"A\",\n  A: uuid.FromString(\"c6d0c728-2624-429b-8e0d-d9d19b6592fa\"),\n}))\n```\n\nTo buy some XIN with price 0.1 BTC/XIN, send the desired amount of BTC transfer to Ocean ONE with base64 encoded MessagePack data as the memo.\n\n```golang\nmemo = base64.StdEncoding.EncodeToString(msgpack(OrderAction{\n  T: \"L\",\n  P: \"0.1\",\n  S: \"B\",\n  A: uuid.FromString(\"c94ac88f-4671-3976-b60a-09064f1811e8\"),\n}))\n```\n\nIt's recommended to set the `trace_id` field whenever you send a transfer to Ocean ONE, the `trace_id` will be used as the order id.\n\n\n## Cancel Order\n\nSend any amount of any asset to Ocean ONE with base64 encoded MessagePack data as the memo.\n\n```golang\nmemo = base64.StdEncoding.EncodeToString(msgpack(OrderAction{\n  O: uuid.FromString(\"2497b2bb-4d67-49bf-b2bc-211b0543d7ac\"),\n}))\n```\n\n\n## Bid Order Behavior\n\nA bid order, despite a limit bid order or market bid order, will transfer some quote funds to the matching engine. Ocean ONE engine will match all the funds, this is a typical behavior for market order. However for a limit bid order, user may expect the order done whenever the desired bid size filled, in this situation, Ocean ONE engine still matches all the funds which may result in a larger order size filled.\n\n\n## Events\n\nThe order book and all matches are always available in the Mixin Network snapshots, and Ocean ONE offers a WebSocket layer to provide a convenient query interface.\n\nThe WebSocket endipoint is `wss://events.ocean.one`, and all messages sent and received should be gziped. The event message is in a standard format.\n\n```json\n{\n  \"id\": \"a3fb2c7d-88ed-4605-977c-ebbb3f32ad71\",\n  \"action\": \"EMIT_EVENT\",\n  \"params\": {},\n  \"data\": {},\n  \"error\": \"description\"\n}\n```\n\nThe `params` field is for the client sent message. The `data` or `error` is for the server message, and only one of them will be present in the message. If the message is the server response of a message from the client, the `id` and `action` fields will be identical to the sent one.\n\nWhenever a client connects to the events server, it must send a `SUBSCRIBE_BOOK` message to the server, otherwise the client won't receive any events messages.\n\n```json\n{\n  \"id\": \"a3fb2c7d-88ed-4605-977c-ebbb3f32ad71\",\n  \"action\": \"SUBSCRIBE_BOOK\",\n  \"params\": {\n    \"market\": \"c94ac88f-4671-3976-b60a-09064f1811e8-c6d0c728-2624-429b-8e0d-d9d19b6592fa\"\n  }\n}\n```\n\nThis will subscibe the client to all the events of the specific `market` in the `params`. To unsubscribe, send a similar message but with the action `UNSUBSCRIBE_BOOK`. A client can always subscribe to many markets with many different `SUBSCRIBE_BOOK` messages.\n\n\n#### BOOK-T0\n\nThis is the first event whenever a client subscribe to a specific market, the event contains the full order book of the market.\n\n```json\n{\n  \"id\": \"a3fb2c7d-88ed-4605-977c-ebbb3f32ad71\",\n  \"action\": \"EMIT_EVENT\",\n  \"data\": {\n    \"market\": \"c94ac88f-4671-3976-b60a-09064f1811e8-c6d0c728-2624-429b-8e0d-d9d19b6592fa\",\n    \"sequence\": 1531142594,\n    \"event\": \"BOOK-T0\",\n    \"data\": {\n      \"asks\": [],\n      \"bids\": []\n    }\n  }\n}\n```\n\n\n#### ORDER-OPEN\n\nThe order is now open on the order book. This message will only be sent for orders which are not fully filled immediately. `amount` will indicate how much of the order is unfilled and going on the book.\n\n\n#### ORDER-MATCH\n\nA trade occurred between two orders. The taker order is the one executing immediately after being received and the maker order is a resting order on the book. The `side` field indicates the maker order side. If the side is `ask` this indicates the maker was a sell order and the match is considered an up-tick. A `bid` side match is a down-tick.\n\n\n#### ORDER-CANCEL\n\nThe order is cancelled and no longer on the order book, `amount` indicates how much of the order went unfilled.\n\n\n## List Orders\n\nList orders of the authenticated user. The authentication is ECDSA JWT based, and the user needs to register a ECDSA public key to Ocean ONE with base64 encoded MessagePack data as the memo.\n\n```golang\nmemo = base64.StdEncoding.EncodeToString(msgpack(OrderAction{\n  U: RAW BYTES OF THE ECDSA PUBLIC KEY,\n}))\n```\n\nTo authenticate, create the JWT payload with user id as `uid` and sign it with the ECDSA private key. Then pass the token as a HTTP Bearer Authorization header.\n\nMake a HTTP `GET` request to `https://events.ocean.one/orders` to retrieve orders, and the available query params are `market`, `state`, `limit` and `offset`.\n\n\n## Market Data\n\nThe market data API is an unauthenticated set of endpoints for retrieving market data. These endpoints provide snapshots of market data.\n\n\n#### Ticker\n\nSnapshot information about the last trade (tick), best bid/ask.\n\n```\nGET https://events.ocean.one/markets/:id/ticker\n\n{\n  \"trade_id\": \"bf1bf64b-9ba6-4961-9ca8-38ea8358b9f3\"\n  \"amount\": \"0.001\",\n  \"price\": \"0.2\",\n  \"ask\": \"0.2\",\n  \"bid\": \"0.1\",\n  \"sequence\": 1531305918,\n  \"timestamp\": \"2018-07-12T05:51:30.757002284Z\",\n}\n```\n\n\n#### Order Book\n\nGet the full list of open orders for a market, the list is not udpated in real time, for the most up-to-date data, consider using the websocket stream.\n\n```\nGET https://events.ocean.one/markets/:id/book\n\n{\n  \"market\": \"c94ac88f-4671-3976-b60a-09064f1811e8-c6d0c728-2624-429b-8e0d-d9d19b6592fa\",\n  \"event\": \"BOOK-T0\",\n  \"sequence\": 1531305926,\n  \"data\": {\n    \"asks\": [\n      {\n        \"amount\": \"0.999\",\n        \"funds\": \"0.1998\",\n        \"price\": \"0.2\",\n        \"side\": \"ASK\"\n      }\n    ],\n    \"bids\": [\n      {\n        \"amount\": \"0.52\",\n        \"funds\": \"0.052\",\n        \"price\": \"0.1\",\n        \"side\": \"BID\"\n      }\n    ]\n  },\n  \"timestamp\": \"2018-07-12T05:55:44.757025182Z\"\n}\n```\n\n\n#### Trades\n\nList the trades history for a market. Available query params are `market`, `state`, `limit` and `offset`.\n\n\n```\nGET https://events.ocean.one/markets/:id/trades\n\n[\n  {\n    \"amount\": \"0.001\",\n    \"base\": \"c94ac88f-4671-3976-b60a-09064f1811e8\",\n    \"created_at\": \"2018-07-11T08:02:44.094160294Z\",\n    \"price\": \"0.2\",\n    \"quote\": \"c6d0c728-2624-429b-8e0d-d9d19b6592fa\",\n    \"side\": \"ASK\",\n    \"trade_id\": \"bf1bf64b-9ba6-4961-9ca8-38ea8358b9f3\"\n  }\n]\n```\n\n\n## Fee\n\n- Taker: 0.1%\n- Maker: 0.0%\n\n\n## References\n\n- Coinbase Pro API https://docs.pro.coinbase.com/\n\n\n## Join the Team\n\nPlease contact Mixin 25566\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffox-one%2Focean.one","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffox-one%2Focean.one","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffox-one%2Focean.one/lists"}