> 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/phemex-functions.md).

# Phemex Functions

## Create an Exchange Object

Before you can interact with PENDAX functions, you must first create an Exchange object. This exchange object will allow you to interact with PENDAX. You can create one or multiple, and reference them together or individually throughout your code.

#### Example Exchange Object Creation:

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

let phemex_exchange = createExchange({
      exchange: "phemex",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      label: "phemex"
});


```

#### Unauthenticated Exchange Objects

If you are just calling public API endpoints on the exchange and you don't need any authentication to protected endpoints, simply create your exchange object with authenticate set to false and omit the key, secret, passphrase.

{% hint style="info" %}
Authenticated Exchange objects can call private and public endpoints, however, unauthenticated exchange objects may only call public endpoints.
{% endhint %}

#### Example Unauthenticated Exchange Object:

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

let myMexcAccount= createExchange({
      exchange: "phemex",
      authenticate: "false",
      label: "phemex"
});
```

## All Available Phemex Functions

Documentation for each category of functions is broken down into its own subpage in order to make navigating pages simpler and faster. Please use the side navigation to access these sub-pages or click on one of the links below.

{% content-ref url="/pages/50g4tAxy5hGWA7A0MSe4" %}
[Contract](/pendax/using-pendax-sdk/phemex-functions/contract.md)
{% endcontent-ref %}

{% content-ref url="/pages/FmsLNpv0H1FRohrgaMzE" %}
[Convert](/pendax/using-pendax-sdk/phemex-functions/convert.md)
{% endcontent-ref %}

{% content-ref url="/pages/FjUcOGM1JXwH0bOzl3aE" %}
[Deposit And Withdraw](/pendax/using-pendax-sdk/phemex-functions/deposit-and-withdraw.md)
{% endcontent-ref %}

{% content-ref url="/pages/68nMKiRJ5MNjGqCZOcB5" %}
[Hedged Contract](/pendax/using-pendax-sdk/phemex-functions/hedged-contract.md)
{% endcontent-ref %}

{% content-ref url="/pages/YtCilcb6Cu4RmzaxD2rZ" %}
[Margin Trading](/pendax/using-pendax-sdk/phemex-functions/margin-trading.md)
{% endcontent-ref %}

{% content-ref url="/pages/v5zIz1ZDooJVpIEdRaz3" %}
[Spot](/pendax/using-pendax-sdk/phemex-functions/spot.md)
{% endcontent-ref %}

{% content-ref url="/pages/LvvCLUGojNZs0CZ21nxS" %}
[Transfer](/pendax/using-pendax-sdk/phemex-functions/transfer.md)
{% endcontent-ref %}


---

# 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/phemex-functions.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.
