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 Futures Account Balance
  • GET Positions
  • GET Margin Mode
  • GET Multiple Leverage
  • Set Leverage
  • Place Order
  • Place Multiple Orders
  • Place TPSL Order
  • Cancel Order
  • Cancel Multiple Orders
  • Cancel TPSL Order
  • GET Active Orders
  • GET Active TPSL Orders
  • Close Positions
  • GET TPSL Order History
  • GET Trade History
  1. PENDAX
  2. Using PENDAX SDK
  3. BloFin Functions

Trading

PreviousPublic DataNextUser

Last updated 1 year ago

GET Futures Account Balance

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

Function Name:

getFuturesAccountBalance()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getFuturesAccountBalance(myBlofinExchange, 
});

GET Positions

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

Function Name:

getPositions()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getPositions(myBlofinExchange, 
});

GET Margin Mode

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

Function Name:

getMarginMode()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getMarginMode(myBlofinExchange, 
});

GET Multiple Leverage

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

Function Name:

getMultipleLeverage()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getMultipleLeverage(myBlofinExchange, 
});

Set Leverage

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

Function Name:

setLeverage()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await setLeverage(myBlofinExchange, 
});

Place Order

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

Function Name:

placeOrder()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await placeOrder(myBlofinExchange, {
	instId: "<String>",
	marginMode: "<String>",
	side: "<String>",
	orderType: "<String>",
	price: "<String>",
	size: "<String>"
});

Place Multiple Orders

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

Function Name:

placeMultipleOrders()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await placeMultipleOrders(myBlofinExchange, 
});

Place TPSL Order

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

Function Name:

placeTPSLOrder()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await placeTPSLOrder(myBlofinExchange, {
	instId: "<String>",
	marginMode: "<String>",
	positionSide: "<String>",
	side: "<String>",
	tpTriggerPrice: "<String>"
});

Cancel Order

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

Function Name:

cancelOrder()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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(myBlofinExchange, 
});

Cancel Multiple Orders

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

Function Name:

cancelMultipleOrders()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await cancelMultipleOrders(myBlofinExchange, 
});

Cancel TPSL Order

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

Function Name:

cancelTPSLOrder()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await cancelTPSLOrder(myBlofinExchange, 
});

GET Active Orders

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

Function Name:

getActiveOrders()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getActiveOrders(myBlofinExchange, 
});

GET Active TPSL Orders

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

Function Name:

getActiveTPSLOrders()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getActiveTPSLOrders(myBlofinExchange, 
});

Close Positions

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

Function Name:

closePositions()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await closePositions(myBlofinExchange, {
	instId: "<String>",
	marginMode: "<String>"
});

GET TPSL Order History

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

Function Name:

getTPSLOrderHistory()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getTPSLOrderHistory(myBlofinExchange, 
});

GET Trade History

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

Function Name:

getTradeHistory()

Usage:

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

   let myBlofinExchange  = createExchange({
      exchange: "blofin",
      authenticate: "true",
      key: "myKey",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "blofin"
  });

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

let result = await getTradeHistory(myBlofinExchange, 
});

⚫
💡
💻
https://docs.blofin.com/index.html#get-futures-account-balance
https://docs.blofin.com/index.html#get-positions
https://docs.blofin.com/index.html#get-margin-mode
https://docs.blofin.com/index.html#get-multiple-leverage
https://docs.blofin.com/index.html#set-leverage
https://docs.blofin.com/index.html#place-order
https://docs.blofin.com/index.html#place-multiple-orders
https://docs.blofin.com/index.html#place-tpsl-order
https://docs.blofin.com/index.html#cancel-order
https://docs.blofin.com/index.html#cancel-multiple-orders
https://docs.blofin.com/index.html#cancel-tpsl-order
https://docs.blofin.com/index.html#get-active-orders
https://docs.blofin.com/index.html#get-active-tpsl-orders
https://docs.blofin.com/index.html#close-positions
https://docs.blofin.com/index.html#get-tpsl-order-history
https://docs.blofin.com/index.html#get-trade-history