Conversation
✔️ Deploy Preview for heuristic-wilson-e60030 canceled. 🔨 Explore the source changes: 4bcd2f9 🔍 Inspect the deploy log: https://app.netlify.com/sites/heuristic-wilson-e60030/deploys/616e233aed9a640008a28f0c |
Deploying with Cloudflare Pages
|
This code is remarkably clear! I like we now have symmetry between base and quote tokens. I'm not done going through this yet, and I think there may be small problems with the amount of collateral lined up for sale in the plan. It could be that those get addressed during execution. I will finish this review over the next day or two. |
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.
On line 66 of libraries/ts/src/user.ts user.refresh()
should be await
-ed to ensure that the loaded user has an initial set of collateral, deposits, loans data
I was working with this code and noticed the absence of an await
was causing a race-condition when querying these fields
Hi @AuthorOfTheSurf, welcome and thank you. For integrating with our program, please keep an eye on jet-engine, our nascent client library. @Tristyn please consider this comment in the context of the client lib. |
@suscd I've left some specific questions around the liquidation sizing logic. As a general comment, it may be worth gathering all the logic relating to the target trade size in one place, like the plan. Although it didn't change much, I still want to go through the accounting code before submitting this review. |
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.
Publishing comments so far. Still need to review the accounting step.
Nice work. I've reimplemented this in the jet-lab/jet-engine repo, the ts libs new home. Need to transition importers of libraries/ts to import the package @jet-lab/jet-engine instead @AuthorOfTheSurf Yes that refresh should definitely be awaited. I've fixed it in @jet-lab/jet-engine |
Rework the calculations in the serum liquidation to find the worst acceptable price to set when placing a limit order. This allows for better efficiency by accepting trades with partial order fills.
also rebase onto master
4bcd2f9
to
ce38003
Compare
Rework the calculations in the serum liquidation to find the worst acceptable price to set when placing a limit order. This allows for better efficiency by accepting trades with partial order fills.
This also now allows for serum liquidations to occur when the quote token is being used as collateral.