SMXT – SiMple eXchange Trading
A JavaScript library for cryptocurrency trading.
We aim to easily link multiple exchanges with one strategy code.
Exchange currently supported
CEX
- Binance Futures
- Bitget Futures
- Bybit Futures (Unified, cross, one-way mode)
- Okx Futures
- Gate.io Futures
DEX
Install
JavaScript (NPM)
smxt in NPM
npm install smxt
var smxt = require('smxt')
console.log(smxt)
Documentation
market data
- initSymbolInfo()
- getSymbolList()
- getPrice(symbol)
- getOrderBook(symbol, limit)
- getKline(symbol, timeframe, limit)
wallet data
- getSymbolBalance(symbol)
- getTotalEquity()
trade function
- getPosition(symbol)
- getAllPositions()
- postOrder(symbol, orderType, side, amount, price, reduceOnly, orderTag)
- cancelOrder(symbol, orderId)
- cancelAllOrders(symbol)
- getPendingOrders(symbol)
- getAllPendingOrders()
- getTradeHistory(symbol, limit)
- getPositionHistory(symbol, limit)
- setLeverage(symbol, leverage)
For Detail
-> Manual
Usage
initialize
var smxt = require('smxt')
let binance = new smxt.Binance(
apiKey = "YOUR_API_KEY",
apiSecret = "YOUR_API_SECERT"
)
let bitget = new smxt.Bitget(
apiKey = "YOUR_API_KEY",
apiSecret = "YOUR_API_SECERT",
passphrase = "YOUR_PASSPHRASE"
)
let bybit = new smxt.Bybit(
apiKey = "YOUR_API_KEY",
apiSecret = "YOUR_API_SECERT"
)
let okx = new smxt.Okx(
apiKey = "YOUR_API_KEY",
apiSecret = "YOUR_API_SECERT",
passphrase = "YOUR_PASSPHRASE"
)
let gateIo = new smxt.GateIo(
apiKey = "YOUR_API_KEY",
apiSecret = "YOUR_API_SECERT"
)
let orderly = new smxt.Orderly(
accountId = "YOUR_ACCOUNT_ID",
apiSecret = "YOUR_API_SECERT"
)
get wallet data
let totalEquity = await bybit.getTotalEquity()
console.log(totalEquity)
let symbolBalance = await bybit.getSymbolBalance("USDT")
console.log(symbolBalance)
get market data
await bybit.initSymbolInfo()
console.log(bybit.symbolInfo)
let timeframe = "1d"
let kline = await bybit.getKline("ETHUSDT", timeframe)
console.log(kline)
trade function
let orderType = "limit"
let side = "buy"
let amount = 10
let price = 0.4
let orderId = await bybit.postOrder(
"XRPUSDT",
orderType,
side,
amount,
price
)
console.log(orderId)
let position = await bybit.getPosition("XRPUSDT")
console.log(position)
await bybit.cancelAllOrders("XRPUSDT")
Contact Us
For business inquiries: dev@tradingtau.com