-
Notifications
You must be signed in to change notification settings - Fork 32
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
Auction scripts #345
base: main
Are you sure you want to change the base?
Auction scripts #345
Conversation
…, fetch-bids.sh to gather bid data, clear-auction.js to execute auction logic, and initial data files bids.txt and users.txt.
… update allocation logic, and improve file handling.
…BigInt precision, improved comments, and adjusted token scaling to 18 decimals.
…dify USDC refund logic to clamp at 1, and increase totalTokens to 40,000.
… with utility scripts documentation.
Slither reportTHIS CHECKLIST IS NOT COMPLETE. Use
unchecked-transferImpact: High
kinto-core/src/access/workflows/AaveWithdrawWorkflow.sol Lines 50 to 64 in 609ebf9
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #345 +/- ##
==========================================
+ Coverage 89.11% 89.25% +0.13%
==========================================
Files 42 42
Lines 2656 2652 -4
==========================================
Hits 2367 2367
+ Misses 289 285 -4
|
utils/auction/clear-auction.js
Outdated
let tokensAccumulated = 0n; | ||
let finalPrice = 0n; | ||
|
||
for (const bid of bids) { |
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.
not sure if this logic is correct.
You are assuming people are getting the tokens at their bid price which is incorrect.
For example I bid 30, you bid 30 and the third person bids 10.
I should be getting my tokens at 10 not at 30, so to calculate tokens accumulated you need to use 10 not 30
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.
otherwise we are not grabbing the real last bid, we are finishing up earlier than we should
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.
It doesn't assume people are getting the tokens at their bid. The first look is only to calculate how many tokens people are willing to buy.
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.
but youa re using this to calculate the finalPrice
utils/auction/clear-auction.js
Outdated
// 1) Sort bids by maxPrice (desc), then priority (desc) | ||
bids.sort((a, b) => { | ||
if (b.maxPrice === a.maxPrice) { | ||
return Number(b.priority - a.priority); |
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.
how are you calculating priority? Take into account that within engen, the engen balance matters and then emissaries and then people sorted by their K balance
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.
Yeah, calculating priority would be another script, as we have to fetch data for Engen and Balances.
utils/auction/clear-auction.js
Outdated
|
||
tokensAccumulated += tokensDemanded; | ||
if (tokensAccumulated >= totalTokens) { | ||
finalPrice = bid.maxPrice; |
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 is what I think is incorrect
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 is like the worst case. Because if I bid $300 for $30, you are only accumulating 10 tokens but in reality maybe you should have accumulated 30
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.
so you would run out of tokens earlier
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.
That's why I think the loop needs to be over each bid price first, and then over bids. It needs to be a double loop
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.
Yeah. I agree. thanks.
…oot to set-rd-root for clarity.
…rm-price auction aiming to raise a specified total USDC amount, added verification for allocations, and adjusted scripts for setting auction root.
…in utils/auction.
…y amount, including `fetch-users-k.sh` for parallel processing of user balances and `sort-by-amount.sh` for sorting results numerically in descending order.
… needed for sorting auction data by amount.
…ess, bidAmount, bidPrice, saleAlloc, and usdcAlloc without proofs.
…t details for chain 7887.
…fixVotingSupply function, and adjust migration script and test artifacts accordingly.
Auction scripts
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
…157-transfer-k-investor.s.sol, adjust amounts and addresses, and update JSON files with new transaction hashes, block numbers, and timestamps.
… update deployment addresses, and reflect changes in transaction and receipt logs.
…g JSON run files for transaction tracking.
Description
Type of change
Checklist:
main
, or there's a description of how to mergeIssue Resolution