Skip to content

Commit b09b40c

Browse files
committed
List individual builders when notifying about posted bill
1 parent 28ea40f commit b09b40c

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

src/accountManager.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,16 @@ export class AccountManager {
5050
const billingResults = await this.dataFetcher.getBillingData(today);
5151
const txHash =
5252
await this.billingContract.updatePaymentDetails(billingResults);
53-
await this.slack.post(
54-
`MEV Billing ran successfully: ${this.txLink(txHash)}`
55-
);
53+
54+
let messages = [`MEV Billing ran successfully: ${this.txLink(txHash)}`];
55+
for (const amountDue of billingResults.dueAmounts) {
56+
messages.push(
57+
`${amountDue.builder} was billed ${ethers.formatEther(
58+
amountDue.dueAmountWei
59+
)} ETH`
60+
);
61+
}
62+
await this.slack.post(messages.join("\n"));
5663
}
5764

5865
async runDrafting() {

src/dune.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class QueryRunner {
2929
billingQuery: number,
3030
paymentQuery: number,
3131
feeQuery: number,
32-
options?: RuntimeOptions,
32+
options?: RuntimeOptions
3333
) {
3434
this.dune = new DuneClient(apiKey);
3535
this.billingQuery = billingQuery;
@@ -53,7 +53,7 @@ export class QueryRunner {
5353
parseInt(BILLING_QUERY!),
5454
parseInt(PAYMENT_QUERY!),
5555
parseInt(FEE_QUERY!),
56-
options,
56+
options
5757
);
5858
}
5959

@@ -68,6 +68,7 @@ export class QueryRunner {
6868
console.log("Got Billing Results:", results);
6969
return results.map((row: any) => ({
7070
billingAddress: row.miner_biller_address!,
71+
builder: row.miner_label,
7172
dueAmountWei: BigInt(row.amount_due_wei!),
7273
}));
7374
} catch (error) {

src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export interface AmountDue {
22
billingAddress: `0x${string}`;
3+
builder?: string;
34
dueAmountWei: bigint;
45
}
56

0 commit comments

Comments
 (0)