Skip to content

Commit

Permalink
fix: split min_fee across selected indexers
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodus committed Dec 11, 2023
1 parent 7e40cc9 commit e02ce99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion graph-gateway/src/client_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ async fn handle_client_query_inner(
// TODO: In a future where indexers are expected put more effort into setting cost
// models, we should pay selected indexers the maximum fee of the alternatives
// (where `fee <= budget`).
let min_fee = budget.0 * UDecimal18::try_from(0.75).unwrap();
let min_fee = budget.0 * UDecimal18::try_from(0.75 / selections_len as f64).unwrap();
selection.fee = GRT(selection.fee.0.max(min_fee));
}
total_indexer_fees = GRT(total_indexer_fees.0 + selections.iter().map(|s| s.fee.0).sum());
Expand Down

0 comments on commit e02ce99

Please sign in to comment.