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
  • Funding
  • Get Currencies
  • Get Balance
  • Get Account Asset Valuation
  • Funds Transfer
  • Get Funds Transfer State
  • Asset Bill Details
  • Get Deposit Address
  • Get Deposit History
  • Withdrawal
  • Get Withdrawal History
  • Small Assets Convert
  • Get Saving Balance
  • Savings Purchase/Redemption
  • Set Lending Rate
  • Get Lending History
  • Get Public Borrow Info
  • Get Public Borrow History
  • Lightning Deposits
  • Lightning Withdrawals
  • Cancel Withdrawal
  1. PENDAX
  2. Using PENDAX SDK
  3. OKX Functions

Funding

Documentation on interacting with a variety of OKX API functions related to Funding data and information through the PENDAX SDK.

PreviousTrading & OrdersNextConvert

Last updated 2 years ago

All Funding & Account API endpoints require authentication. Please create OKX API keys to interact with these functions successfully.

Funding

Get Currencies

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

Function Name:

fundingGetCurrencies()

Usage:

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

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

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

const result = await fundingGetCurrencies(myOkxAccount)

Get Balance

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

Function Name:

fundingGetBalance()

Usage:

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

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

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

const result = await fundingGetBalance(myOkxAccount)

Get Account Asset Valuation

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

Function Name:

fundingGetAssetValuation()

Usage:

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

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

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

const result = await fundingGetAssetValuation(myOkxAccount)

Funds Transfer

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

Function Name:

fundingAssetTransfer()

Usage:

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

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

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

const result = await fundingAssetTransfer(myOkxAccount,
{
    ccy:"USDT",
    amt:"1.5",
    from:"6",
    to:"18"
})

Get Funds Transfer State

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

Function Name:

fundingGetFundsTransferState()

Usage:

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

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

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

const result = await fundingGetFundsTransferState(myOkxAccount,
{
    transId: "1",
    type: "1"
})

Asset Bill Details

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

Function Name:

fundingGetAssetBillsDetails()

Usage:

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

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

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

const result = await fundingGetAssetBillsDetails(myOkxAccount)

Get Deposit Address

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

Function Name:

fundingGetDepositAddress()

Usage:

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

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

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

const result = await fundingGetDepositAddress(myOkxAccount, 
            {
                ccy: "BTC"
            })

Get Deposit History

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

Function Name:

fundingGetDepositHistory()

Usage:

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

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

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

const result = await fundingGetDepositHistory(myOkxAccount)

Withdrawal

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

Function Name:

fundingWithdrawal()

Usage:

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

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

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

const result = await fundingWithdrawal(myOkxAccount, 
{
    amt:"1",
    fee:"0.0005",
    dest:"4",
    ccy:"BTC",
    chain:"BTC-Bitcoin",
    toAddr:"17DKe3kkkkiiiiTvAKKi2vMPbm1Bz3CMKw"
})

Get Withdrawal History

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

Function Name:

fundingGetWithdrawalHistory()

Usage:

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

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

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

const result = await fundingGetWithdrawalHistory(myOkxAccount)

Small Assets Convert

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

Function Name:

fundingConvertDust()

Usage:

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

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

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

const result = await fundingConvertDust(myOkxAccount,
{
   ccy:["BTC","USDT"]
})

Get Saving Balance

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

Function Name:

fundingGetSavingBalance()

Usage:

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

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

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

const result = await fundingGetSavingBalance(myOkxAccount)

Savings Purchase/Redemption

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

Function Name:

fundingSavingsAndPurchaseRedemption()

Usage:

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

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

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

const result = await fundingSavingsAndPurchaseRedemption(myOkxAccount,
{
    ccy:"BTC",
    amt:"1",
    side:"purchase",
    rate:"0.01"
}
)

Set Lending Rate

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

Function Name:

fundingSetLendingRate()

Usage:

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

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

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

const result = await fundingSetLendingRate(myOkxAccount,
{
    ccy:"BTC",
    rate:"0.02"
}
)

Get Lending History

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

Function Name:

fundingGetLendingHistory()

Usage:

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

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

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

const result = await fundingGetLendingHistory(myOkxAccount)

Get Public Borrow Info

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

Function Name:

fundingGetPublicBorrowInfo()

Usage:

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

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

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

const result = await fundingGetPublicBorrowInfo(myOkxAccount)

Get Public Borrow History

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

Function Name:

fundingGetPublicBorrowHistory()

Usage:

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

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

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

const result = await fundingGetPublicBorrowHistory(myOkxAccount)

Lightning Deposits

Not currently supported

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

Function Name:

fundingLightningDeposit()

Usage:

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

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

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

const result = await fundingLightningDeposit(myOkxAccount,
{
        ccy: "BTC",
        amt: "0.1"
}
)

Lightning Withdrawals

Not currently supported

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

Function Name:

fundingLightningWithdrawal()

Usage:

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

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

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

const result = await fundingLightningWithdrawal(myOkxAccount,
{
    ccy:"BTC",
    invoice:"lnbc100u1psnnvhtpp5yq2x3q5hhrzsuxpwx7ptphwzc4k4wk0j3stp0099968m44cyjg9sdqqcqzpgxqzjcsp5hz"
}
)

Cancel Withdrawal

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

Function Name:

fundingCancelWithdrawal()

Usage:

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

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

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

const result = await fundingCancelWithdrawal(myOkxAccount,
{
   wdId:"1123456"
}
)

⚫
💡
💻
https://www.okx.com/docs-v5/en/#rest-api-funding-get-currencies
https://www.okx.com/docs-v5/en/#rest-api-funding-get-balance
https://www.okx.com/docs-v5/en/#rest-api-funding-get-account-asset-valuation
https://www.okx.com/docs-v5/en/#rest-api-funding-funds-transfer
https://www.okx.com/docs-v5/en/#rest-api-funding-get-funds-transfer-state
https://www.okx.com/docs-v5/en/#rest-api-funding-asset-bills-details
https://www.okx.com/docs-v5/en/#rest-api-funding-get-deposit-address
https://www.okx.com/docs-v5/en/#rest-api-funding-get-deposit-history
https://www.okx.com/docs-v5/en/#rest-api-funding-withdrawal
https://www.okx.com/docs-v5/en/#rest-api-funding-get-withdrawal-history
https://www.okx.com/docs-v5/en/#rest-api-funding-small-assets-convert
https://www.okx.com/docs-v5/en/#rest-api-funding-get-saving-balance
https://www.okx.com/docs-v5/en/#rest-api-funding-savings-purchase-redemption
https://www.okx.com/docs-v5/en/#rest-api-funding-set-lending-rate
https://www.okx.com/docs-v5/en/#rest-api-funding-get-lending-history
https://www.okx.com/docs-v5/en/#rest-api-funding-get-public-borrow-info-public
https://www.okx.com/docs-v5/en/#rest-api-funding-get-public-borrow-history-public
https://www.okx.com/docs-v5/en/#rest-api-funding-lightning-deposits
https://www.okx.com/docs-v5/en/#rest-api-funding-lightning-withdrawals
https://www.okx.com/docs-v5/en/#rest-api-funding-cancel-withdrawal