Cryptocurrency
Articles related to programming applications dealing with cryptocurrency.
Solana wallet with Rust: get started now
In this tutorial, we will learn the basics of Solana development by programming a software wallet with Rust. What is a cryptocurrency wallet? A cryptocurrency wallet’s primary function is storing keys that allow you to send and receive cryptocurrency, in this case, Solana. This wallet can be a device or software program. For this tutorial, we will write a Solana wallet with Rust that can generate keys and perform actions. With our wallet application, we will be able to: All this using Rust code. To help us easily connect to Solana RCP servers we will use Solana crates like: solana_client…
Solana transactions per second: how to with Rust
In this tutorial, we will learn how to count Solana transactions per second (TPS) using the Rust programming language. We will look at how to connect to the Solana blockchain API using the Solana SDK crates. Using this simple program we will learn some basics about using the Solana crates for Rust. Our program will count non-vote transactions over the course of some time period and then calculate the transactions per second. The repository with the whole project can be found here: https://github.com/tmsdev82/solana-count-tps Contents1 What is Solana?2 Prerequisites3 Project setup4 Connecting to a Solana RPC server4.1 Get Solana core version4.2…
Kucoin API with Rust how to get symbol ticker data
In this tutorial, we are going to look at how to get cryptocurrency symbol ticker data from the KuCoin WebSocket Futures API with Rust. We will be using the public WebSocket API and we will connect to it using Rust and the Tungstenite crate. The Symbol ticker data stream sends real-time price data for cryptocurrency futures symbols. At the end of this tutorial we will have a program that can: connect to the KuCoin cryptocurrency futures WebSocket API. retrieve all available cryptocurrency futures symbols from the REST API. subscribe to streams for all the cryptocurrency futures symbols. process incoming WebSocket…
Build a crypto wallet using Rust: steps how to
In this tutorial, we are going to build a crypto wallet with Rust. The aim of this tutorial is to be educational. To learn the concepts of what it takes to implement a crypto wallet. That means we will dive a bit deeper than if we were to use more helper crates. We will go through the process of creating our very own crypto wallet step by step. Our end result will be a wallet that is able to manage Ethereum based assets. Specifically, it will be able to send and receive cryptocurrency. The completed project can be found on…
Rust Web3 token transactions from blocks: how to
In this tutorial, we will learn about how to get token transactions info with Web3 and Rust. What we will learn is how to get the latest block’s transactions. Then loop through those transactions, find which of them are ERC20 smart contracts, get the token name, and also which method was used in the transaction. For example, approval, transfer, mintItem, etc. that kind of thing. This is a follow-up to my article: Rust Web3 connect to Ethereum blockchain: how to. Note: since we will not be performing any transactions in this project, it is safe to use a connection to…
How to: technical indicators with Rust and Binance
In this tutorial, we will learn how to implement technical indicators with Rust using data from Binance. The aim of this tutorial is to be a fun exercise for people who are starting out with Rust and want to see a practical example of writing basic functions. First, we will implement algorithms for the following technical indicators: Simple Moving Average (SMA), Exponential Moving Average (EMA), Moving Average Convergence Divergence (MACD), Bollinger Bands (BOLL), and the Relative Strength Index (RSI). Then, we will download historical data from the Binance API and use that to apply our algorithms. We will also look…
How to swap on Uniswap V2 with Rust Web3
In this article, we will go through the steps of how to swap tokens on Uniswap V2 with Rust and Web3. Using the Rust programming language we will connect to the Ethereum (test) network and interact with Uniswap. There are multiple versions of Uniswap, but in this article, we will perform transactions with Uniswap V2. Important: We will use infura.io to get a connection to an Ethereum node for this article. Infura.io will not maintain any private keys on our behalf to sign transactions with. That means we have to sign the transactions ourselves and send a raw transaction. Instead…
Binance API crypto transaction with Rust: how to
In this article, we are going to learn how to do a buy transaction of crypto with the Binance API. As usual, we will be using the rust programming language. The full project’s repository can be found on my GitHub. I also have another article related to the Binance API: Easily connect to Binance WebSocket streams with Rust Prerequisites To be able to follow this article you should have: Rust installed Some familiarity with Rust and programming against a REST API is helpful. A Binance account. Verification on your Binance account so that you can create an API key. To…
Easily connect to Binance WebSocket streams with Rust
In this article, we will look at how to connect to Binance WebSocket streams with Rust. We will be using the tungstenite library to make a WebSocket connection. For this tutorial, we will only use the public market data channels, so there is no need to register for an API key. Go to my Github to find the complete project here. This article is one of the first steps in a series of articles for building a triangle arbitrage dashboard using Binance cryptocurrency trading streams. Other articles in this series: The next step can be found at: Rust Warp WebSocket…