From ce0ad5f46544985afb223ea419f4d247891573bd Mon Sep 17 00:00:00 2001 From: Soil King <157099073+soilking@users.noreply.github.com> Date: Tue, 9 Jul 2024 19:37:21 +0200 Subject: [PATCH] Update pod order to not use podAmount from subgraph --- bots/util.py | 4 +--- data_access/graphs.py | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bots/util.py b/bots/util.py index d2e176f..ccb3165 100644 --- a/bots/util.py +++ b/bots/util.py @@ -1379,9 +1379,7 @@ def farmers_market_str(self, event_log, transaction_receipt): f"Ignoring null order cancel with graph id {order_id} and txn hash {event_log.transactionHash.hex()}" ) return "" - pod_amount = pods_to_float( - int(pod_order["podAmount"]) - int(pod_order["podAmountFilled"]) - ) + pod_amount = (float(pod_order["beanAmount"]) - float(pod_order["beanAmountFilled"])) / float(pod_order["pricePerPod"]) max_place = pods_to_float(pod_order["maxPlaceInLine"]) price_per_pod = bean_to_float(pod_order["pricePerPod"]) event_str += f"❌ Pod Order Cancelled" diff --git a/data_access/graphs.py b/data_access/graphs.py index e8895f1..1eacef9 100644 --- a/data_access/graphs.py +++ b/data_access/graphs.py @@ -167,7 +167,8 @@ def get_pod_order(self, id): maxPlaceInLine id pricePerPod - podAmount + beanAmount + beanAmountFilled podAmountFilled }} }}