-
Notifications
You must be signed in to change notification settings - Fork 122
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
DFI2203 Futures #1155
DFI2203 Futures #1155
Conversation
fe038d3
to
5f8a4d5
Compare
Sorry for being late to the party/review, but why call it dfip2203 everywhere in the code? wouldn't a more descriptive name like "futures" be better? dfip2202 was a specific smart contract for this purpose, so I get the name. But here we have a nice functionality that can be named instead of a "generic" dfip number. |
sorry if i misunderstand it completly, but from the code, the logic feels totally off. What I understand from the code how it works:
Shouldn't the future be a pair that can be traded normally and its just fixed that all positions will be settled at (currrentActiveOracleprice +-5%) at the settlement block? Also I didn't find a way to get out of the futures-contract once I opened it. So you can't close your position? which makes sense, since I already know exactly what it will settle on. Like looking 1 week into the future, but not the way that I know where the dToken will stand in 1 week, but by locking the price of the future in 1 week to the currentprice+5%. |
Thanks @kuegi I haven't read the code yet. Just responding based on your reviews.
This is correct. We are not exactly creating a Future here. More like a "future swap". This serves only to loosely bound dToken to a range. It's also widely discussed that this Future will likely ended up not in use – acting pretty much just like a range guarantee every week.
This would be a bug if you're right. I haven't checked the code yet to confirm.
You should be able to get out by getting back your original input before the swap block. I haven't checked the code yet to see if it's implemented, but specification wise you should be able to get back your original input. |
@kuegi many thanks for your feedback. You are correct, the implementation does need to be updated to use the Oracle price at the point of execution. |
Thx for the confirmation. If I understand it correctly, this would mean that we don't need the new "futurePrices" at all, right? (so no datastructure, not storing them, no rpc calls) Cause we only use the active oracle price at the settlement. |
@kuegi Correct, but I was thinking of perhaps keeping the |
Honestly I wouldn't do that, as this opens a wide door for misunderstandings. Users seeing this rpc call, thinking that those prices are fixed already. then they open futures positions based on this assumptions. And have a possibly really bad awakening on the settlement block. |
@kuegi I'll remove them to save misunderstandings. |
if (type == AttributeTypes::Param) { | ||
if (typeId == ParamIDs::DFIP2201) { | ||
if (typeKey == DFIPKeys::RewardPct || | ||
typeKey == DFIPKeys::BlockPeriod) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this block in general is prepared for other typeIds etc. Why check here for the "other" values?
This if needs to be adapted whenever a new typeId (with new typeKeys) come along. Would be better to check here for the wanted values and return the error if typeKey is not a wanted one, right?
No description provided.