Skip to content

Commit

Permalink
Merge pull request #41 from MXCzkEVM/feat-adjust-priceoracle
Browse files Browse the repository at this point in the history
feat: adjust price oracle
  • Loading branch information
luanxu-mxc committed Aug 1, 2023
2 parents a8cdc44 + 8549b7c commit 9493a41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eth/gasprice/gasprice.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ func (oracle *Oracle) SuggestTipCap(ctx context.Context) (*big.Int, error) {

// CHANGE(MXC): When there are network restrictions, the baseFee should be increased here to avoid transaction delays. The minimum bid is 100,000 gwei.
price = price.Add(price, new(big.Int).Div(head.BaseFee, big.NewInt(20)))
if head.BaseFee.Cmp(big.NewInt(1e14)) < 0 {
price = new(big.Int).Add(price, new(big.Int).Sub(big.NewInt(1e14), head.BaseFee))
if head.BaseFee.Cmp(big.NewInt(1e13)) < 0 {
price = new(big.Int).Add(price, new(big.Int).Sub(big.NewInt(1e13), head.BaseFee))
}

oracle.cacheLock.Lock()
Expand Down

0 comments on commit 9493a41

Please sign in to comment.