Skip to content

Instantly share code, notes, and snippets.

@iicc1
Created September 7, 2019 15:43
Show Gist options
  • Save iicc1/453b9b169431a0372b5454da79b67d2d to your computer and use it in GitHub Desktop.
Save iicc1/453b9b169431a0372b5454da79b67d2d to your computer and use it in GitHub Desktop.
Matlab Script created to evaluate LTO Network staking techniques graphically
close all;
clc;
initial_amount = 50000;
apr = 0.07;
divisions = 24;
n = [1:1:divisions];
divisions_apr = apr / divisions;
end_amount_nostake = initial_amount;
end_amount_nocompound = initial_amount * (1 + (divisions_apr .* n));
end_amount_standard = initial_amount * ((1 + divisions_apr).^(n)) - n;
end_amount_continuous = initial_amount * exp((divisions_apr) * n);
figure
plot(n, end_amount_nostake)
hold on
plot(n, end_amount_nocompound, 'r', 'LineWidth', 1)
hold on
plot(n, end_amount_standard, 'b', 'LineWidth', 1)
hold on
plot(n, end_amount_continuous, 'g', 'LineWidth', 1)
title('LTO staking interest comparison over a year')
xlabel('15 day timeframes');
ylabel('Total LTO amount');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment