WebSocket Integration
WebSocket Integration is the alternative to the HTTPS Integration. In general, the overall flow remains the same, but Instead of native pulling the order book data from your server, websocket allows you to stream order book data to us.
Server Url & Authentication
Native WebSocket URL is hosted on https://newapi.native.org/v1/pmm/ws .
In order for Native to authenticate all the requests coming, you need to pass the api_key
in the headers. You can get api_key
by requesting from the Native team because we need to manually whitelist the API key that has access to the websocket URL.
Note: You are required to connect to our websoket via ws library, NOT socket.IO library. For further example, you can visit the Market Maker Ws Client demo in our github
WebSocket Message Types
To fully integrate and enjoy Native's full capabilities, you are required to implement and handle the following messge types:
Orderbook: For Native to estimate the price for different order sizes (optional)
Firm-Quote: For Native to obtain price from you given the requested token and amount
Sign-Quote: For you to validate and sign the order to be executed on-chain
Last updated