You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users want their streams to follow a polynomial curve rather than an exponential curve:
But Lockup Dynamic works with piecewise exponential functions, so it is not able to implement polynomials.
Solution
While polynomials cannot be directly implemented in Lockup Dynamic, they can be emulated. This is what we can do:
Implement the polynomial using any mathematical software (e.g. Wolfram) to generate the streamed amounts at the end of each moth over the desired period
For each month and amount, generate a segment
Each segment has an exponent of 1 (which enables linear streaming)
The overall result is that the implied curve approximates the desired polynomial fairly accurately
Implementation
Rust program that takes an array of objects as input, with each object containing the following data:
Amount as an integer
Date as a string (e.g. Sep 30, 2024)
Which then produces some (literal) Solidity code, e.g.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Problem
Users want their streams to follow a polynomial curve rather than an exponential curve:
But Lockup Dynamic works with piecewise exponential functions, so it is not able to implement polynomials.
Solution
While polynomials cannot be directly implemented in Lockup Dynamic, they can be emulated. This is what we can do:
The overall result is that the implied curve approximates the desired polynomial fairly accurately
Implementation
Rust program that takes an array of objects as input, with each object containing the following data:
Which then produces some (literal) Solidity code, e.g.
Examples
The Python script above generates this plot:
Beta Was this translation helpful? Give feedback.
All reactions