Guide
DCA (Dollar Cost Averaging) API Integration Documentation
Overview
The OpenOcean Socket Data Push service provides real-time event streaming via Socket.IO over WebSocket transport.
This service allows clients to subscribe to user-specific data streams using a wallet address. Once subscribed, the server pushes live updates automatically.
This document explains how to connect, subscribe, handle events, and implement best practices for production usage.
API Base Information
Base Endpoint
Terminal
TXT
1 https://open-api.openocean.finance/socket
Custom Path
The service uses a custom Socket.IO path. Make sure the path option is configured correctly.
Terminal
TXT
1 /v1/socket
Transport Protocol
Only WebSocket transport is recommended:
Terminal
JS
1 transports: ['websocket']
Example (Node.js)
Terminal
JS
1 const ioClient = require('socket.io-client'); 2
3 const socket = ioClient('https://open-api.openocean.finance/socket', { 4 path: '/v1/socket', 5 transports: ['websocket'], 6 reconnection: true, 7 }); 8
9 socket.on('connect', () => { 10 console.log('connect!'); 11 socket.emit('subscribe', { 12 address: '0x677883Ea48511bD266D09bEFefc0A925E5e1C01F' 13 }); 14 }); 15
16 socket.on('data', (msg) => { 17 console.log('received:', msg); 18 }); 19
20 socket.on('connect_error', (err) => { 21 console.error('connect_error', err); 22 }); 23
24 socket.on('disconnect', (reason) => { 25 console.log('disconnect:', reason); 26 });
Socket Event Data
- To receive real-time updates, emit a
subscribeevent with your wallet address - All real-time messages are delivered via the
dataevent - event_type: dca_filled, limitorder_filled
Example Data Payload:
Terminal
{}
1 { 2 "event_type": "dca_filled", 3 "data": { 4 "chainId": 56, 5 "makerAsset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", 6 "takerAsset": "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2", 7 "makerAmount": "20000000", 8 "makerAddress": "0x...", 9 "txHash": "0x...", 10 "orderHash": "0x..." 11 } 12 }
Support
For technical support or questions about the API:
- Check the OpenOcean Documentation
- Contact the development team
- Review error logs and API responses