2021Year8Month

Crypto triangle arbitrage dashboard, part 3: how to add logging

Logging to a storage medium is useful for troubleshooting and analysis when any note-worthy events have occurred. In this article, we will do a quick update to the code base we created in part 1: Crypto triangle arbitrage dashboard: how to, part 1 to add logging to a file for our rust backend. We will add logging to stdout and a file making use of the log4rs crate. For details on how to use log4rs please check out my article about basic file logging with log4rs. Prerequisites Since we are updating the existing code base for the crypto triangle arbitrage…

Crypto triangle arbitrage: how to part 2: frontend

In this article, we will create a quick and dirty crypto triangle arbitrage dashboard frontend with React, to display the triangle arbitrage calculation results and related data. The dashboard will connect to our backend, described in the article: Crypto triangle arbitrage dashboard: how to, part 1, using a WebSocket connection. Then, the triangle arbitrage data received from the backend will be displayed in a simple table. The completed React project can be found on my GitHub: here. Prerequisites The following is required to be able to follow the article and run the frontend and receive data: The completed code project…

Basic how to log to a file in Rust with log4rs

In this article, we will take look at how you can use and configure log4rs to log to a file in your Rust program. Specifically, we will look at some of the options using YAML to configure the logging. What is log4rs From the crate description: “log4rs is a highly configurable logging framework modeled after Java’s Logback and log4j libraries.” For the log4rs crate’s page click here. Why log4rs What is good about log4rs? It offers an easy way to log to a file and it is highly configurable using a YAML config file, as well as through code. However,…

Rust Web3 connect to Ethereum blockchain: how to

In this article for semi-beginners, we are going to learn how to connect to Ethereum with the web3 crate and Rust. We will connect using a WebSocket and then retrieve the balance of our account. Finally, we will use a token smart contract to retrieve information about the token. Please note that we will be using the Rinkeby test network for our interactions. So, if an address for a smart contract or token doesn’t seem to work, make sure that you are using the Rinkeby network. Please look at my GitHub for the full project: rust-web3-basics-tutorial. Please also see this…

Easy to set up Ethereum connection and wallet

In this short article, we look at an option for an easy way to set up an Ethereum node connection and a wallet. We will also look at how to get test Eth for testing purposes. These are the things we need to test and use the applications that interact with the Ethereum blockchain. Which we will develop in other articles. The easiest way is to use services and apps. In this article, we will look at infura.io for Ethereum node connections and metamask for wallets. The information in this post is a prerequisite to follow my article on Rust…

Crypto triangle arbitrage dashboard: how to, part 1

This article is part 1 of a series that will explain how to build a crypto triangle arbitrage dashboard using Rust and React. In this part 1, we will build the backend for the triangle arbitrage dashboard. The backend will gather data about trades for 3 coin pairs from the Binance WebSocket API. Then, it will calculate potential profits if we were to trade the pairs in sequence. Triangle arbitrage attempts to take advantage of price discrepancies between 3 assets that form a triangle on the same exchange. An example trade would be: BTC -> ETH -> BNB -> BTC.…