# 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="phemex-functions/contract" %}
[contract](https://docs.compendium.finance/pendax/using-pendax-sdk/phemex-functions/contract)
{% endcontent-ref %}

{% content-ref url="phemex-functions/convert" %}
[convert](https://docs.compendium.finance/pendax/using-pendax-sdk/phemex-functions/convert)
{% endcontent-ref %}

{% content-ref url="phemex-functions/deposit-and-withdraw" %}
[deposit-and-withdraw](https://docs.compendium.finance/pendax/using-pendax-sdk/phemex-functions/deposit-and-withdraw)
{% endcontent-ref %}

{% content-ref url="phemex-functions/hedged-contract" %}
[hedged-contract](https://docs.compendium.finance/pendax/using-pendax-sdk/phemex-functions/hedged-contract)
{% endcontent-ref %}

{% content-ref url="phemex-functions/margin-trading" %}
[margin-trading](https://docs.compendium.finance/pendax/using-pendax-sdk/phemex-functions/margin-trading)
{% endcontent-ref %}

{% content-ref url="phemex-functions/spot" %}
[spot](https://docs.compendium.finance/pendax/using-pendax-sdk/phemex-functions/spot)
{% endcontent-ref %}

{% content-ref url="phemex-functions/transfer" %}
[transfer](https://docs.compendium.finance/pendax/using-pendax-sdk/phemex-functions/transfer)
{% endcontent-ref %}


---

# Agent Instructions: 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:

```
GET https://docs.compendium.finance/pendax/using-pendax-sdk/phemex-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
