-
Notifications
You must be signed in to change notification settings - Fork 1
feat: receptor #600
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
feat: receptor #600
Conversation
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.
Good to see some cool Cairo code again :)
Left some ideas on how to slightly improve the implementation, but overall looks good.
I'm not a huge fan of the name, but also don't have a better suggestion 😬 No point on dwelling on it 🚢
A few other (already filtered) suggestions from Claude:
|
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.
Heh, I also used Claude to suggest names. I was going for some terminology to steer or guide stuff (boats, trains), trying to convey the fact that the module "just moves stuff around" - it came up with things like Helmsman, Raftsman, Hoghead, Hauler, Conductor, Signalman 😆
Suddenly, Receptor sounds pretty good 😇
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.
This PR adds the Receptor (open to suggestions for names) module that submits yin's price to Shrine for the Controller to actuate on.
The yin price is taken as the median of CASH-{DAI, USDC, USDT} pairs from Ekubo's oracle extension, based on a TWAP duration that can be adjusted by admin. The quote tokens can also be adjusted if desired in the future e.g. swapping one of them out for LUSD. I considered taking the median of an arbitrary number of quotes, but that would make the contract unnecessary complex e.g. implementing a heap to sort any number of quotes.
Additionally, the Receptor module also implements the ITask interface to streamline its interaction by keepers. Therefore, the primary method of updating yin's price is via
ITask.execute_task()
. Nevertheless, there is also aupdate_yin_price
that is restricted by access control that allows the update frequency of the task to be bypassed, similar toseer.update_prices()
andseer.execute_task()
. At the moment, this is not necessary, but it gives some flexibility for the future in case the yin's price needs to be updated in some user flow.Initially, I wanted to include the Sepolia and mainnet scripts in this PR, but I think they can be taken up separately while UX design is ongoing.