Skip to content

Instantly share code, notes, and snippets.

View rhettre's full-sized avatar

Rhett Reisman rhettre

View GitHub Profile
@rhettre
rhettre / History|-21d5ac07|entries.json
Last active February 22, 2024 03:12
VS Code Settings
{"version":1,"resource":"file:///Users/rhettre/GitHub/coinbase-advancedtrade-python/coinbase_advanced_trader/strategies/limit_order_strategies.py","entries":[{"id":"Olyr.py","timestamp":1696175884711},{"id":"aSDe.py","timestamp":1696175914650},{"id":"naK6.py","timestamp":1696182219868},{"id":"KWFG.py","timestamp":1696182416911}]}
@rhettre
rhettre / cbpro-get-bank-id.py
Created July 28, 2022 03:13
Get Connected Bank Account IDs (For Deposits)
import json
import cbpro
my_key = ""
my_secret = ""
my_passphrase = ""
def _getBankID(my_key, my_secret, my_passphrase):
auth_client = cbpro.AuthenticatedClient(my_key, my_secret, my_passphrase)
payment_methods = auth_client.get_payment_methods()
@rhettre
rhettre / cbpro-deposits.py
Created July 28, 2022 03:14
Coinbase Pro Deposit USD from Linked Bank Account
import json
import cbpro
my_key = ''
my_secret = ''
my_passphrase = ''
bank_id = ''
def _depositBTC(deposit_amount, cb_key, cb_secret, cb_password, bank_id):
auth_client = cbpro.AuthenticatedClient(cb_key, cb_secret, cb_password)
@rhettre
rhettre / ftx-limit-orders.py
Created July 28, 2022 13:40
FTX Limit Orders
import ftx
import json
YOUR_API_KEY = ""
YOUR_API_SECRET = ""
#change SYMBOL to 'ETH/USD' for ETH (etc)
SYMBOL = 'BTC/USD'
#Change USD_AMOUNT to dollar/fiat amount you want to buy/sell
USD_AMOUNT = 20
#change ORDER_TYPE to 'sell' for sells or 'buy' for buys
@rhettre
rhettre / ftx-withdrawal.py
Created July 28, 2022 13:41
FTX Withdrawals
import ftx
import json
import random
YOUR_API_KEY = ""
YOUR_API_SECRET = ""
#Fill in your FTX API Keys above
coin = 'BTC'
#change COIN to 'ETH' for Ethereum, 'ADA' for Cardano (etc)
@rhettre
rhettre / kraken-limit-orders.py
Last active November 12, 2022 15:00
Kraken Limit Orders
import time
import sys
import json
import base64
import hashlib
import hmac
import urllib.request
import requests
import datetime
@rhettre
rhettre / crypto-gsheet-populator.py
Last active May 31, 2024 02:49
I built this script to populate trades made in any trading pair available on Coinbase Pro or Gemini into a Google Sheet so it would be easier to track trades, profitability, and cost basis. This could be extended to other exchanges. See https://www.youtube.com/watch?v=hutDJ-FVatw for full explanation.
import json
import gspread
import time
import sys
import base64
import hashlib
import hmac
import urllib.request
import requests
from datetime import datetime, timezone
@rhettre
rhettre / kraken_withdrawal.py
Last active August 1, 2024 14:52
Automate Cryptocurrency Withdrawals From Kraken
import time
import requests
import urllib.parse
import hashlib
import hmac
import base64
import json
# Read Kraken API key and secret stored in environment variables
api_url = "https://api.kraken.com"
@rhettre
rhettre / CBAT_limit_orders.py
Last active February 27, 2025 03:15
Place limit orders on Coinbase Advanced Trader for just below/above the spot price for your buys/sells. Executable and automatable in AWS
import http.client
import hmac
import hashlib
import json
import time
import base64
import uuid
from enum import Enum
import math
@rhettre
rhettre / random_example_1.py
Created January 23, 2023 14:29
Generate 5 random numbers. If you pass an integer seed into line 6 random.seed(), you will see that your results will always correspond to that seed number.
import random
print("---RANDOM NUMBERS---")
for i in range(5):
# Any number can be used in place of '0'.
random.seed(5)
# Generated random number will be between 1 to 1000.
print(random.randint(1, 1000))
print("---END---")