Account & Subaccount
Documentation on interacting with a variety of OKX account and subaccount API endpoint functions through the PENDAX Javascript SDK.
All Account and Subaccount API endpoints require authentication. Please create OKX API keys to interact with these functions successfully.
Account
Get Balance
Function Name:
getBalances()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 getBalances(exchange, options) {
try {
let result = await exchange.getBalances(options);
console.log(result);
} catch (error) {
console.log(error.message);
}
}
const result = await getBalances(myOkxAccount)Get Positions
Function Name:
Usage:
Get Positions History
Function Name:
Usage:
Get Account and Position Risk
Function Name:
Usage:
Get Bills Details (last 7 days)
Function Name:
Usage:
Get Bills Details (last 3 months)
Function Name:
Usage:
Get Account Configuration
Function Name:
Usage:
Set Position Mode
Function Name:
Usage:
Set Leverage
Function Name:
Usage:
Get Maximum Buy/Sell Amount or Open Amount
Function Name:
Usage:
Get Maximum Available Tradable Amount
Function Name:
Usage:
Increase/Decrease Margin
Function Name:
Usage:
Get Leverage
Function Name:
Usage:
Get The Maximum Loan Of Instrument
Function Name:
Usage:
Get Fee Rates
Function Name:
Usage:
Get Interest Accrued Data
Function Name:
Usage:
Get Interest Rate
Function Name:
Usage:
Set Greeks
Function Name:
Usage:
Isolated Margin Trading Settings
Function Name:
Usage:
Get Maximum Withdrawals
Function Name:
Usage:
Get Account Risk State
Function Name:
Usage:
VIP Loans Borrow and Repay
Function Name:
Usage:
Get Borrow and Repay History for VIP Loans
Function Name:
Usage:
Get Borrow Interest and Limit
Function Name:
Usage:
Position Builder
Function Name:
Usage:
Get Greeks
Function Name:
Usage:
Subaccount
View Subaccount List
Function Name:
Usage:
Get Subaccount Trading Balance
Function Name:
Usage:
Get Subaccount Funding Balance
Function Name:
Usage:
History of Subaccount Transfer
Function Name:
Usage:
Master Accounts Manage the Transfers Between Subaccounts
Function Name:
Usage:
Set Permission of Transfer Out
Function Name:
Usage:
Get Custody Trading Subaccount List
Function Name:
Usage:
Last updated