ordervantage-sdk
v1.0.0
Published
React hooks and components for building order book applications on top of Kraken API.
Maintainers
Readme
OrderVantage
OrderVantage is a collection of React hooks and components designed for building order book applications on top of the Kraken API. It empowers developers to create real time trading interfaces, historical replay tools, and intelligent market analysis features with ease.
This SDK is the core library powering ordervantage.xyz, a live reference implementation built during the Kraken Forge Hackathon.
Features
- real time Order Book Streaming: Efficiently manage high frequency updates via Socket.IO.
- Time Travel: Replay historical market data to analyze past events.
- Order Book Intelligence: AI powered assistant for market impact simulations and liquidity analysis.
- Liquidity Analytics: Visualize depth and spread in real time.
Installation
npm install ordervantage
# or
yarn add ordervantageUsage
[!IMPORTANT] Backend Requirement: This SDK requires a compatible backend API and WebSocket server to function. For full API specifications and Socket.IO event schemas, please refer to the Backend Documentation.
You can also explore the source code of the reference implementation at ordervantage.xyz to see these components in action.
1. OrderVantageAssistant
An intelligent UI component that allows users to interact with market data through natural language or guided actions (Simulations, Liquidity Check, Whale Analysis).
import { OrderVantageAssistant } from "ordervantage";
function App() {
return (
<div className="app-container">
<OrderVantageAssistant apiUrl="https://your-backend-api.com" />
</div>
);
}2. useOrderBook
Hook to stream real time order book data for a specific pair.
import { useOrderBook } from "ordervantage";
const { bids, asks } = useOrderBook({
url: "https://your-socket-server.com",
symbol: "BTC/USD",
fps: 10, // Frames per second for updates
});3. useTimeTravel
Hook to replay historical order book states.
import { useTimeTravel } from "ordervantage";
const {
playFromStart,
togglePlayPause,
currentTime,
orderbook
} = useTimeTravel({
socketUrl: "https://your-socket-server.com",
initialSymbol: "BTC/USD",
});API Reference
useOrderBook
- url: WebSocket server URL.
- symbol: Trading pair (e.g., "BTC/USD").
- fps: Update frequency limit.
useTimeTravel
- socketUrl: WebSocket server URL.
- initialSymbol: Default symbol to load.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Naoufal Brahmi
Built for the Kraken Forge Hackathon.
