Skip to content

calcSynthYield: SynthYieldBasisPoints yield ratio formula

Update: While I do like the effect of this formula, my current intention is for this MR to be closed by !2657 (closed).


[Aimed for V99]

This was previously 'Synth staking tweaks', containing a number of proposed changes to calcSynthYield.
For easier and separate review, these changes have been split into separate MRs (!2651 (closed)/!2652 (closed)/!2653 (merged)/!2654 (closed)),
leaving !2563 (closed) to be for only the yield ratio formula.


Synths are backed by a slice of their Layer 1 pool, that slice consisting of half the synth amount of Asset and the equivalent value (depth) of RUNE.

When a synth cycle mints synths into a bucket, it takes a slice of the pool from Liquidity Providers and gives that slice to Savers.
Saver final yield depends on how big a pool slice they get relative to the slice they started with.
LPer final yield depends on how big a pool slice they have left after the slice is taken from them.

SynthYieldBasisPoints could refer either to absolute or relative yield.
Considering a SynthYieldBasisPoints of 10000:
|
For absolute yield, Liquidity Providers would keep no yield and Savers would get the full yield.
(This would have an incentive-pendulum-like effect of incentivising more saving when there were few savers and less saving when there were many savers.) |
For relative yield, Liquidity Provider yield and Saver yield would be equal.

My current impression is that relative yield is intended, such that for SynthYieldBasisPoints 5000 the Saver yield is 50% of the Liquidity Provider yield.

Relative yield as indicated by SynthYieldBasisPoints is then Saver Yield divided by Liquidity Provider Yield,
and as such most depend both on how big a pool slice Savers started with (bucket.BalanceAsset) and how big a pool slice Liquidity Providers started with (involving a pool.BalanceAsset term).

In this pared-down MR, I include unit test additions to TestSynthCycle in manager_network_current_test.go and manager_network_v98_test.go to show that
in _current SynthYieldBasisPoints of 5000 produces Saver yield which is 50% of Liquidity Provider yield
and in _v98 (for the already-present example) produces Saver yield which is less than 25% of Liquidity Provider yield.


I have now made a separate branch for comparison with !2626 (closed) (and containing an added TestSynthCycleSmallYield unit test).
https://gitlab.com/Multipartite/thornode/-/commits/MR2626-comparison
Commit hash: 05bea1135d9628631b9df3d80b7d43cf44ff31b3
Unit test files:
https://gitlab.com/Multipartite/thornode/-/blob/05bea1135d9628631b9df3d80b7d43cf44ff31b3/x/thorchain/manager_network_current_test.go
https://gitlab.com/Multipartite/thornode/-/blob/05bea1135d9628631b9df3d80b7d43cf44ff31b3/x/thorchain/manager_network_MR2626_test.go
https://gitlab.com/Multipartite/thornode/-/blob/05bea1135d9628631b9df3d80b7d43cf44ff31b3/x/thorchain/manager_network_v98_test.go
Unit test and lint jobs (which both pass) for this commit 'Commit 05bea113':
https://gitlab.com/Multipartite/thornode/-/jobs/3269926278
https://gitlab.com/Multipartite/thornode/-/jobs/3269926279
Table summary of the unit tests' final Asserts, for which the desired yieldRatioBasisPoints is 5000 (+/- 1):

TestSynthCycle (100 + 100) TestSynthCycleSmallYield (100 + 0.1)
V99 4999 4999
MR2626 4871 5135
V98 2467 5129

As before, this time for TestSynthCycleHighSynths and TestSynthCycleHighSynthsSmallYield.
https://gitlab.com/Multipartite/thornode/-/commits/MR2626-comparison
Commit hash: 8d7de61475ccd32c813cccaec100d52c2ed6a8dd
Unit test files:
https://gitlab.com/Multipartite/thornode/-/blob/8d7de61475ccd32c813cccaec100d52c2ed6a8dd/x/thorchain/manager_network_current_test.go
https://gitlab.com/Multipartite/thornode/-/blob/8d7de61475ccd32c813cccaec100d52c2ed6a8dd/x/thorchain/manager_network_MR2626_test.go
https://gitlab.com/Multipartite/thornode/-/blob/8d7de61475ccd32c813cccaec100d52c2ed6a8dd/x/thorchain/manager_network_v98_test.go
Unit test and lint jobs (which both pass) for this commit 'Commit 8d7de614':
https://gitlab.com/Multipartite/thornode/-/jobs/3272134939
https://gitlab.com/Multipartite/thornode/-/jobs/3272134947
Starting synths in the bucket: 140 (70% SynthPerAssetDepth)
Starting LUVI before pool growth: 30000000030000
Minted synths, final SynthPerPoolDepth, final LUVI (note that final LUVI can be lower than pre-growth LUVI for MR2626 and V98!):

TestSynthCycleHighSynths (100 + 30) TestSynthCycleHighSynthsSmallYield (100 + 0.1)
V99 32.3, 66.3%, 43846153856531 0.1, 69.98%, 30046153924057
MR2626 70, 80.8%, 25000000000000 0.23, 70.04%, 29983333340322
V98 35, 67.3%, 42499999991826 0.23, 70.04%, 29983720966232
Edited by Multipartite

Merge request reports