Open psychoMLM opened 3 years ago
You can make margin trades by copying his procedure, calling his _post method and changing the endpoint.
Example:
Copy his create_market_order procedure in full. At the bottom he calls:
return self._post('orders', True, data=data)
change your procedure to read
return
Notice that the only difference is the endpoint. They work the same. I've been working with margin orders successfully with this method.
How would i state level of margin like a 4x margin?
Actually, I didn't confront borrowing or repaying via the api. I borrowed and repaid through the KuCoin web interface. I just used python-kucoin to buy and sell with funds already in the margin account. I think there is a way to buy, with "auto-borrow", but you would have to do the calculations for 4x margin yourself.
In general, it's pretty easy to make calls to kucoin's api by copying the procedures you'll find in python-kucoin, and tailoring them to what you need.
I searched documentation and there is no mentions on margin trades.