Trades (USDT-M)

Test Order

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Test+Order

Function Name:

testOrderUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function testOrderUM(exchange, options) {
    try {
        let result = await exchange.testOrderUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await testOrderUM(myBingxExchange, {
	symbol: "<string>",
	type: "<string>",
	side: "<string>"
});

Place order

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Place+order

Function Name:

placeOrderUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function placeOrderUM(exchange, options) {
    try {
        let result = await exchange.placeOrderUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await placeOrderUM(myBingxExchange, {
	symbol: "<string>",
	type: "<string>",
	side: "<string>"
});

Place order in demo trading

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Place+order+in+demo+trading

Function Name:

placeOrderDemoTradingUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function placeOrderDemoTradingUM(exchange, options) {
    try {
        let result = await exchange.placeOrderDemoTradingUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await placeOrderDemoTradingUM(myBingxExchange, {
	symbol: "<string>",
	type: "<string>",
	side: "<string>"
});

Place multiple orders

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Place+multiple+orders

Function Name:

placeBatchOrderUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function placeBatchOrderUM(exchange, options) {
    try {
        let result = await exchange.placeBatchOrderUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await placeBatchOrderUM(myBingxExchange, {
	batchOrders: "<LIST<Order>>"
});

Close All Positions

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Close+All+Positions

Function Name:

closeAllPositionsUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function closeAllPositionsUM(exchange, options) {
    try {
        let result = await exchange.closeAllPositionsUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await closeAllPositionsUM(myBingxExchange);

Cancel Order

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel+Order

Function Name:

cancelOrderUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function cancelOrderUM(exchange, options) {
    try {
        let result = await exchange.cancelOrderUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await cancelOrderUM(myBingxExchange, {
	symbol: "<string>"
});

Cancel multiple orders

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel+multiple+orders

Function Name:

batchCancelOrdersUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function batchCancelOrdersUM(exchange, options) {
    try {
        let result = await exchange.batchCancelOrdersUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await batchCancelOrdersUM(myBingxExchange, {
	symbol: "<string>"
});

Cancel All Open Orders

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel+All+Open+Orders

Function Name:

cancelAllOpenOrdersUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function cancelAllOpenOrdersUM(exchange, options) {
    try {
        let result = await exchange.cancelAllOpenOrdersUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await cancelAllOpenOrdersUM(myBingxExchange);

Current All Open Orders

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Current+All+Open+Orders

Function Name:

getAllOpenOrdersUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getAllOpenOrdersUM(exchange, options) {
    try {
        let result = await exchange.getAllOpenOrdersUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getAllOpenOrdersUM(myBingxExchange);

Query pending order status

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query+pending+order+status

Function Name:

getPendingOrderStatusUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getPendingOrderStatusUM(exchange, options) {
    try {
        let result = await exchange.getPendingOrderStatusUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getPendingOrderStatusUM(myBingxExchange, {
	symbol: "<string>"
});

Query Order details

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query+Order+details

Function Name:

getOrderDetailsUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getOrderDetailsUM(exchange, options) {
    try {
        let result = await exchange.getOrderDetailsUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getOrderDetailsUM(myBingxExchange, {
	symbol: "<string>"
});

Query Margin Type

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query+Margin+Type

Function Name:

getMarginTypeUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getMarginTypeUM(exchange, options) {
    try {
        let result = await exchange.getMarginTypeUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getMarginTypeUM(myBingxExchange, {
	symbol: "<string>"
});

Change Margin Type

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Change+Margin+Type

Function Name:

changeMarginTypeUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function changeMarginTypeUM(exchange, options) {
    try {
        let result = await exchange.changeMarginTypeUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await changeMarginTypeUM(myBingxExchange, {
	symbol: "<string>",
	marginType: "<string>"
});

Query Leverage

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query+Leverage

Function Name:

getLeverageUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getLeverageUM(exchange, options) {
    try {
        let result = await exchange.getLeverageUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getLeverageUM(myBingxExchange, {
	symbol: "<string>"
});

Set Leverage

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Set+Leverage

Function Name:

setLeverageUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function setLeverageUM(exchange, options) {
    try {
        let result = await exchange.setLeverageUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await setLeverageUM(myBingxExchange, {
	symbol: "<string>",
	side: "<string>",
	leverage: "<int64>"
});

Users Force Orders

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#User's+Force+Orders

Function Name:

getUsersForceOrdersUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getUsersForceOrdersUM(exchange, options) {
    try {
        let result = await exchange.getUsersForceOrdersUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getUsersForceOrdersUM(myBingxExchange);

Query Order history

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query+Order+history

Function Name:

getOrderHistoryUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getOrderHistoryUM(exchange, options) {
    try {
        let result = await exchange.getOrderHistoryUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getOrderHistoryUM(myBingxExchange, {
	limit: "<int>"
});

Modify Isolated Position Margin

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Modify+Isolated+Position+Margin

Function Name:

modifyIsolatedPositionMarginUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function modifyIsolatedPositionMarginUM(exchange, options) {
    try {
        let result = await exchange.modifyIsolatedPositionMarginUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await modifyIsolatedPositionMarginUM(myBingxExchange, {
	symbol: "<string>",
	amount: "<float64>",
	type: "<int>",
	positionSide: "<string>"
});

Query historical transaction orders

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query+historical+transaction+orders

Function Name:

getHistoricalTransactionOrdersUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "false",
      label: "bingx"
  });

async function getHistoricalTransactionOrdersUM(exchange, options) {
    try {
        let result = await exchange.getHistoricalTransactionOrdersUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getHistoricalTransactionOrdersUM(myBingxExchange, {
	tradingUnit: "<string>",
	startTs: "<int64>",
	endTs: "<int64>"
});

Set Position Mode

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Set+Position+Mode

Function Name:

setPositionModeUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function setPositionModeUM(exchange, options) {
    try {
        let result = await exchange.setPositionModeUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await setPositionModeUM(myBingxExchange);

Query position mode

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query+position+mode

Function Name:

getPositionModeUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getPositionModeUM(exchange, options) {
    try {
        let result = await exchange.getPositionModeUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getPositionModeUM(myBingxExchange);

Cancel an Existing Order and Send a New Orde

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel+an+Existing+Order+and+Send+a+New+Orde

Function Name:

cancelExistingOrderAndPlaceOrderUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function cancelExistingOrderAndPlaceOrderUM(exchange, options) {
    try {
        let result = await exchange.cancelExistingOrderAndPlaceOrderUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await cancelExistingOrderAndPlaceOrderUM(myBingxExchange, {
	cancelReplaceMode: "<string>",
	symbol: "<string>",
	type: "<string>",
	side: "<string>"
});

Cancel orders in batches and place orders in batches

Function Name:

cancelOrdersInBatchesAndPlaceOrdersInBatchesUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function cancelOrdersInBatchesAndPlaceOrdersInBatchesUM(exchange, options) {
    try {
        let result = await exchange.cancelOrdersInBatchesAndPlaceOrdersInBatchesUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await cancelOrdersInBatchesAndPlaceOrdersInBatchesUM(myBingxExchange, {
	batchOrders: "<string>"
});

Cancel All After

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel+All+After

Function Name:

cancelAllAfterUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function cancelAllAfterUM(exchange, options) {
    try {
        let result = await exchange.cancelAllAfterUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await cancelAllAfterUM(myBingxExchange);

Close position by position ID

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Close+position+by+position+ID

Function Name:

closePositionByPositionIDUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function closePositionByPositionIDUM(exchange, options) {
    try {
        let result = await exchange.closePositionByPositionIDUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await closePositionByPositionIDUM(myBingxExchange, {
	positionId: "<string>"
});

All Orders

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#All+Orders

Function Name:

getAllOrdersUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getAllOrdersUM(exchange, options) {
    try {
        let result = await exchange.getAllOrdersUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getAllOrdersUM(myBingxExchange, {
	limit: "<int>"
});

Position and Maintenance Margin Ratio

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Position+and+Maintenance+Margin+Ratio

Function Name:

getPositionMaintenanceMarginRatioUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getPositionMaintenanceMarginRatioUM(exchange, options) {
    try {
        let result = await exchange.getPositionMaintenanceMarginRatioUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getPositionMaintenanceMarginRatioUM(myBingxExchange);

Query historical transaction details

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query+historical+transaction+details

Function Name:

getHistoricalTransactionDetailsUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getHistoricalTransactionDetailsUM(exchange, options) {
    try {
        let result = await exchange.getHistoricalTransactionDetailsUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getHistoricalTransactionDetailsUM(myBingxExchange, {
	startTs: "<int64>",
	endTs: "<int64>"
});

Query Position History

Please refer to the official BingX API Docs for the Required parameters.

https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query+Position+History

Function Name:

getPositionHistoryUM()

Usage:

import { createExchange } from "./exchanges/exchange.js";

   let myBingxExchange  = createExchange({
      exchange: "bingx",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      label: "bingx"
  });

async function getPositionHistoryUM(exchange, options) {
    try {
        let result = await exchange.getPositionHistoryUM(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

let result = await getPositionHistoryUM(myBingxExchange);

Last updated