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 the server time
  • Get the contract information
  • Get the transferable currencies
  • Get a snapshot of the latest N depth information of the contract
  • Get contract fair price
  • Get contract funding rate
  • K-line data
  • Get K-line data of the index price
  • Get K-line data of the fair price
  • Get contract transaction data
  • Get contract trend data
  • Get all contract risk fund balance
  • Get contract risk fund balance history
  • Get contract funding rate history
  1. PENDAX
  2. Using PENDAX SDK
  3. Mexc Functions

Futures Market

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

PreviousRebateNextFutures Account and Trading

Last updated 1 year ago

Get the server time

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

Function Name:

getServerTimeFutures()

Usage:

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

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

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

let result = await getServerTimeFutures(myMexcExchanges);

Get the contract information

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

Function Name:

getContractDetailFutures()

Usage:

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

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

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

let result = await getContractDetailFutures(myMexcExchanges);

Get the transferable currencies

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

Function Name:

getTransferableCurrenciesFutures()

Usage:

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

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

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

let result = await getTransferableCurrenciesFutures(myMexcExchanges);

Get a snapshot of the latest N depth information of the contract

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

Function Name:

getContractNDepthInfoFutures()

Usage:

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

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

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

let result = await getContractNDepthInfoFutures(myMexcExchanges, 
         {
             symbol: "MX_USDT",
             limit: "20"
         });

Get contract fair price

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

Function Name:

getContractFairPriceFutures()

Usage:

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

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

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

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

Get contract funding rate

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

Function Name:

getContractFundingRateFutures()

Usage:

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

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

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

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

K-line data

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

Function Name:

getContractKlineFutures()

Usage:

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

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

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

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

Get K-line data of the index price

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

Function Name:

getContractIndexPriceKlineFutures()

Usage:

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

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

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

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

Get K-line data of the fair price

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

Function Name:

getContractFairPriceKlineFutures()

Usage:

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

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

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

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

Get contract transaction data

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

Function Name:

getContractTransactionDataFutures()

Usage:

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

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

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

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

Get contract trend data

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

Function Name:

getContractTrendDataFutures()

Usage:

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

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

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

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

Get all contract risk fund balance

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

Function Name:

getAllContractRiskFundBalanceFutures()

Usage:

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

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

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

let result = await getAllContractRiskFundBalanceFutures(myMexcExchanges);

Get contract risk fund balance history

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

Function Name:

getContractRiskFundBalanceHistoryFutures()

Usage:

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

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

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

let result = await getContractRiskFundBalanceHistoryFutures(myMexcExchanges, 
         {
             symbol: "MX_USDT",
             page_num: "1",
             page_size: "20"
         });

Get contract funding rate history

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

Function Name:

getContractFundingRateHistoryFutures()

Usage:

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

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

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

let result = await getContractFundingRateHistoryFutures(myMexcExchanges, 
         {
             symbol: "MX_USDT",
             page_num: "1",
             page_size: "20"
         });

⚫
💡
💻
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-transferable-currencies
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-a-snapshot-of-the-latest-n-depth-information-of-the-contract
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-contract-fair-price
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
https://mxcdevelop.github.io/apidocs/contract_v1_en/#k-line-data
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-k-line-data-of-the-index-price
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-k-line-data-of-the-fair-price
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-contract-transaction-data
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-contract-trend-data
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-contract-risk-fund-balance
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-contract-risk-fund-balance-history
https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate-history