Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Invalid params when using example #25

Closed
omani opened this issue Jul 24, 2019 · 6 comments
Closed

Invalid params when using example #25

omani opened this issue Jul 24, 2019 · 6 comments

Comments

@omani
Copy link

omani commented Jul 24, 2019

when using for example: getprivatebuy() method, I get:

request failed with code (-32602): Invalid params

generating new models and methods doesnt work since it breaks the Exchange struct.

# github.com/adampointer/go-deribit
./rpc_subscriptions.go:20:3: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:24:4: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:70:3: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:74:4: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:120:3: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:124:4: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:170:3: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:174:4: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:220:3: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:224:4: e.calls undefined (type *Exchange has no field or method calls)
./rpc_subscriptions.go:224:4: too many errors
@omani
Copy link
Author

omani commented Jul 24, 2019

@adampointer maybe you wanna investigate in this. looks like something is broken or I am too stupid to get this working.

@adampointer
Copy link
Owner

Hi.

There was an issue where I had not committed the example code for v3 and the code gen was broken. I have now pushed it up. The example works for me.

Make sure you use github.com/adampointer/go-deribit/v3 in your code.

@omani
Copy link
Author

omani commented Jul 25, 2019

hi,
I still get the following error when I want to buy:

 request failed with code (-32602): Invalid params 

do I have to regenerate the models? or would you generate them and push them into your repo so I can pull?

@adampointer
Copy link
Owner

Hi,

You don't need to regenerate any models. This is an API error from Deribit. It is vague but generally it means you have used some incorrect combination of parameters like trying to open a position when reduce_only is true. One I get a lot is when placing a stop order with a stop_price which would cause it to trigger straight away. My advice is to try it in their API console. Also if you want, dump your parameters object in this thread and I will see if I can spot what you have got wrong.

@omani
Copy link
Author

omani commented Jul 25, 2019

I used the exact copy of the privatebuy part in the example files.
I have enough funds on the balance. and I do it on the main account, accessing it with the API keys of the main account. I have no orders or positions open.

so I dont really understand where the problem is.

@omani
Copy link
Author

omani commented Jul 25, 2019

I've finally found the issue. futures amount is in USD, not in BTC.

ok. this particular error was a layer 8 problem :)

thank you @adampointer

@omani omani closed this as completed Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants