> For the complete documentation index, see [llms.txt](https://docs.compendium.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.compendium.finance/pendax/using-pendax-sdk/mexc-functions/futures-account-and-trading.md).

# Futures Account and Trading

## Get all informations of user's asset

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset>
{% endhint %}

#### Function Name:

```javascript
getUserAssetInfoFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-single-currency-asset-information>
{% endhint %}

#### Function Name:

```javascript
getUserSingleCurrencyAssetInfoFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records>
{% endhint %}

#### Function Name:

```javascript
getUserAssetTransferRecordsFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information>
{% endhint %}

#### Function Name:

```javascript
getHistoryPositionInformationFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-current-holding-position>
{% endhint %}

#### Function Name:

```javascript
getCurrentHoldingPositionFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-details-of-user-s-funding-rate>
{% endhint %}

#### Function Name:

```javascript
getUserFundingRateDetails()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-current-pending-order>
{% endhint %}

#### Function Name:

```javascript
getUserCurrentPendingOrderFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders>
{% endhint %}

#### Function Name:

```javascript
getAllUserHistoricalOrdersFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-external-number>
{% endhint %}

#### Function Name:

```javascript
getOrderByExternalNumberFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number>
{% endhint %}

#### Function Name:

```javascript
getOrderByOrderNumberFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-order-transaction-details-based-on-the-order-id>
{% endhint %}

#### Function Name:

```javascript
getOrderTransactionDetailsByOIDFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-all-transaction-details-of-the-user-s-order>
{% endhint %}

#### Function Name:

```javascript
getAllTranscationDetailsUserOrderFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list>
{% endhint %}

#### Function Name:

```javascript
getTriggerOrderListFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-the-stop-limit-order-list>
{% endhint %}

#### Function Name:

```javascript
getStopLimitOrderListFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-risk-limits>
{% endhint %}

#### Function Name:

```javascript
getRiskLimitsFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin>
{% endhint %}

#### Function Name:

```javascript
changeMarginFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-leverage>
{% endhint %}

#### Function Name:

```javascript
getLeverageFutures()
```

#### Usage:

```javascript
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

{% hint style="info" %}
Please refer to the official Mexc API Docs for the Required parameters.

<https://mxcdevelop.github.io/apidocs/contract_v1_en/#get-position-mode>
{% endhint %}

#### Function Name:

```javascript
getPositionModeFutures()
```

#### Usage:

```javascript
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);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.compendium.finance/pendax/using-pendax-sdk/mexc-functions/futures-account-and-trading.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
