Compendium Trading Tools Documentation
CompendiumPENDAXCompendexOfficial Links
  • ⭐Platform Overview
  • ⚫PENDAX
    • 🌐What is PENDAX?
    • 🖱️PENDAX Capabilities
    • 💾Installing PENDAX modules
    • 💡Using PENDAX SDK
      • 💻Common Functions
      • 💻OKX Functions
        • Trading & Orders
        • Funding
        • Convert
        • Account & Subaccount
        • Grid Trading
        • Market Data
        • Public Data
        • Trading Data
      • 💻Bitget Functions
        • Public (Spot)
        • Market (Spot)
        • Wallet (Spot)
        • Account (Spot)
        • Trade (Spot)
        • Market (Futures)
        • Account (Futures)
        • Trade (Futures)
        • CopyTrade (Futures)
        • Sub Account Interface (Broker)
        • Sub API Interface (Broker)
      • 💻ByBit Functions
        • Market
        • Trading
        • Position
        • Account
        • Asset
        • User
        • Spot Leverage Token
        • Spot Margin Trade (UTA)
        • Spot Margin Trade (Normal)
        • Institutional Lending
      • 💻Mexc Functions
        • Market
        • Sub-Account
        • Spot Account/Trade
        • Wallet
        • ETF
        • Rebate
        • Futures Market
        • Futures Account and Trading
      • 💻Phemex Functions
        • Contract
        • Hedged Contract
        • Spot
        • Margin Trading
        • Transfer
        • Convert
        • Deposit And Withdraw
      • 💻BloFin Functions
        • Websocket
        • Account
        • Affiliate
        • Public Data
        • Trading
        • User
      • 💻BingX Functions
        • Fund Account
        • Wallet Deposits and Withdrawals
        • Sub-Account Managenent
        • Market Data (USDT-M)
        • Account (USDT-M)
        • Trades (USDT-M)
        • Market Data (Coin-M)
        • Trades (Coin-M)
        • Market Data (Spot)
        • Fund Account (Spot)
        • Trades (Spot)
        • CopyTrader
      • ⚠️FTX Functions
    • 📜License Agreement
  • 🟣Compendium App
    • 📈Compendium Trading Tools
    • 🔗Connect An Exchange Account
      • 🗝️OKX.com API Keys
    • 🤖Verified Trading Bots
      • Explore The Marketplace
      • For Algo & Strategy Authors
        • Get Listed & Verified
        • Strategy Monetization
        • Sending Trading Signals
        • Simplified Signal Program
      • For Users & Subscribers
        • Subscribing To Bots
        • Managing A Subscription
    • 💫Copy Trading Groups
      • For Copy Group Leaders
        • Creating A Copy Group
        • Linking Leader Account
        • Important Trading Notes
        • Manage A Copy Group
        • Discord Webhooks Setup
      • For Users & Subscribers
        • Subscribe To Copy Group
        • Link Account To Group
    • 📶Signal Provider Groups
      • For Group Leaders
        • Creating A Signal Group
        • Managing A Signal Group
        • Sending Trading Signals
      • For Users & Subscribers
        • Subscribing To Signal Groups
        • Manage Signal Group Subscription
  • 🔵Compendex Suite
    • 🔮DeFi With Compendex
    • ☀️Solana Integrations
      • Supported Solana Wallets
      • Overview And News
      • Openbook Spot Markets
      • Smart Swap Aggregator
      • NFT Metaverse Markets
      • Solana DeFi Analytics Portal
      • Community Tools List
  • 🪙The CMFI Token Ecosystem
    • 📊Tokenomics Breakdown
    • 🍎Trade Incentive Program
    • 🌊Staking And Liquidity Pools
      • ✨Raydium Liquidity Pools
      • 🐳Orca Liquidity Whirlpools
      • 🐋Orca Liquidity Pools
    • 🐷Compendi-Pigs NFT
  • 👥Community Info
    • ✅Links And Social Pages
    • 🎨Branding Guidelines
Powered by GitBook
On this page
  • Get Single Account
  • Get Account List
  • Get Sub-Account Contract Assets
  • Get Open Count
  • Change Leverage
  • Change Margin
  • Change Margin Mode
  • Change Hold Mode
  • Get Symbol Position
  • Get All Position
  • Get Account Bill
  • Get Business Account Bill
  1. PENDAX
  2. Using PENDAX SDK
  3. Bitget Functions

Account (Futures)

Documentation on interacting with Bitget's Futures Market Account API functions through the PENDAX Javascript SDK.

PreviousMarket (Futures)NextTrade (Futures)

Last updated 8 months ago

Get Single Account

Please refer to the official Bitget API Docs for the required parameters.

Function name:

getSingleAccountFutures(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt",
      testnet: "false"
});

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

const result = await getSingleAccountFutures(myBitgetAccount, 
    {
        symbol: "BTCUSDT_UMCBL",
        marginCoin: "USDT"
    });

Get Account List

Please refer to the official Bitget API Docs for the required parameters.

Function name:

getAccountListFutures(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getAccountListFutures(myBitgetAccount, 
    {
        productType: "umcbl"
    });

Get Sub-Account Contract Assets

Please refer to the official Bitget API Docs for the required parameters.

Function name:

getSubaccountContractAssets(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getSubaccountContractAssets(myBitgetAccount, 
    {
        productType: "umcbl"
    });

Get Open Count

Please refer to the official Bitget API Docs for the required parameters.

Function name:

getOpenCountFutures(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getOpenCountFutures(myBitgetAccount, 
    {
        symbol: "BTCUSDT_UMCBL",
        marginCoin: "USDT",
        openPrice: "23189.5",
        leverage: "20",
        openAmount:"5000"
    });

Change Leverage

Please refer to the official Bitget API Docs for the required parameters.

Function name:

setLeverage(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await setLeverage(myBitgetAccount, 
    {
        symbol: "BTCUSDT_UMCBL",
        marginCoin: "USDT",
        leverage: "2"
    });

Change Margin

Please refer to the official Bitget API Docs for the required parameters.

Function name:

getApiKeyInfo(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await changeMargin(myBitgetAccount, 
    {
        symbol: "BTCUSDT_UMCBL",
        marginCoin: "USDT",
        amount: "-10"
    });

Change Margin Mode

Please refer to the official Bitget API Docs for the required parameters.

Function name:

setMarginMode(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await setMarginMode(myBitgetAccount, 
    {
        symbol: "BTCUSDT_UMCBL",
        marginCoin: "USDT",
        marginMode: "crossed"
    });

Change Hold Mode

Please refer to the official Bitget API Docs for the required parameters.

Function name:

changeHoldMode(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await changeHoldMode(myBitgetAccount, 
    {
        productType: "umcbl",
        holdMode: "double_hold"
    });

Get Symbol Position

Please refer to the official Bitget API Docs for the required parameters.

Function name:

getSymbolPosition(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getSymbolPosition(myBitgetAccount, 
    {
        symbol: "BTCUSDT_UMCBL",
        marginCoin: "USDT"
    });

Get All Position

Please refer to the official Bitget API Docs for the required parameters.

Function name:

getAllPositionsFutures(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getAllPositionsFutures(myBitgetAccount, 
    {
        productType: "umcbl",
        marginCoin: "USDT"
    });

Get Account Bill

Please refer to the official Bitget API Docs for the required parameters.

Function name:

getAccountBill(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getAccountBill(myBitgetAccount, 
    {
        symbol: "BTCUSDT_UMCBL", 
        marginCoin: "USDT",
        startTime: "1659403328000",
        endTime: "1659406928000",
        pageSize: "20"
    });

Get Business Account Bill

Please refer to the official Bitget API Docs for the required parameters.

Function name:

getBusinessAccountBill(options)

Usage:

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

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

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

const result = await getBusinessAccountBill(myBitgetAccount, 
    {
        productType: "umcbl",
        startTime: "1659403328000",
        endTime: "1659406928000",
        pageSize: "20"
    });

⚫
💡
💻
https://bitgetlimited.github.io/apidoc/en/mix/#get-single-account
https://bitgetlimited.github.io/apidoc/en/mix/#get-account-list
https://bitgetlimited.github.io/apidoc/en/mix/#get-sub-account-contract-assets
https://bitgetlimited.github.io/apidoc/en/mix/#get-open-count
https://bitgetlimited.github.io/apidoc/en/mix/#change-leverage
https://bitgetlimited.github.io/apidoc/en/mix/#change-margin
https://bitgetlimited.github.io/apidoc/en/mix/#change-margin-mode
https://bitgetlimited.github.io/apidoc/en/mix/#change-hold-mode
https://bitgetlimited.github.io/apidoc/en/mix/#get-symbol-position
https://bitgetlimited.github.io/apidoc/en/mix/#get-all-position
https://bitgetlimited.github.io/apidoc/en/mix/#get-account-bill
https://bitgetlimited.github.io/apidoc/en/mix/#get-business-account-bill