tiagosiebler / okx-api

Node.js SDK for the OKX APIs and WebSockets, with TypeScript & browser support, integration tests, beautification & more.
MIT License
90 stars 26 forks source link

Rest client submitOrder/getPositions instType #35

Closed pegaltier closed 8 months ago

pegaltier commented 11 months ago

I'm trying to use the Rest client but I see two issues so far:

tiagosiebler commented 10 months ago

Hi @pegaltier , I believe "positions" are a concept that exchanges typically don't associate with spot trading, you would need to track your own cost averages/positions while trading on spot markets. You can see in the api docs that "spot" is not a supported instType for this method: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-positions

Regarding futures, you would need to set the tdMode parameter. Spot markets are when submitting a market order with tdMode: 'cash'