Back to Ccxt

Mudrex

wiki/exchanges/mudrex.md

4.5.6420.1 KB
Original Source

<a name="mudrex" id="mudrex"></a>

mudrex{docsify-ignore}

Kind: global class
Extends: <code>Exchange</code>

<a name="fetchOHLCV" id="fetchohlcv"></a>

fetchOHLCV{docsify-ignore}

fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of <code>mudrex</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://docs.trade.mudrex.com/docs/historical-kline

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.until<code>int</code>Notimestamp in ms of the latest candle to fetch
params.price<code>string</code>No"mark" to fetch mark price candles
javascript
mudrex.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

<a name="fetchMarkOHLCV" id="fetchmarkohlcv"></a>

fetchMarkOHLCV{docsify-ignore}

fetches historical mark price candlestick data containing the open, high, low, and close price of a market

Kind: instance method of <code>mudrex</code>
Returns: <code>Array<Array<int>></code> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch OHLCV data for
timeframe<code>string</code>Yesthe length of time each candle represents
since<code>int</code>Notimestamp in ms of the earliest candle to fetch
limit<code>int</code>Nothe maximum amount of candles to fetch
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.fetchMarkOHLCV (symbol, timeframe, since?, limit?, params?)

<a name="fetchTicker" id="fetchticker"></a>

fetchTicker{docsify-ignore}

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - a ticker structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified symbol of the market to fetch the ticker for
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.fetchTicker (symbol, params?)

<a name="fetchTickers" id="fetchtickers"></a>

fetchTickers{docsify-ignore}

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - a dictionary of ticker structures

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nounified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.fetchTickers (symbols?, params?)

<a name="fetchMarkets" id="fetchmarkets"></a>

fetchMarkets{docsify-ignore}

retrieves data on all markets for the exchange

Kind: instance method of <code>mudrex</code>
Returns: <code>Array<object></code> - an array of objects representing market data

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.fetchMarkets (params?)

<a name="fetchBalance" id="fetchbalance"></a>

fetchBalance{docsify-ignore}

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - a balance structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.type<code>string</code>No'swap' (default) or 'spot' - which wallet balance to fetch
params.trade_currency<code>string</code>Nothe settlement currency to query the balance for
javascript
mudrex.fetchBalance (params?)

<a name="fetchLeverage" id="fetchleverage"></a>

fetchLeverage{docsify-ignore}

fetch the set leverage for a market

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - a leverage structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.fetchLeverage (symbol, params?)

<a name="setLeverage" id="setleverage"></a>

setLeverage{docsify-ignore}

set the level of leverage for a market

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - response from the exchange

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
leverage<code>float</code>Yesthe rate of leverage
symbol<code>string</code>Yesunified market symbol
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.marginType<code>string</code>No'ISOLATED' (default) or 'CROSSED'
javascript
mudrex.setLeverage (leverage, symbol, params?)

<a name="createOrder" id="createorder"></a>

createOrder{docsify-ignore}

create a trade order

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - an order structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
type<code>string</code>Yes'market' or 'limit'
side<code>string</code>Yes'buy' or 'sell'
amount<code>float</code>Yeshow much you want to trade in units of the base currency
price<code>float</code>Nothe price to fulfill the order, in units of the quote currency (also required for market orders on this exchange)
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.leverage<code>int</code>Noleverage for the order, required if setLeverage() was not called beforehand
params.reduceOnly<code>bool</code>Notrue if the order is reduce only
params.takeProfit<code>object</code>NotakeProfit object in params containing the trigger price of the take-profit order attached to this order
params.takeProfit.triggerPrice<code>float</code>Notake profit trigger price
params.stopLoss<code>object</code>NostopLoss object in params containing the trigger price of the stop-loss order attached to this order
params.stopLoss.triggerPrice<code>float</code>Nostop loss trigger price
params.takeProfitPrice<code>float</code>Nothe trigger price for a standalone take-profit order on an existing position (requires params.positionId)
params.stopLossPrice<code>float</code>Nothe trigger price for a standalone stop-loss order on an existing position (requires params.positionId)
params.positionId<code>string</code>Nothe id of the position the standalone stopLossPrice/takeProfitPrice order is attached to
params.trade_currency<code>string</code>Nothe settlement currency for the order
javascript
mudrex.createOrder (symbol, type, side, amount, price?, params?)

<a name="editOrder" id="editorder"></a>

editOrder{docsify-ignore}

edit a trade order

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - an order structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Yesunified symbol of the market to edit an order in
type<code>string</code>Yes'market' or 'limit'
side<code>string</code>Yes'buy' or 'sell'
amount<code>float</code>Nohow much of the currency you want to trade in units of the base currency
price<code>float</code>Nothe price at which the order is to be fulfilled, in units of the quote currency
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.editOrder (id, symbol, type, side, amount?, price?, params?)

<a name="cancelOrder" id="cancelorder"></a>

cancelOrder{docsify-ignore}

cancels an open order

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - An order structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
id<code>string</code>Yesorder id
symbol<code>string</code>Nounified symbol of the market the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.cancelOrder (id, symbol?, params?)

<a name="fetchOrder" id="fetchorder"></a>

fetchOrder{docsify-ignore}

fetches information on an order made by the user

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - An order structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
id<code>string</code>Yesthe order id
symbol<code>string</code>Nounified symbol of the market the order was made in
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.fetchOrder (id, symbol?, params?)

<a name="fetchOrders" id="fetchorders"></a>

fetchOrders{docsify-ignore}

fetches information on multiple orders made by the user

Kind: instance method of <code>mudrex</code>
Returns: <code>Array<Order></code> - a list of order structures

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.fetchOrders (symbol?, since?, limit?, params?)

<a name="fetchOpenOrders" id="fetchopenorders"></a>

fetchOpenOrders{docsify-ignore}

fetch all unfilled currently open orders

Kind: instance method of <code>mudrex</code>
Returns: <code>Array<Order></code> - a list of order structures

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol
since<code>int</code>Nothe earliest time in ms to fetch open orders for
limit<code>int</code>Nothe maximum number of open order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.fetchOpenOrders (symbol?, since?, limit?, params?)

<a name="fetchClosedOrders" id="fetchclosedorders"></a>

fetchClosedOrders{docsify-ignore}

fetches information on multiple closed orders made by the user

Kind: instance method of <code>mudrex</code>
Returns: <code>Array<Order></code> - a list of order structures

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol of the market orders were made in
since<code>int</code>Nothe earliest time in ms to fetch orders for
limit<code>int</code>Nothe maximum number of order structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.fetchClosedOrders (symbol?, since?, limit?, params?)

<a name="fetchPositions" id="fetchpositions"></a>

fetchPositions{docsify-ignore}

fetch all open positions

Kind: instance method of <code>mudrex</code>
Returns: <code>Array<object></code> - a list of position structures

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbols<code>Array<string></code>Nolist of unified market symbols
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trade_currency<code>string</code>Nothe settlement currency to query positions for
javascript
mudrex.fetchPositions (symbols?, params?)

<a name="fetchPositionsHistory" id="fetchpositionshistory"></a>

fetchPositionsHistory{docsify-ignore}

fetches the history of closed positions

Kind: instance method of <code>mudrex</code>
Returns: <code>Array<object></code> - a list of position structures

See: https://docs.trade.mudrex.com/docs/get-position-history

ParamTypeRequiredDescription
symbols<code>Array<string></code>Noa list of unified market symbols
since<code>int</code>Nothe earliest time in ms to fetch positions for
limit<code>int</code>Nothe maximum number of position structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trade_currency<code>string</code>Nothe settlement currency to filter positions by
javascript
mudrex.fetchPositionsHistory (symbols?, since?, limit?, params?)

<a name="closePosition" id="closeposition"></a>

closePosition{docsify-ignore}

closes an open position for a market

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - an order structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified CCXT market symbol
side<code>string</code>No'buy' or 'sell', not required by mudrex
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.position_id<code>string</code>Nothe id of the position to close, resolved from the symbol if not provided
params.amount<code>float</code>Nothe amount to close for a partial close, closes the whole position if not provided
javascript
mudrex.closePosition (symbol, side?, params?)

<a name="addMargin" id="addmargin"></a>

addMargin{docsify-ignore}

add margin to a position

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - a margin structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
amount<code>float</code>Yesamount of margin to add
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.position_id<code>string</code>Nothe id of the position to add margin to, resolved from the symbol if not provided
javascript
mudrex.addMargin (symbol, amount, params?)

<a name="reduceMargin" id="reducemargin"></a>

reduceMargin{docsify-ignore}

remove margin from a position

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - a margin structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Yesunified market symbol
amount<code>float</code>Yesthe amount of margin to remove
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.reduceMargin (symbol, amount, params?)

<a name="fetchMyTrades" id="fetchmytrades"></a>

fetchMyTrades{docsify-ignore}

fetch all trades made by the user

Kind: instance method of <code>mudrex</code>
Returns: <code>Array<Trade></code> - a list of trade structures

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
symbol<code>string</code>Nounified market symbol
since<code>int</code>Nothe earliest time in ms to fetch trades for
limit<code>int</code>Nothe maximum number of trade structures to retrieve
params<code>object</code>Noextra parameters specific to the exchange API endpoint
params.trade_currency<code>string</code>Nothe settlement currency to filter trades by
javascript
mudrex.fetchMyTrades (symbol?, since?, limit?, params?)

<a name="transfer" id="transfer"></a>

transfer{docsify-ignore}

transfer currency internally between wallets on the same account

Kind: instance method of <code>mudrex</code>
Returns: <code>object</code> - a transfer structure

See: https://docs.trade.mudrex.com/docs

ParamTypeRequiredDescription
code<code>string</code>Yesunified currency code
amount<code>float</code>Yesamount to transfer
fromAccount<code>string</code>Yes'spot' or 'futures'
toAccount<code>string</code>Yes'spot' or 'futures'
params<code>object</code>Noextra parameters specific to the exchange API endpoint
javascript
mudrex.transfer (code, amount, fromAccount, toAccount, params?)