-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from cowprotocol/add_partner_fee
Compute partner fees
- Loading branch information
Showing
10 changed files
with
292 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ pandas-stubs | |
types-psycopg2 | ||
types-requests | ||
moralis | ||
dune-client | ||
dune-client | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from hexbytes import HexBytes | ||
from src.fees.compute_fees import compute_all_fees_of_batch | ||
from src.helpers.config import logger | ||
|
||
|
||
def log_token_data(title: str, data: dict, name: str): | ||
logger.info(title) | ||
for token, value in data.items(): | ||
logger.info(f"Token Address: {token}, {name}: {value}") | ||
|
||
|
||
def main(): | ||
protocol_fees, partner_fees, network_fees = compute_all_fees_of_batch( | ||
HexBytes(input("tx hash: ")) | ||
) | ||
log_token_data("Protocol Fees:", protocol_fees, "Protocol Fee") | ||
log_token_data("Partner Fees:", partner_fees, "Partner Fee") | ||
log_token_data("Network Fees:", network_fees, "Network Fee") | ||
# e.g. input: 0x980fa3f8ff95c504ba61e054e5c3e50ea36b892f865703b8a665564ac0beb1f4 | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
INSERT INTO fees_new ( | ||
chain_name, auction_id, block_number, tx_hash, order_uid, token_address, fee_amount,fee_type | ||
) VALUES ( :chain_name, :auction_id, :block_number, :tx_hash, :order_uid, :token_address, :fee_amount, :fee_type | ||
INSERT INTO fees_per_trade ( | ||
chain_name, auction_id, block_number, tx_hash, order_uid, token_address, fee_amount, fee_type, fee_recipient | ||
) VALUES ( :chain_name, :auction_id, :block_number, :tx_hash, :order_uid, :token_address, :fee_amount, :fee_type, :fee_recipient | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.