LeeChunHao2000 / ftx-api-wrapper-python3

FTX Exchange API wrapper in python3
MIT License
34 stars 7 forks source link

Introduce a "failsafe" flag for risky private operations #12

Open zevaverbach opened 3 years ago

zevaverbach commented 3 years ago

For any private operations which are "risky" -- meaning that they'll actually do something with assets when they're called, like buy/sell assets -- what do you think about an im_sure flag which defaults to False? And it could maybe raise an exception when it's set to False saying "Please set im_sure to True if you want this transaction to go through."

LeeChunHao2000 commented 3 years ago

This is good, and maybe I can support withdraw feature with pyOTP, what do you think?

zevaverbach commented 3 years ago

That's a cool idea! Although I also respect your original choice of not implementing withdrawals. The main strength of this is for algorithmic trading, right?

For that reason, I'm rethinking my suggestion to add failsafes. What do you think?

LeeChunHao2000 commented 3 years ago

Yes, I think failsafes is a good idea that users can decide how much they wanna risk.

zevaverbach commented 3 years ago

Can you give an example of how that API might work?

LeeChunHao2000 commented 3 years ago

which one?

zevaverbach commented 3 years ago

withdrawal with an OTP

LeeChunHao2000 commented 3 years ago

Params here, the last param code is 2fa code, we can get it via this lib.

totp = pyotp.TOTP('secret get from FTX 2fa setting')
totp.now() # => '492039'
zevaverbach commented 3 years ago

but how would you integrate it with withdrawal methods?

LeeChunHao2000 commented 3 years ago

Sorry for late, I will integrate this part after I finish final exam.