burakoner / OKEx.Net

Open source .Net API wrapper for the @OKEx V5 Rest API and V5 Websocket API
MIT License
86 stars 48 forks source link

How to find out the minimum lot for buying a swap? #73

Closed ZERGULIO closed 2 years ago

ZERGULIO commented 2 years ago

https://www.okx.com/en/trade-market/info/swap Good afternoon, swaps have a concept as a minimum lot for buying, for BTC-USDT-SWAP it is = 0.01 but I can’t find the right method in the api that will return this value to me

burakoner commented 2 years ago

Honestly I dont know. But I researched and find something.

https://www.okx.com/trade-market/info/swap this page doesnt use normal Api endpoints. It calls a request as below

https://www.okx.com/priapi/v5/public/products?t=1666169315967&instType=SWAP&instId=BTC-USD-SWAP,ETH-USD-SWAP,LTC-USD-SWAP,DOT-USD-SWAP,DOGE-USD-SWAP,FIL-USD-SWAP,1INCH-USD-SWAP,ADA-USD-SWAP,ALGO-USD-SWAP,ATOM-USD-SWAP,AVAX-USD-SWAP,BCH-USD-SWAP,BSV-USD-SWAP,CRV-USD-SWAP,DASH-USD-SWAP,EOS-USD-SWAP,ETC-USD-SWAP,GRT-USD-SWAP,IOST-USD-SWAP,IOTA-USD-SWAP,KNC-USD-SWAP,KSM-USD-SWAP,LINK-USD-SWAP,MANA-USD-SWAP,NEO-USD-SWAP,ONT-USD-SWAP,QTUM-USD-SWAP,SAND-USD-SWAP,SOL-USD-SWAP,SUSHI-USD-SWAP,THETA-USD-SWAP,TRX-USD-SWAP,UNI-USD-SWAP,XLM-USD-SWAP,XMR-USD-SWAP,XRP-USD-SWAP,XTZ-USD-SWAP,YFI-USD-SWAP,YFII-USD-SWAP,ZEC-USD-SWAP,BTC-USDT-SWAP,ETH-USDT-SWAP,LTC-USDT-SWAP,DOT-USDT-SWAP,DOGE-USDT-SWAP,APT-USDT-SWAP,ETHW-USDT-SWAP,LUNC-USDT-SWAP,LUNA-USDT-SWAP,FIL-USDT-SWAP

Api docs dont have this endpoint. But there is an endpoint as below https://www.okx.com/docs-v5/en/#rest-api-public-data-get-instruments

Try to use GetInstruments() method in OKEx.Net and there is a ContractValue property. I think it is the minimum value.

ZERGULIO commented 2 years ago

Honestly I dont know. But I researched and find something.

https://www.okx.com/trade-market/info/swap this page doesnt use normal Api endpoints. It calls a request as below

https://www.okx.com/priapi/v5/public/products?t=1666169315967&instType=SWAP&instId=BTC-USD-SWAP,ETH-USD-SWAP,LTC-USD-SWAP,DOT-USD-SWAP,DOGE-USD-SWAP,FIL-USD-SWAP,1INCH-USD-SWAP,ADA-USD-SWAP,ALGO-USD-SWAP,ATOM-USD-SWAP,AVAX-USD-SWAP,BCH-USD-SWAP,BSV-USD-SWAP,CRV-USD-SWAP,DASH-USD-SWAP,EOS-USD-SWAP,ETC-USD-SWAP,GRT-USD-SWAP,IOST-USD-SWAP,IOTA-USD-SWAP,KNC-USD-SWAP,KSM-USD-SWAP,LINK-USD-SWAP,MANA-USD-SWAP,NEO-USD-SWAP,ONT-USD-SWAP,QTUM-USD-SWAP,SAND-USD-SWAP,SOL-USD-SWAP,SUSHI-USD-SWAP,THETA-USD-SWAP,TRX-USD-SWAP,UNI-USD-SWAP,XLM-USD-SWAP,XMR-USD-SWAP,XRP-USD-SWAP,XTZ-USD-SWAP,YFI-USD-SWAP,YFII-USD-SWAP,ZEC-USD-SWAP,BTC-USDT-SWAP,ETH-USDT-SWAP,LTC-USDT-SWAP,DOT-USDT-SWAP,DOGE-USDT-SWAP,APT-USDT-SWAP,ETHW-USDT-SWAP,LUNC-USDT-SWAP,LUNA-USDT-SWAP,FIL-USDT-SWAP

Api docs dont have this endpoint. But there is an endpoint as below https://www.okx.com/docs-v5/en/#rest-api-public-data-get-instruments

Try to use GetInstruments() method in OKEx.Net and there is a ContractValue property. I think it is the minimum value.

image Thank you, yes it helped, I didn’t pay attention that the instrument was BTC-USD-SWAP and I needed BTC-USDT-SWAP image