liveBook · Manning

Cryptocurrency

As explained in Investing for Programmers

A cryptocurrency is a digitally native asset secured by cryptographic techniques and typically recorded on a distributed ledger.

Cryptocurrency is a digital asset built on blockchain technology, a decentralized ledger whose records are linked and protected by cryptography. Its central use is transferring value directly between people without a trusted third party such as a bank. section 1.2.6

Treat cryptocurrency as both a technical system and a volatile investment asset:

  • Ownership depends on controlling the private key used to sign transactions; without that key, the asset is not owned. section 5.5
  • Staking supports transaction validation and may generate rewards, but payouts fluctuate and do not remove exposure to scams, fraud, or price volatility. section 1.2.6 section 5.5
  • Secure storage matters: minimizing exchange-held assets and using hardware wallets can reduce operational risk. section 5.5

Monitoring cryptocurrency holdings

A Python monitor can combine locked and flexible Binance staking positions with offline assets stored on a hardware ledger. It can then retrieve USD prices from CoinMarketCap, merge prices into a pandas DataFrame, and export total value, holdings, live prices, and staking yield to a worksheet. section 6.5.4

Listing 6.10 Loading data from Binance
from binance.client import Client
binance_client = Client(os.getenv("exchange.binance.api"),
                        os.getenv("exchange.binance.secret"))

locked_assets = pd.DataFrame(                        #1
    [
        (pos["asset"], pos["amount"], pos["apy"]) 
        for pos in binance_client
        .get_simple_earn_locked_product_position()['rows']
], 
columns=[COL_TICKER, COL_AMOUNT, COL_YIELD])        #1

flexible_assets = pd.DataFrame(                           #2
    [(pos["asset"], pos["totalAmount"], 
      pos["latestAnnualPercentageRate"]) 
      for pos in binance_client
     .get_simple_earn_flexible_product_position()['rows']],
      columns=[COL_TICKER, COL_AMOUNT, COL_YIELD])       #2

assets = pd.concat([locked_assets,
                    flexible_assets])              #3
assets = assets.astype({COL_AMOUNT: 'float', 
                        COL_YIELD: 'float', 
                        COL_TICKER: 'string'})    #3
assets.set_index(COL_TICKER, inplace=True)        #3

The listing demonstrates how to authenticate with Binance, retrieve locked and flexible staking positions, normalize them into DataFrames, and combine the results. section 6.5.4

How Investing for Programmers covers it

How deep it goes
Explains blockchain, transactions, private-key ownership, staking, custody, and monitoring implementation without developing protocol internals.
Examples
Uses Bitcoin scarcity, Binance staking positions, CoinMarketCap prices, offline assets, DataFrames, and a crypto worksheet.
What it assumes
Starts with blockchain and cryptocurrency basics before applying staking, custody, and portfolio-monitoring workflows.
What you can do after
Operate/configure a cryptocurrency monitor using Binance, CoinMarketCap, Python, pandas, and spreadsheet price feeds.
How it connects
Connects cryptocurrency to blockchain, cryptography, peer-to-peer transactions, private keys, staking, exchanges, and hardware wallets.

Also explained in

Compare how 2 books explain cryptocurrency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Investing for Programmers. The section links point to the parts of the book it draws on.