@@ -34,7 +34,7 @@ func newGreedyBucketsBuilder(
34
34
if algoConf == nil {
35
35
algoConf = & algorithmConfig {
36
36
EnforceProfit : true ,
37
- ProfitThresholdPercent : defaultProfitPercentMinimum ,
37
+ ProfitThresholdPercent : defaultProfitThresholdPercent ,
38
38
}
39
39
}
40
40
return & greedyBucketsBuilder {
@@ -48,7 +48,7 @@ func newGreedyBucketsBuilder(
48
48
}
49
49
50
50
// CutoffPriceFromOrder returns the cutoff price for a given order based on the cutoff percent.
51
- // For example, if the cutoff percent is 0.9 , the cutoff price will be 90% of the order price, rounded down to the nearest integer.
51
+ // For example, if the cutoff percent is 90 , the cutoff price will be 90% of the order price, rounded down to the nearest integer.
52
52
func CutoffPriceFromOrder (order * types.TxWithMinerFee , cutoffPercent int ) * big.Int {
53
53
return common .PercentOf (order .Price (), cutoffPercent )
54
54
}
@@ -190,12 +190,12 @@ func (b *greedyBucketsBuilder) mergeOrdersIntoEnvDiff(
190
190
const retryLimit = 1
191
191
192
192
var (
193
- baseFee = envDiff .baseEnvironment .header .BaseFee
194
- retryMap = make (map [* types.TxWithMinerFee ]int )
195
- usedBundles []types.SimulatedBundle
196
- usedSbundles []types.UsedSBundle
197
- transactions []* types.TxWithMinerFee
198
- percent = b .algoConf .ProfitThresholdPercent
193
+ baseFee = envDiff .baseEnvironment .header .BaseFee
194
+ retryMap = make (map [* types.TxWithMinerFee ]int )
195
+ usedBundles []types.SimulatedBundle
196
+ usedSbundles []types.UsedSBundle
197
+ transactions []* types.TxWithMinerFee
198
+ priceCutoffPercent = b .algoConf .PriceCutoffPercent
199
199
200
200
SortInPlaceByProfit = func (baseFee * big.Int , transactions []* types.TxWithMinerFee , gasUsedMap map [* types.TxWithMinerFee ]uint64 ) {
201
201
sort .SliceStable (transactions , func (i , j int ) bool {
@@ -204,7 +204,7 @@ func (b *greedyBucketsBuilder) mergeOrdersIntoEnvDiff(
204
204
}
205
205
)
206
206
207
- minPrice := CutoffPriceFromOrder (orders .Peek (), percent )
207
+ minPrice := CutoffPriceFromOrder (orders .Peek (), priceCutoffPercent )
208
208
for {
209
209
order := orders .Peek ()
210
210
if order == nil {
@@ -232,7 +232,7 @@ func (b *greedyBucketsBuilder) mergeOrdersIntoEnvDiff(
232
232
usedSbundles = append (usedSbundles , sbundles ... )
233
233
transactions = nil
234
234
}
235
- minPrice = CutoffPriceFromOrder (order , percent )
235
+ minPrice = CutoffPriceFromOrder (order , priceCutoffPercent )
236
236
}
237
237
}
238
238
0 commit comments