Grid Trading

Documentation on interacting with a OKX's native Grid Trading programmatic API functions through the PENDAX Javascript SDK.

All Grid Trading API endpoints require authentication. Please create OKX API keys to interact with these functions successfully. Accounts must be funded or collateralized for any trades to successfully post.

Grid Trading

Place Grid Algo Order

circle-info

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

https://www.okx.com/docs-v5/en/#rest-api-grid-trading-place-grid-algo-orderarrow-up-right

Function Name:

placeGridAlgoOrder()

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 placeGridAlgoOrder(exchange, options) {
    try {
        let result = await exchange.placeGridAlgoOrder(options);
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await placeGridAlgoOrder(myOkxAccount,
{
    instId: "BTC-USDT",
    algoOrdType: "grid",
    maxPx: "5000",
    minPx: "400",
    gridNum: "10",
    runType: "1",
    quoteSz: "25"
})

Amend Grid Algo Order

circle-info

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

https://www.okx.com/docs-v5/en/#rest-api-grid-trading-amend-grid-algo-orderarrow-up-right

Function Name:

Usage:

Stop Grid Algo Order

circle-info

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

https://www.okx.com/docs-v5/en/#rest-api-grid-trading-stop-grid-algo-orderarrow-up-right

Function Name:

Usage:

Get Grid Algo Order List

circle-info

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

https://www.okx.com/docs-v5/en/#rest-api-grid-trading-get-grid-algo-order-listarrow-up-right

Function Name:

Usage:

Get Grid Algo Order History

circle-info

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

https://www.okx.com/docs-v5/en/#rest-api-grid-trading-get-grid-algo-order-historyarrow-up-right

Function Name:

Usage:

Get Grid Algo Order Details

circle-info

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

https://www.okx.com/docs-v5/en/#rest-api-grid-trading-get-grid-algo-order-detailsarrow-up-right

Function Name:

Usage:

Get Grid Algo Sub Orders

circle-info

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

https://www.okx.com/docs-v5/en/#rest-api-grid-trading-get-grid-algo-sub-ordersarrow-up-right

Function Name:

Usage:

Get Grid Algo Order Positions

circle-info

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

https://www.okx.com/docs-v5/en/#rest-api-grid-trading-get-grid-algo-order-positionsarrow-up-right

Function Name:

Usage:

Spot Grid Withdraw Income

circle-info

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

https://www.okx.com/docs-v5/en/#rest-api-grid-trading-spot-moon-grid-withdraw-incomearrow-up-right

Function Name:

Usage:

Last updated