A Rust program for DXdao contributors to calculated owed vested DXD amounts.

Overview

Vested DXD calculator

vested-dxd-calculator is an utility program that DXdao contributors can use to calculate how much DXD they're owed for their services.

Installation

macOS and Linux

For macOS and Linux, installing should be as easy as opening a terminal and running:

curl -L https://raw.githubusercontent.com/luzzif/vested-dxd-calculator/main/install.sh | sh

The installer will ask you for your account's password in order to be able to move the binary to /usr/local/bin. If you don't trust the installation script with sudo access, you can simply download the correct binary for your platform (remember to pick the arm64 version for Mac if you have the M1 chip) from the latest release and manually put it into /usr/local/bin, renaming it to vested-dxd-calculator and making it executable (sudo chmod +x /usr/local/bin/vested-dxd-calculator). After doing so, you should see the command being picked up by whatever shell you like to use.

Windows

Windows installation instructions will be added in the future.

Usage

vested-dxd-calculator takes 4 parameters as input:

  • --from: the date from which the selected period starts from (dd-mm-yyyy format).
  • --to: the date in which the selected period ends (dd-mm-yyyy format)
  • --level: the level the worker was/is at in the specified period.
  • --full-time-percentage: the percentage of time the worker was active in the specified period (1 to 100, supporting decimal values).
  • --trial: pass this flag if the specified period represented a trial (50% of the full payment).

Additionally, you can run vested-dxd-calculator --help to check out all the possible options while using the binary.

How it works

The binary treats pre and post 2022 periods differently due to changes in the salary structure.

Generally speaking, a period cannot start in 2021 and finish in 2022 due to these changes, and in order to perform calculations on the salary, the period cannot be longer than a month.

The compensation tables used for the calculations are the following:

Pre-2022:

Level USD equivalent value of DXD
1 2000
2 3000
3 4000
4 5000
5 6000

Post-2022:

Level USD equivalent value of DXD
1 1500
2 2000
3 3000
4 4000
5 5000
6 6000
7 7500
8 9500

When specifying a period, the program calculates the amount of working days in the month starting from the specified from date and confronts it with the amount of working days in the specified period, in order to calculate a multiplier that will be used to determine the actual USD salary value in the specified period.

Example:

All date are expressed in dd-mm-yyyy format

  • from: 01-10-2020
  • to: 10-10-2020
  • level: 3
  • full-time-percentage: 100
  • trial: false

Working days in the full month from 01-10-2020 to 01-11-2020 as calculated by the binary: 22. Working days in the period as calculated by the binary: 7. The USD value of the salary given out in the period, at level 3 will then be calculated as to be 4000 * 7 / 22 = ~1272.7273.

Now, depending on the other parameters, the salary can be further affected. If the --trial flag is active, the salary will be half of what is would originally have been, while depending on the --full-time-percentage value the salary can be further reduced.

After determining the USD value of the salary, the amount of DXD is determined following 2 separate logics depending on the given period of time:

  • Pre-2022, the DXD ATH vs USD in the start of the given period is simply determined and DXD given out depending on that value.
  • Post-2022, the DXD value in USD at the --from date is used and DXD given out depending on that value.

In both cases, the Covalent API is used to fetch pricing data (Coingecko being the ultimate price source).

Being that Coingecko is used for price data, no price prior to 20-05-2020 is available and the binary will fail in determining the DXD amount to be given

You might also like...
png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance.

png_defringe_rs png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance. U

A launcher/menu program written in Rust for wlroots-based Wayland compositors

tehda tehda (ᴛᴀʏ-dah /ˈteɪ̯.dæ/ or /teh.da/; Finnish for "to do, perform, execute") is a launcher/menu program, like dmenu, rofi, or wofi, written in

A simple command-line calculator program writen with Rust.

Calculator.rs An simple command-line calculator program writen with Rust. Features Math functions support sin(1) = 0.84147098 Variable support a

👀Little program I made in 🦀Rust that reminds me every 20 minutes to look away from my computer 🖥screen.
👀Little program I made in 🦀Rust that reminds me every 20 minutes to look away from my computer 🖥screen.

👀 eye break Little program I made in 🦀 Rust that reminds me every 20 minutes to look away from my computer 🖥 screen. I stay way too long on the com

Use Thunk to build your Rust program that runs on old Windows platforms, support Windows XP and more!

Use Thunk to build your Rust program that runs on old platforms. Thunk uses VC-LTL5 and YY-Thunks to build programs that support old platforms. So, ho

💫 This program allows you to do requests in Rust without reqwest !

Zapros 💫 This program allows you to do requests in Rust without reqwest ! Usage : Get use crate::http_client::HttpClient; use crate::http_client::Htt

Pure Rust Fault Proof Program that runs the rollup state-transition to verify an L2 output from L1 inputs.

palmtop palmtop is a fault proof program that runs the rollup state transition to verify an L2 output from L1 inputs. The verifiable L2 output can the

Translations of a simple C program to Rust.

Translations of a simple C program to Rust This repository contains several translations of Russ Cox's Thompson NFA C program to Rust. Cox's program f

Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.
Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.

paleatra v.0.0.1 Command-Line program that takes an image and produces the copy of the image with a thin frame and palette made of the 10 most frequen

Owner
Federico Luzzi
(:carrot:, :carrot:)
Federico Luzzi
A simple program for C program IO testing. Written in Rust

A simple program for C program IO testing. Written in Rust, using concurrency to speed up valgrind testing. Make sure to update settings at your first run of the program!

null 1 Feb 22, 2022
That program use on platform windows. And if you write any text on uncorrect keyboard layout, that program for that.

?? This program is designed to translate text into the correct layout when typing is incorrect. ?? Example ghbdtn -> привет Just (by default) pressing

Gest Se 5 Jan 26, 2023
A lightweight and super fast cli todo program written in rust under 200 sloc

todo A lightweight and super fast cli todo program written in rust under 200 sloc installation AUR package: todo-bin use cargo build --release to comp

sioodmy 243 Dec 24, 2022
A blinking LED program written in Rust for the AVR

blink A small Hello World Rust application for the AVR. The program itself toggles a LED on PORTB periodically. Designed for the ATmega328p. The AVR-R

The AVR-Rust project 208 Jan 4, 2023
A silly program written in Rust to output nonsensical sentences in the command line interface.

A silly program written in Rust to output nonsensical sentences in the command line interface.

Rachael Ava 1 Dec 13, 2021
A fun rust terminal program so you can make Christmas trees!

Xmastree 2021 A fun christmas tree where you can add ornaments! Then, you can export the file into either: a rust file a txt file About Taking a break

Junhao 2 Dec 21, 2021
A Rust program/library to write a Hello World message to the standard output.

hello-world Description hello-world is a Rust program and library that prints the line Hello, world! to the console. Why was this created? This progra

null 0 May 11, 2022
A Rust port of the command line program playing with the cutscenes files (USM) from Genshin Impact.

GI-cutscenes : Rust Remix A command line program playing with the cutscene files (USM) from Genshin Impact, reimplemented in Rust. Much like its origi

Lymkwi 5 Nov 6, 2022
A little program written in Rust that prints random PNG images to the terminal in text grabbed from an image repo.

Cermic A little program written in Rust that prints random PNG images to the terminal in text grabbed from an image repo. NOTE: As of right now, Cermi

Jackson Novak 7 Oct 1, 2022
A "Hello, Rust!" program for the Flipper Zero

"Hello, Rust!" for the Flipper Zero This is an example of how to build a Rust-based Flipper application that runs from the SD-card. Note: This depends

David Coles 15 Dec 17, 2022