Compendium Trading Tools Documentation
CompendiumPENDAXCompendexOfficial Links
  • ⭐Platform Overview
  • ⚫PENDAX
    • 🌐What is PENDAX?
    • 🖱️PENDAX Capabilities
    • 💾Installing PENDAX modules
    • 💡Using PENDAX SDK
      • 💻Common Functions
      • 💻OKX Functions
        • Trading & Orders
        • Funding
        • Convert
        • Account & Subaccount
        • Grid Trading
        • Market Data
        • Public Data
        • Trading Data
      • 💻Bitget Functions
        • Public (Spot)
        • Market (Spot)
        • Wallet (Spot)
        • Account (Spot)
        • Trade (Spot)
        • Market (Futures)
        • Account (Futures)
        • Trade (Futures)
        • CopyTrade (Futures)
        • Sub Account Interface (Broker)
        • Sub API Interface (Broker)
      • 💻ByBit Functions
        • Market
        • Trading
        • Position
        • Account
        • Asset
        • User
        • Spot Leverage Token
        • Spot Margin Trade (UTA)
        • Spot Margin Trade (Normal)
        • Institutional Lending
      • 💻Mexc Functions
        • Market
        • Sub-Account
        • Spot Account/Trade
        • Wallet
        • ETF
        • Rebate
        • Futures Market
        • Futures Account and Trading
      • 💻Phemex Functions
        • Contract
        • Hedged Contract
        • Spot
        • Margin Trading
        • Transfer
        • Convert
        • Deposit And Withdraw
      • 💻BloFin Functions
        • Websocket
        • Account
        • Affiliate
        • Public Data
        • Trading
        • User
      • 💻BingX Functions
        • Fund Account
        • Wallet Deposits and Withdrawals
        • Sub-Account Managenent
        • Market Data (USDT-M)
        • Account (USDT-M)
        • Trades (USDT-M)
        • Market Data (Coin-M)
        • Trades (Coin-M)
        • Market Data (Spot)
        • Fund Account (Spot)
        • Trades (Spot)
        • CopyTrader
      • ⚠️FTX Functions
    • 📜License Agreement
  • 🟣Compendium App
    • 📈Compendium Trading Tools
    • 🔗Connect An Exchange Account
      • 🗝️OKX.com API Keys
    • 🤖Verified Trading Bots
      • Explore The Marketplace
      • For Algo & Strategy Authors
        • Get Listed & Verified
        • Strategy Monetization
        • Sending Trading Signals
        • Simplified Signal Program
      • For Users & Subscribers
        • Subscribing To Bots
        • Managing A Subscription
    • 💫Copy Trading Groups
      • For Copy Group Leaders
        • Creating A Copy Group
        • Linking Leader Account
        • Important Trading Notes
        • Manage A Copy Group
        • Discord Webhooks Setup
      • For Users & Subscribers
        • Subscribe To Copy Group
        • Link Account To Group
    • 📶Signal Provider Groups
      • For Group Leaders
        • Creating A Signal Group
        • Managing A Signal Group
        • Sending Trading Signals
      • For Users & Subscribers
        • Subscribing To Signal Groups
        • Manage Signal Group Subscription
  • 🔵Compendex Suite
    • 🔮DeFi With Compendex
    • ☀️Solana Integrations
      • Supported Solana Wallets
      • Overview And News
      • Openbook Spot Markets
      • Smart Swap Aggregator
      • NFT Metaverse Markets
      • Solana DeFi Analytics Portal
      • Community Tools List
  • 🪙The CMFI Token Ecosystem
    • 📊Tokenomics Breakdown
    • 🍎Trade Incentive Program
    • 🌊Staking And Liquidity Pools
      • ✨Raydium Liquidity Pools
      • 🐳Orca Liquidity Whirlpools
      • 🐋Orca Liquidity Pools
    • 🐷Compendi-Pigs NFT
  • 👥Community Info
    • ✅Links And Social Pages
    • 🎨Branding Guidelines
Powered by GitBook
On this page
  • Get all informations of user's asset
  • Get the user's single currency asset information
  • Get the user's asset transfer records
  • Get the user’s history position information
  • Get the user's current holding position
  • Get details of user‘s funding rate
  • Get the user's current pending order
  • Get all of the user's historical orders
  • Query the order based on the external number
  • Query the order based on the order number
  • Get order transaction details based on the order ID
  • Get all transaction details of the user’s order
  • Gets the trigger order list
  • Get the Stop-Limit order list
  • Get risk limits
  • Increase or decrease margin
  • Get leverage
  • Get position mode
  1. PENDAX
  2. Using PENDAX SDK
  3. Mexc Functions

Futures Account and Trading

Documentation on interacting with Mexc's Futures Account and Trading API functions through the PENDAX Javascript SDK.

PreviousFutures MarketNextPhemex Functions

Last updated 1 year ago

Get all informations of user's asset

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

Function Name:

getUserAssetInfoFutures()

Usage:

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

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

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

let result = await getUserAssetInfoFutures(myMexcExchanges);

Get the user's single currency asset information

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

Function Name:

getUserSingleCurrencyAssetInfoFutures()

Usage:

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

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

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

let result = await getUserSingleCurrencyAssetInfoFutures(myMexcExchanges, 
         {
             currency: "USDT"
         });

Get the user's asset transfer records

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

Function Name:

getUserAssetTransferRecordsFutures()

Usage:

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

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

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

let result = await getUserAssetTransferRecordsFutures(myMexcExchanges, 
         {
             page_size: "10",
             currency: "USDT"
         });

Get the user’s history position information

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

Function Name:

getHistoryPositionInformationFutures()

Usage:

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

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

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

let result = await getHistoryPositionInformationFutures(myMexcExchanges, 
         {
             symbol: "MX_USDT"
         });

Get the user's current holding position

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

Function Name:

getCurrentHoldingPositionFutures()

Usage:

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

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

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

let result = await getCurrentHoldingPositionFutures(myMexcExchanges);

Get details of user‘s funding rate

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

Function Name:

getUserFundingRateDetails()

Usage:

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

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

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

let result = await getUserFundingRateDetails(myMexcExchanges);

Get the user's current pending order

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

Function Name:

getUserCurrentPendingOrderFutures()

Usage:

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

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

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

let result = await getUserCurrentPendingOrderFutures(myMexcExchanges, 
         {
             symbol: "MX_USDT"
         });

Get all of the user's historical orders

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

Function Name:

getAllUserHistoricalOrdersFutures()

Usage:

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

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

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

let result = await getAllUserHistoricalOrdersFutures(myMexcExchanges);

Query the order based on the external number

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

Function Name:

getOrderByExternalNumberFutures()

Usage:

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

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

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

let result = await getOrderByExternalNumberFutures(myMexcExchanges,
         {
             symbol: "ETH_USDT",
             external_oid: "_m_f95eb99b061d4eef8f64a04e9ac4dad3"
         });

Query the order based on the order number

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

Function Name:

getOrderByOrderNumberFutures()

Usage:

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

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

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

let result = await getOrderByOrderNumberFutures(myMexcExchanges,
         {
             order_id: "102015012431820288"
         });

Get order transaction details based on the order ID

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

Function Name:

getOrderTransactionDetailsByOIDFutures()

Usage:

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

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

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

let result = await getOrderTransactionDetailsByOIDFutures(myMexcExchanges,
         {
             order_id: "102015012431820288"
         });

Get all transaction details of the user’s order

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

Function Name:

getAllTranscationDetailsUserOrderFutures()

Usage:

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

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

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

let result = await getAllTranscationDetailsUserOrderFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Gets the trigger order list

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

Function Name:

getTriggerOrderListFutures()

Usage:

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

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

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

let result = await getTriggerOrderListFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Get the Stop-Limit order list

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

Function Name:

getStopLimitOrderListFutures()

Usage:

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

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

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

let result = await getStopLimitOrderListFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Get risk limits

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

Function Name:

getRiskLimitsFutures()

Usage:

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

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

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

let result = await getRiskLimitsFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Increase or decrease margin

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

Function Name:

changeMarginFutures()

Usage:

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

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

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

let result = await changeMarginFutures(myMexcExchanges,
         {
             positionId: "134321",
             amount: "1",
             type: "ADD"
         });

Get leverage

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

Function Name:

getLeverageFutures()

Usage:

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

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

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

let result = await getLeverageFutures(myMexcExchanges,
         {
             symbol: "MX_USDT"
         });

Get position mode

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

Function Name:

getPositionModeFutures()

Usage:

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

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

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

let result = await getPositionModeFutures(myMexcExchanges);

⚫
💡
💻
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-single-currency-asset-information
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-current-holding-position
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-details-of-user-s-funding-rate
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-current-pending-order
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
https://mxcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-external-number
https://mxcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-order-transaction-details-based-on-the-order-id
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-transaction-details-of-the-user-s-order
https://mxcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-stop-limit-order-list
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-risk-limits
https://mxcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-leverage
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-position-mode