Coinbase Advanced Trade API Tutorial | Official Python SDK

Sdílet
Vložit
  • čas přidán 17. 07. 2024
  • In this video I show you how to get started with the official Coinbase Advanced Trade Python SDK. This SDK is maintained by Coinbase with all the latest features of Coinbase Advanced Trade. Later this summer I’ll be integrating this SDK with my Python wrapper so that we get all the updates from Coinbase for free and we get to keep all the trading strategy work that we’ve already built out for fear and greed buys, the Alphasquared API, and maybe other indicators in the future from places like Glassnode.
    🔵 Official Coinbase SDK: github.com/coinbase/coinbase-...
    👾 Coinbase Developer Discord: / discord
    💻 Rhett’s Python Wrapper: github.com/rhettre/coinbase-a...
    🎥 Rhett’s Python Wrapper Tutorial: • I Built a Coinbase Adv...
    👾 Join my Discord to work with like minded programmers and Bitcoiners: / discord
    🔑 API Key Best Practices: docs.cdp.coinbase.com/develop...
    🆔 Unique Order ID Documentation: docs.cdp.coinbase.com/advance...
    🎥 How to install python: • How to Install Python ...
    🎥 How to use Cursor.sh (my favorite coding IDE): • How to Learn Python Pr...
    🎥 What is Alphasquared: • The Best Bitcoin Strat...
    Code we executed in this video:
    from coinbase.rest import RESTClient
    from json import dumps
    ###Replace with your own API Keys
    api_key = "organizations/{org_id}/apiKeys/{key_id}"
    api_secret = "-----BEGIN EC PRIVATE KEY-----
    YOUR PRIVATE KEY
    -----END EC PRIVATE KEY-----
    "
    client = RESTClient(api_key=api_key, api_secret=api_secret)
    ###Get account balances
    accounts = client.get_accounts()
    print(dumps(accounts, indent=2))
    ###Place a buy order for $1 of BTC-USDC
    order = client.market_order_buy(client_order_id="clientOrderId", product_id="BTC-USDC”, quote_size="1")
    print(dumps(order, indent=2))
    0:00 Coinbase Advanced Trade SDK
    1:15 Installing the SDK
    1:50 Authenticate with Coinbase
    7:47 Making Buy Orders
    10:08 Advanced Features
    11:34 Trading Bots

Komentáře • 7

  • @TEDDY-hr5if
    @TEDDY-hr5if Před dnem

    Hi, thank you for making this great video. Could you please make a video on installing and integrating your pyton wraper with a cloud server (like Heroku) and how to integrate strategy software like TradingView and TrendSpider via webhooks with the official Coinbase Advanced Trade Python SDK? Thank you.

  • @mikez266
    @mikez266 Před 27 dny

    Would love to see a video where you stream and store price data for btc or ether and automate a strategy to a run at certain time of day based on something like a 20 day moving average (for example). Thanks for the videos!

    • @RhettReisman
      @RhettReisman  Před 18 dny +1

      Cheers Mike. We might need to integrate to the websocket to constantly sample the price. I'm going to work on building out some of the functionality and porting it into AWS might be some interesting use cases like that.

  • @JB-gx1rt
    @JB-gx1rt Před 24 dny

    Great video Rhett! Will it be possible with this new SDK to use the PINE scripting language in Tradingview to trigger trades in Coinbase Pro maybe using the Websocket API client?

    • @RhettReisman
      @RhettReisman  Před 24 dny

      I’ve never heard of / used PINE but I imagine so - especially via the websocket. If you feed all the code to ChatGPT it might be able to give good recommendations. Definitely a good idea to look into in the future - feel free to book some time on my calendar (Rhett.blog/calendar) or join the discord I’m interested in building out use cases like this in the future.

  • @nbs77c
    @nbs77c Před 18 dny

    great video, next time could you please integrate coin base api to a telegram bot that sell digital goods?

    • @RhettReisman
      @RhettReisman  Před 16 dny

      I would have to better understand the use case. Another viewer has already integrated into telegram - not sure if they’ve already joined the discord (Rhett.blog/discord)