mudrex
mudrex cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.
🔌 Looking for raw exchange endpoints? See the mudrex implicit API — every endpoint in this exchange's API exposed as an implicit method.
mudrex
Kind: global class
Extends: Exchange
- fetchOHLCV
- fetchMarkOHLCV
- fetchTicker
- fetchTickers
- fetchMarkets
- fetchBalance
- fetchLeverage
- setLeverage
- createOrder
- editOrder
- cancelOrder
- fetchOrder
- fetchOrders
- fetchOpenOrders
- fetchClosedOrders
- fetchPositions
- fetchPositionsHistory
- closePosition
- addMargin
- reduceMargin
- fetchMyTrades
- transfer
fetchOHLCV
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of mudrex
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://docs.trade.mudrex.com/docs/historical-kline
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | timestamp in ms of the latest candle to fetch |
| params.price | string | No | "mark" to fetch mark price candles |
mudrex.fetchOHLCV (symbol, timeframe, since?, limit?, params?)fetchMarkOHLCV
fetches historical mark price candlestick data containing the open, high, low, and close price of a market
Kind: instance method of mudrex
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.fetchMarkOHLCV (symbol, timeframe, since?, limit?, params?)fetchTicker
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of mudrex
Returns: object - a ticker structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the ticker for |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.fetchTicker (symbol, params?)fetchTickers
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of mudrex
Returns: object - a dictionary of ticker structures
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.fetchTickers (symbols?, params?)fetchMarkets
retrieves data on all markets for the exchange
Kind: instance method of mudrex
Returns: Array<object> - an array of objects representing market data
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.fetchMarkets (params?)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of mudrex
Returns: object - a balance structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.type | string | No | 'swap' (default) or 'spot' - which wallet balance to fetch |
| params.trade_currency | string | No | the settlement currency to query the balance for |
mudrex.fetchBalance (params?)fetchLeverage
fetch the set leverage for a market
Kind: instance method of mudrex
Returns: object - a leverage structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.fetchLeverage (symbol, params?)setLeverage
set the level of leverage for a market
Kind: instance method of mudrex
Returns: object - response from the exchange
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| leverage | float | Yes | the rate of leverage |
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginType | string | No | 'ISOLATED' (default) or 'CROSSED' |
mudrex.setLeverage (leverage, symbol, params?)createOrder
create a trade order
Kind: instance method of mudrex
Returns: object - an order structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much you want to trade in units of the base currency |
| price | float | No | the price to fulfill the order, in units of the quote currency (also required for market orders on this exchange) |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.leverage | int | No | leverage for the order, required if setLeverage() was not called beforehand |
| params.reduceOnly | bool | No | true if the order is reduce only |
| params.takeProfit | object | No | takeProfit object in params containing the trigger price of the take-profit order attached to this order |
| params.takeProfit.triggerPrice | float | No | take profit trigger price |
| params.stopLoss | object | No | stopLoss object in params containing the trigger price of the stop-loss order attached to this order |
| params.stopLoss.triggerPrice | float | No | stop loss trigger price |
| params.takeProfitPrice | float | No | the trigger price for a standalone take-profit order on an existing position (requires params.positionId) |
| params.stopLossPrice | float | No | the trigger price for a standalone stop-loss order on an existing position (requires params.positionId) |
| params.positionId | string | No | the id of the position the standalone stopLossPrice/takeProfitPrice order is attached to |
| params.trade_currency | string | No | the settlement currency for the order |
mudrex.createOrder (symbol, type, side, amount, price?, params?)editOrder
edit a trade order
Kind: instance method of mudrex
Returns: object - an order structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market to edit an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | No | how much of the currency you want to trade in units of the base currency |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.editOrder (id, symbol, type, side, amount?, price?, params?)cancelOrder
cancels an open order
Kind: instance method of mudrex
Returns: object - An order structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | No | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.cancelOrder (id, symbol?, params?)fetchOrder
fetches information on an order made by the user
Kind: instance method of mudrex
Returns: object - An order structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | the order id |
| symbol | string | No | unified symbol of the market the order was made in |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.fetchOrder (id, symbol?, params?)fetchOrders
fetches information on multiple orders made by the user
Kind: instance method of mudrex
Returns: Array<Order> - a list of order structures
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.fetchOrders (symbol?, since?, limit?, params?)fetchOpenOrders
fetch all unfilled currently open orders
Kind: instance method of mudrex
Returns: Array<Order> - a list of order structures
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.fetchOpenOrders (symbol?, since?, limit?, params?)fetchClosedOrders
fetches information on multiple closed orders made by the user
Kind: instance method of mudrex
Returns: Array<Order> - a list of order structures
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.fetchClosedOrders (symbol?, since?, limit?, params?)fetchPositions
fetch all open positions
Kind: instance method of mudrex
Returns: Array<object> - a list of position structures
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trade_currency | string | No | the settlement currency to query positions for |
mudrex.fetchPositions (symbols?, params?)fetchPositionsHistory
fetches the history of closed positions
Kind: instance method of mudrex
Returns: Array<object> - a list of position structures
See: https://docs.trade.mudrex.com/docs/get-position-history
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | a list of unified market symbols |
| since | int | No | the earliest time in ms to fetch positions for |
| limit | int | No | the maximum number of position structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trade_currency | string | No | the settlement currency to filter positions by |
mudrex.fetchPositionsHistory (symbols?, since?, limit?, params?)closePosition
closes an open position for a market
Kind: instance method of mudrex
Returns: object - an order structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| side | string | No | 'buy' or 'sell', not required by mudrex |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.position_id | string | No | the id of the position to close, resolved from the symbol if not provided |
| params.amount | float | No | the amount to close for a partial close, closes the whole position if not provided |
mudrex.closePosition (symbol, side?, params?)addMargin
add margin to a position
Kind: instance method of mudrex
Returns: object - a margin structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| amount | float | Yes | amount of margin to add |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.position_id | string | No | the id of the position to add margin to, resolved from the symbol if not provided |
mudrex.addMargin (symbol, amount, params?)reduceMargin
remove margin from a position
Kind: instance method of mudrex
Returns: object - a margin structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| amount | float | Yes | the amount of margin to remove |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.reduceMargin (symbol, amount, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of mudrex
Returns: Array<Trade> - a list of trade structures
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol |
| since | int | No | the earliest time in ms to fetch trades for |
| limit | int | No | the maximum number of trade structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trade_currency | string | No | the settlement currency to filter trades by |
mudrex.fetchMyTrades (symbol?, since?, limit?, params?)transfer
transfer currency internally between wallets on the same account
Kind: instance method of mudrex
Returns: object - a transfer structure
See: https://docs.trade.mudrex.com/docs
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | 'spot' or 'futures' |
| toAccount | string | Yes | 'spot' or 'futures' |
| params | object | No | extra parameters specific to the exchange API endpoint |
mudrex.transfer (code, amount, fromAccount, toAccount, params?)