$ go run cmd/ema_trading_strategy_example/main.go
Trading 'Terra' (LUNA) : 9-Day/21-Day EMS CrossOver Strategy
=============================================================
1. [2021-04-27] buy terra-luna @ 17.6307 -- amount: 10,000.0000 , units: 567.1920
2. [2021-05-13] sell terra-luna @ 14.8174 -- amount: 8,404.2978 , units: 567.1920 [portfolio: 8,404.2978]
3. [2021-07-07] buy terra-luna @ 6.4806 -- amount: 8,404.2978 , units: 1,296.8387
4. [2021-07-21] sell terra-luna @ 5.9036 -- amount: 7,656.0801 , units: 1,296.8387 [portfolio: 7,656.0801]
5. [2021-07-23] buy terra-luna @ 7.3690 -- amount: 7,656.0801 , units: 1,038.9540
6. [2021-09-22] sell terra-luna @ 24.9468 -- amount: 25,918.5351 , units: 1,038.9540 [portfolio: 25,918.5351]
7. [2021-09-24] buy terra-luna @ 36.4343 -- amount: 25,918.5351 , units: 711.3775
8. [2021-10-17] sell terra-luna @ 36.7548 -- amount: 26,146.5548 , units: 711.3775 [portfolio: 26,146.5548]
9. [2021-10-21] buy terra-luna @ 42.8015 -- amount: 26,146.5548 , units: 610.8788
10. [2021-11-19] sell terra-luna @ 40.2905 -- amount: 24,612.6431 , units: 610.8788 [portfolio: 24,612.6431]
11. [2021-11-30] buy terra-luna @ 51.5801 -- amount: 24,612.6431 , units: 477.1735
12. [2022-01-09] sell terra-luna @ 66.9792 -- amount: 31,960.7004 , units: 477.1735 [portfolio: 31,960.7004]
13. [2022-01-16] buy terra-luna @ 87.6574 -- amount: 31,960.7004 , units: 364.6091
14. [2022-01-22] sell terra-luna @ 64.3927 -- amount: 23,478.1657 , units: 364.6091 [portfolio: 23,478.1657]
15. [2022-02-25] buy terra-luna @ 65.4442 -- amount: 23,478.1657 , units: 358.7510
- Number of txns : 15
- First buy : 2021-04-27
- Last sell : 2022-01-22 (270 days after first buy)
- Initial investment : 10,000.00
- Portfolio value : 26,999.00
- P/L : 169.99 %
$ go run cmd/yield_farming_example/main.go
CoinGecko says: (V3) To the Moon!
Downloaded data : terra-luna-365-days-usd
Downloaded data : osmosis-365-days-usd
[2021-07-01] position : 10,000.00 (IL: 0.00 , hodl: 10,000.00 , APR: 99.00 % , a: 6.54 , b: 4.01 , units: 764.00 / 1,247.38)
[2021-07-02] position : 8,729.15 (IL: 0.07 , hodl: 8,735.00 , APR: 98.85 % , a: 5.93 , b: 3.37 , units: 736.54 / 1,293.88)
[2021-07-03] position : 8,646.05 (IL: -0.26 , hodl: 8,623.95 , APR: 98.70 % , a: 5.74 , b: 3.40 , units: 753.11 / 1,272.28)
[2021-07-04] position : 8,792.81 (IL: -0.53 , hodl: 8,746.45 , APR: 98.55 % , a: 5.81 , b: 3.45 , units: 756.42 / 1,273.57)
[2021-07-05] position : 9,032.71 (IL: -0.80 , hodl: 8,961.16 , APR: 98.40 % , a: 5.97 , b: 3.53 , units: 757.03 / 1,279.43)
[2021-07-06] position : 9,404.48 (IL: -1.08 , hodl: 9,303.98 , APR: 98.25 % , a: 6.15 , b: 3.69 , units: 764.61 / 1,273.58)
[2021-07-07] position : 8,955.39 (IL: -0.70 , hodl: 8,892.94 , APR: 98.10 % , a: 6.48 , b: 3.16 , units: 690.94 / 1,416.98)
[2021-07-08] position : 9,043.67 (IL: 0.40 , hodl: 9,080.18 , APR: 97.95 % , a: 7.12 , b: 2.92 , units: 634.66 / 1,550.94)
[2021-07-09] position : 8,059.41 (IL: 1.46 , hodl: 8,178.40 , APR: 97.80 % , a: 6.71 , b: 2.44 , units: 600.11 / 1,649.05)
[2021-07-10] position : 8,593.13 (IL: 5.31 , hodl: 9,074.94 , APR: 97.65 % , a: 8.17 , b: 2.27 , units: 525.87 / 1,891.94)
[2021-07-11] position : 8,697.70 (IL: 3.76 , hodl: 9,037.32 , APR: 97.50 % , a: 7.94 , b: 2.38 , units: 547.58 / 1,826.65)
[2021-07-12] position : 8,840.81 (IL: 5.09 , hodl: 9,314.60 , APR: 97.35 % , a: 8.43 , b: 2.31 , units: 524.53 / 1,917.13)
[2021-07-13] position : 7,913.85 (IL: 6.91 , hodl: 8,501.37 , APR: 97.20 % , a: 7.94 , b: 1.95 , units: 498.06 / 2,029.81)
[2021-07-14] position : 7,028.92 (IL: 7.00 , hodl: 7,558.03 , APR: 97.05 % , a: 7.10 , b: 1.71 , units: 495.21 / 2,052.38)
... lots of rows removed ...
[2022-02-21] position : 67,665.98 (IL: -39.37 , hodl: 48,551.16 , APR: 63.75 % , a: 49.61 , b: 8.54 , units: 682.03 / 3,962.00)
[2022-02-22] position : 66,129.91 (IL: -36.63 , hodl: 48,400.05 , APR: 63.60 % , a: 50.25 , b: 8.02 , units: 657.99 / 4,121.07)
[2022-02-23] position : 70,382.86 (IL: -34.96 , hodl: 52,151.53 , APR: 63.45 % , a: 54.67 , b: 8.33 , units: 643.72 / 4,227.15)
[2022-02-24] position : 74,897.35 (IL: -32.81 , hodl: 56,395.63 , APR: 63.30 % , a: 59.79 , b: 8.59 , units: 626.31 / 4,359.73)
[2022-02-25] position : 78,844.51 (IL: -29.66 , hodl: 60,809.89 , APR: 63.15 % , a: 65.44 , b: 8.67 , units: 602.38 / 4,548.70)
[2022-02-26] position : 85,735.22 (IL: -27.39 , hodl: 67,302.13 , APR: 63.00 % , a: 73.18 , b: 9.13 , units: 585.77 / 4,693.84)
[2022-02-27] position : 91,962.50 (IL: -28.33 , hodl: 71,658.79 , APR: 62.85 % , a: 77.69 , b: 9.86 , units: 591.86 / 4,661.67)
[2022-02-28] position : 85,241.13 (IL: -27.67 , hodl: 66,765.55 , APR: 62.70 % , a: 72.64 , b: 9.03 , units: 586.71 / 4,718.72)
[2022-03-01] position : 100,691.11 (IL: -22.51 , hodl: 82,193.25 , APR: 62.55 % , a: 91.26 , b: 10.00 , units: 551.67 / 5,035.71)
[2022-03-02] position : 100,241.62 (IL: -23.38 , hodl: 81,247.15 , APR: 62.40 % , a: 90.00 , b: 10.01 , units: 556.92 / 5,005.33)
[2022-03-03] position : 104,887.23 (IL: -25.46 , hodl: 83,600.55 , APR: 62.25 % , a: 91.97 , b: 10.69 , units: 570.23 / 4,905.28)
[2022-03-04] position : 106,589.57 (IL: -28.23 , hodl: 83,124.51 , APR: 62.10 % , a: 90.56 , b: 11.18 , units: 588.53 / 4,768.99)
[2022-03-05] position : 97,710.38 (IL: -27.47 , hodl: 76,651.23 , APR: 61.95 % , a: 83.82 , b: 10.11 , units: 582.85 / 4,831.81)
[2022-03-06] position : 101,427.19 (IL: -27.26 , hodl: 79,699.80 , APR: 61.80 % , a: 87.30 , b: 10.43 , units: 580.93 / 4,864.29)
[2022-03-07] position : 93,011.33 (IL: -28.26 , hodl: 72,518.26 , APR: 61.65 % , a: 79.19 , b: 9.63 , units: 587.24 / 4,828.31)
[2022-03-08] position : 92,935.68 (IL: -29.87 , hodl: 71,561.87 , APR: 61.50 % , a: 77.72 , b: 9.76 , units: 597.85 / 4,758.64)
[2022-03-09] position : 106,407.93 (IL: -22.29 , hodl: 87,014.17 , APR: 61.35 % , a: 97.24 , b: 10.20 , units: 547.12 / 5,217.46)