flashloan-profit-calculator
Version:
A library for analyzing flashloan transactions and calculating profits
43 lines (42 loc) • 1.54 kB
TypeScript
import type { TransferLog } from "../types/transfer";
import type { TokenBalanceChange, AddressParticipationData } from "../types";
export declare const revenueBalanceChanges: TokenBalanceChange;
export declare const costBalanceChanges: TokenBalanceChange;
export declare const addressParticipation: {
[address: string]: {
[token: string]: AddressParticipationData;
};
};
export declare let blockTimestamp: number;
/**
* Update the builder address by fetching block information
*/
export declare const updateBuilderAddress: (blockNumber: number) => Promise<void>;
/**
* Initialize balance changes for a token and address
*/
export declare function initializeBalanceChanges(token: string, address: string, isRevenue: boolean, isSenderOrContract: boolean): void;
/**
* Track address participation in transfers
*/
export declare function trackAddressParticipation(from: string, to: string, token: string): void;
/**
* Process a transfer of tokens between addresses
*/
export declare function processTransfer(token: string, from: string, to: string, amount: bigint): void;
/**
* Process a transfer log with error handling
*/
export declare function processTransferLog(log: TransferLog): void;
/**
* Check if an address is a builder
*/
export declare function isBuilder(address: string): boolean;
/**
* Setup the processor with contract and sender addresses
*/
export declare function setupProcessor(contract: string, sender: string): void;
/**
* Reset all state
*/
export declare function resetState(): void;