Skip to content

Instantly share code, notes, and snippets.

Created July 28, 2022 13:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
FTX Withdrawals
import ftx
import json
import random
#Fill in your FTX API Keys above
coin = 'BTC'
#change COIN to 'ETH' for Ethereum, 'ADA' for Cardano (etc)
size = 0.01
#Change size to crypto amount you want to withdrawal
withdrawAllAvailable = True
#Set withdrawAllAvailable to True to override the size and withdraw everything. Set to False to use the size variable
btcAddress1 = ""
withdrawal_addresses = [btcAddress1]
#add one address to always withdraw to that single address: ["btcaddress1"]
#add multiples to randomly withdraw to one of many addresses (better privacy): ["btcaddress1","btcaddress2","btcaddress3"]
address = random.choice(withdrawal_addresses)
tag = None
method = None
#Method optional; blockchain to use for withdrawal see documentation
password = None
#Password optional; withdrawal password if it is required for your account
code = None
#Code optional; 2fa code if it is required for your account you would need to integrate with Authy/Google Authenticator for this to work
client = ftx.FtxClient(api_key=YOUR_API_KEY, api_secret=YOUR_API_SECRET)
#EX: coin = 'BTC' or coin = 'USD' or coin = 'ETH'
def getCoinAvailableForWithdrawalBalance(coin):
balances = client.get_balances()
availableForWithdrawal = list(filter(lambda balance: balance['coin'] == coin,balances))[0]['availableForWithdrawal']
return availableForWithdrawal
def withdrawCoin():
size = getCoinAvailableForWithdrawalBalance(coin)
withdrawal = client.request_withdrawal(coin, size, address, tag, method, password, code)
def lambda_handler(event, context):
return {
'statusCode': 200,
'body': json.dumps('Withdrawal sent!')
Copy link

rhettre commented Jul 28, 2022

FTX Withdrawal Documentation:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment