Skip to content

Commit

Permalink
Merge pull request #22 from lista-dao/feature/auctionCap
Browse files Browse the repository at this point in the history
Split the auction order when the amount exceeds the limit
  • Loading branch information
paddy20210802 authored Sep 13, 2024
2 parents 2b22758 + 9f0c270 commit f1e1fde
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/jobs/buy_auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,11 @@ func (j *buyAuctionJob) processAuction(auctionID *big.Int) {
"collat_to_buy": collatAmount.String(),
"hay_max": hayMax.String(),
})
//if hayMax.Cmp(AUCTION_CAP) >= 0 {
// log.Infof("buy_auction : ignoring users with excessive auction amounts...")
// return
//}
if hayMax.Cmp(AUCTION_CAP) >= 0 {
log.Infof("buy_auction : ignoring users with excessive auction amounts...")
collatAmount = big.NewInt(0).Div(big.NewInt(0).Mul(AUCTION_CAP, RAY), status.Price)
log.Infof("buy_auction : split auction %v", collatAmount)
}

log.Debug("buying auction...")
j.buyAuction(log, auctionID, collatAmount, status.Price)
Expand Down

0 comments on commit f1e1fde

Please # to comment.