Content pfp
Content
@
0 reply
0 recast
2 reactions

Bijan pfp
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 pfp
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 pfp
Bijan
@shah256
How would i safely store timestamped price changes off chain? How could the contract verify.
1 reply
0 recast
0 reaction

William pfp
William
@william
Semi centralized, push up the update with a signature, verify that the sig is valid. And have a server that can sign these messages
1 reply
0 recast
0 reaction