# Convert

## RFQ quote

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

<https://phemex-docs.github.io#rfq-quote>
{% endhint %}

#### Function Name:

```javascript
rfqQuote()
```

#### Usage:

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

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

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

let result = await rfqQuote(myMainPhemexExchange, {
        fromCurrency: "BTC",
        toCurrency: "USD",
        fromAmountEv: "1"
     });
```

## Convert

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

<https://phemex-docs.github.io#convert>
{% endhint %}

#### Function Name:

```javascript
convert()
```

#### Usage:

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

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

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

let result = await convert(myMainPhemexExchange, {
        fromCurrency: "BTC",
        toCurrency: "USD",
        fromAmountEv: "1",
         code: "GK5LG755LVQYCJUWL3MESRZF3D7T67JIZJEOPNY3RBBCOF2W65DFIJXSEOT3EJTHE33NIN2XE4TFNZRXSIR2EJBFIQZCFQRHI32DOVZHEZLOMN4SEORCKVJUIIRMEJXXE2LHNFXCEORRFQRHA4TJMNSSEORCGAXDAMBQGAYDAMBQEIWCE4DSNFRWKUZYEI5DALBCOBZGSY3FIZXXEQ3BNRRSEORQIUWTEMRMEJYHE33DMVSWI4ZCHIRDALRQGAYDAMBQGAYCELBCOBZG6Y3FMVSHGRLWEI5DALBCMNXW45TFOJZWS33OIZSWKSLUMVWXGIR2PMRGG33OOZSXE43JN5XEMZLFKJ2WYZLTEI5FWISEIVDECVKMKRPUMRKFL5LUQRKOL5HE6X2NIFKEGSBCLUWCE5DPORQWYRTFMVJGC5DFEI5DALRQGAZSYITUN52GC3CGMVSUK5RCHIYSYITCMFZWKRTFMVJGC5DFEI5DALRQGAYTKMBQFQRGEYLTMVDGKZKFOYRDUMBMEJTXEYLEOVQWYRTFMVJGC5DFEI5G45LMNQWCEZ3SMFSHKYLMIZSWKRLWEI5DALBCOBSW4YLMOR4UMZLFKJQXIZJCHJXHK3DMFQRHAZLOMFWHI6KGMVSUK5RCHIYCYITXNBUXIZKMNFZXIRTFMVJGC5DFEI5G45LMNQWCE53INF2GKTDJON2EMZLFIV3CEORQFQRGIZLGMF2WY5CGMVSVEYLUMURDUMBOGAYDGLBCMRSWMYLVNR2EMZLFIV3CEORQFQRHI2DJOJSFAYLSOR4UMZLFKJQXIZJCHJXHK3DMFQRHI2DJOJSFAYLSOR4UMZLFIV3CEORQPUWCE5DJMNVUS3TGN4RDU6ZCOBZGSY3FEI5DGMBYHE3TKOBQGQWCE43DMFWGKIR2GQWCE5DJNVSXG5DBNVYCEORRGY4TQMBXGYZDINZZHA4TQMBSHAZTOLBCORXUEYLTMVBXK4TSMVXGG6JCHJ2HE5LFPUWCE3LPOZSU64BCHIYCYITFPBYGS4TFIF2CEORRGY4TQMBXGYZDKNZQGAZSYITSMVYXKZLTORAXIIR2GE3DSOBQG43DENBZGAYDGLBCOF2W65DFIF2CEORRGY4TQMBXGYZDINZZHA4SYITROVXXIZKJMQRDUMJWHE4DANZWGI2DOOJYHEWCE4LVN52GKUDSNFRWKUZUEI5DGMBYHE3TKOBQGR6SYITVONSXESLEEI5DIOBQG44TSNZMEJRGSZBCHIRCELBCOF2W65DFJNSXSIR2EJRTEMLEGA4DENBNMQYDSNJNGRRGGYZNMFTDIZRNGI3TCYJTHFSWCOBWGM3SE7ML347V3CYBAAAA"
     });
```

## Query convert history

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

<https://phemex-docs.github.io#query-convert-history>
{% endhint %}

#### Function Name:

```javascript
getConvertHistory()
```

#### Usage:

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

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

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

let result = await getConvertHistory(myMainPhemexExchange, {
 });
```


---

# 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/convert.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.
