-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no constraints on oracle price #46
Comments
Thanks for chainlink nft prices we don't have to pay link token or even gas to call price, but by your point we need to pay gas for checking new oracle price and save it in variable. And also if we ignore big changes of oracle price maybe we stay in an oracle price that is far from real oracle price. But I consider it by more information. |
I expect us not having to pay for NFT prices to be a temporary thing. |
Smart contract has some call functions that are working with the oracle, for example checking that new price in the good range or not. we get nft price directly from chainlink and use it in our call function. If we want to check new oracle price we can save it in the setFundingFee function (Because we have to pay gas). So we can have saved oracle price for each hour. And for each call we check the new oracle price with the saved oracle price (that we save it each hour in setFundingFee) to prevent big changes. But for that many lines of the code should have this checkpoint. I suggest doing it after mvp (as you said). |
|
Currently there are no constraints to a change in the oracle price.
I would like a constraint MaxOracleChange from the previous price and minimal interval 1 hour.
MaxOracleChange = 40%
MinOracleInterval = 1 hour
PreviousOraclePrice = xxx
Blockheight/TimestampPreviousOraclePrice = xxx
OracleChange = positive((newOraclePrice -oldOraclePrice)/ oldOraclePrice * 100)
if (OracleChange > MaxOracleChange & someWayToSaveleyCheckTheTimeIsMoreThanSay40Min ) {
if (newOraclePrice < oldOraclePrice){
newOraclePrice = oldOraclePrice * ((100-MaxOracleChange)/100)
} else {
newOraclePrice = oldOraclePrice * ((100+MaxOracleChange)/100)
}
}
I would also like to consider a minimum deposit of say 5 usdc and a minimum position of also say 5 usdc to ensure that nobody can clog the smart contract without active addresses that need to be checked for liquidation all the time.
The text was updated successfully, but these errors were encountered: