Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while placing borrow order. #230

Closed
alokym86 opened this issue Sep 9, 2024 · 3 comments · Fixed by #231
Closed

Error while placing borrow order. #230

alokym86 opened this issue Sep 9, 2024 · 3 comments · Fixed by #231

Comments

@alokym86
Copy link
Contributor

alokym86 commented Sep 9, 2024

Looks like the method SpotApi.Margin.BorrowAsync() should request with IOC or FOK as timeInForce parameter, not ImmediateOrCancel or FillOrKill. Here API endpoint doc https://www.kucoin.com/docs/rest/margin-trading/margin-trading-v3-/margin-borrowing.

To Reproduce

var restClient = new KucoinRestClient(options =>
        {
            options.ApiCredentials =
                new KucoinApiCredentials("key", "secret", "passphrase");
        })
var response = await restClient.SpotApi.Margin.BorrowAsync(
            asset: "LINK",
            quantity: 2.0m
            timeInForce: TimeInForce.FillOrKill
        );

Debug logging

Sending POST api/v3/margin/borrow authenticated request with body {"currency":"LINK","size":2.0,"timeInForce":"FillOrKill"}
...
200 - Response received in 357ms: {"msg":"unknown timeInForce","code":"400100"}
@JKorf
Copy link
Owner

JKorf commented Oct 8, 2024

Has been fixed in the latest version

@JKorf JKorf closed this as completed Oct 8, 2024
@JKorf
Copy link
Owner

JKorf commented Oct 8, 2024

Sorry, seems like this wasn't in the release yet

@JKorf JKorf reopened this Oct 8, 2024
@JKorf JKorf closed this as completed in #231 Oct 9, 2024
@JKorf
Copy link
Owner

JKorf commented Oct 14, 2024

It's been fixed in last release now

@JKorf JKorf reopened this Oct 14, 2024
@JKorf JKorf closed this as completed Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants