Content
@
0 reply
0 recast
2 reactions
Bijan
@shah256
SOLIDITY ADVICE REQUEST I want to calculate the interest rate for a token with a fluctuating market price given by a bonding curve. Currently, i timestamp the price whenever it changes and append into an array; any ideas on strategies that avoid this kind of state bloat?
1 reply
0 recast
0 reaction
William
@william
Why does the rate need to be onchain? Otherwise store the observation in a mapping as you avoid gas overhead for checking array length validity in solidity
1 reply
0 recast
1 reaction
Bijan
@shah256
How would i safely store timestamped price changes off chain? How could the contract verify.
1 reply
0 recast
0 reaction