Spot

Query product information

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

https://phemex-docs.github.io#query-product-information-3

Function Name:

getProductInfo()

Usage:

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

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

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

let result = await getProductInfo(myMainPhemexExchange);

Query server time

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

https://phemex-docs.github.io#query-server-time-2

Function Name:

getServerTime()

Usage:

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

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

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

let result = await getServerTime(myPhemexExchange);

Place order

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

https://phemex-docs.github.io/#place-order-http-put-prefered-3

Function Name:

placeOrder()

Usage:

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

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

async function amendOrder(exchange, options) {
    try {
        let result = await exchange.amendOrder(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}
let result = await placeOrder(myPhemexExchange, {
            symbol: "sBTCUSDT",
            side: "Buy",
            qtyType:"ByBase",
            baseQtyEv: "1000000000",
            ordType: "Limit",
            priceEp: "2000000000"
    });

Amend order

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

https://phemex-docs.github.io#amend-order

Function Name:

amendOrder()

Usage:

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

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

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

let result = await amendOrder(myPhemexExchange, {
             symbol: "sBTCUSDT",
             orderID: "abb9f72f-2b97-4e96-acaa-2a2a6f9453a4",
             priceRp: "200",

     });

Cancel order

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

https://phemex-docs.github.io#cancel-order

Function Name:

cancelOrder()

Usage:

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

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

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

let result = await cancelOrder(myPhemexExchange, {
             symbol: "sBTCUSDT",
             orderID: "abb9f72f-2b97-4e96-acaa-2a2a6f9453a4"

     });

Cancel all order by symbol

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

https://phemex-docs.github.io#cancel-all-order-by-symbol

Function Name:

cancelAllOrders()

Usage:

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

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

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

let result = await cancelAllOrders(myPhemexExchange);

Query open order by order ID or client order ID

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

https://phemex-docs.github.io#query-open-order-by-order-id-or-client-order-id

Function Name:

getOpenOrderActive()

Usage:

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

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

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

let result = await getOpenOrderActive(myPhemexExchange, {
             orderID: "c3cf42ee-49ac-41a3-b092-1905062e813a",
             symbol: "sBTCUSDT"
     });

Query all open orders by symbol

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

https://phemex-docs.github.io#query-all-open-orders-by-symbol

Function Name:

getOpenOrders()

Usage:

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

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

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

let result = await getOpenOrders(myPhemexExchange, {
             symbol: "sBTCUSDT"
     });

Query wallets

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

https://phemex-docs.github.io#query-wallets

Function Name:

getWallets()

Usage:

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

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

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

let result = await getWallets(myMainPhemexExchange, {
     });

Query orders by order ID or client order ID

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

https://phemex-docs.github.io#query-orders-by-order-id-or-client-order-id

Function Name:

getOrder()

Usage:

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

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

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

let result = await getOrderHistory(myPhemexExchange, {
             symbol: "sBTCUSDT"
     });

Query order history

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

https://phemex-docs.github.io#query-order-history

Function Name:

getOrderHistory()

Usage:

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

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

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

let result = await getOrderHistory(myPhemexExchange, {
             symbol: "sBTCUSDT"
     });

Query trade history

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

https://phemex-docs.github.io#query-trade-history

Function Name:

getTradesHistory()

Usage:

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

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

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

let result = await getTradesHistory(myPhemexExchange, {
             symbol: "sBTCUSDT"
     });

Query PnL

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

https://phemex-docs.github.io#query-pnl

Function Name:

getPnL()

Usage:

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

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

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

let result = await getPnL(myPhemexExchange);

Query chain information

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

https://phemex-docs.github.io#query-chain-information

Function Name:

getChainInfo()

Usage:

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

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

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

let result = await getChainInfo(myPhemexExchange, {currency: "BTC"});

Query deposit address by currency

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

https://phemex-docs.github.io#query-deposit-address-by-currency

Function Name:

getDepositAddress()

Usage:

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

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

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

let result = await getDepositAddress(myPhemexExchange, {
         currency: "BTC",
         chainName: "BTC"
     });

Query recent deposit history

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

https://phemex-docs.github.io#query-recent-deposit-history

Function Name:

getDepositHistory()

Usage:

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

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

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

let result = await getDepositHistory(myPhemexExchange, {
         currency: "BTC"
     });

Query recent withdraw history

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

https://phemex-docs.github.io#query-recent-withdraw-history

Function Name:

getWithdrawHistory()

Usage:

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

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

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

let result = await getWithdrawHistory(myPhemexExchange, {
         currency: "BTC"
     });

Query funds history

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

https://phemex-docs.github.io#query-funds-history

Function Name:

getFundsHistory()

Usage:

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

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

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

let result = await getFundsHistory(myPhemexExchange, {
         currency: "USDT"
     });

Query fee rate by quote currency

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

https://phemex-docs.github.io#query-fee-rate-by-quote-currency

Function Name:

getFeeRate()

Usage:

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

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

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

let result = await getFeeRate(myPhemexExchange, {
         quoteCurrency: "USDT"
     });

Query order book

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

https://phemex-docs.github.io#query-order-book-3

Function Name:

getOrderBook()

Usage:

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

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

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

let result = await getOrderBook(myPhemexExchange, {
         symbol: "sBTCUSDT"
     });

Query full order book

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

https://phemex-docs.github.io#query-full-order-book-2

Function Name:

getOrderBookFull()

Usage:

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

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

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

let result = await getOrderBookFull(myPhemexExchange, {
         symbol: "sBTCUSDT"
     });

Query recent trades

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

https://phemex-docs.github.io#query-recent-trades-2

Function Name:

getRecentTrades()

Usage:

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

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

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

let result = await getRecentTrades(myPhemexExchange, {
         symbol: "sBTCUSDT"
     });

Query 24 hours ticker for all symbols

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

https://phemex-docs.github.io#query-24-hours-ticker-for-all-symbols-2

Function Name:

get24HourTickerAllSymbols()

Usage:

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

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

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

let result = await get24HourTickerAllSymbols(myPhemexExchange);

Query 24 hours ticker

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

https://phemex-docs.github.io#query-24-hours-ticker-2

Function Name:

get24HourTicker()

Usage:

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

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

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

let result = await get24HourTickerAllSymbols(myPhemexExchange);

Last updated