From 85ce4d4a488852137b3eb2572e2e8557cf1e6dbe Mon Sep 17 00:00:00 2001 From: Sheng Lundquist Date: Fri, 25 Oct 2024 10:08:41 -0700 Subject: [PATCH] Adjusting minimum transaction amount for add lp (#1716) --- src/agent0/core/hyperdrive/policies/random.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/agent0/core/hyperdrive/policies/random.py b/src/agent0/core/hyperdrive/policies/random.py index 2b2f4120c3..73d7239b31 100644 --- a/src/agent0/core/hyperdrive/policies/random.py +++ b/src/agent0/core/hyperdrive/policies/random.py @@ -386,9 +386,12 @@ def add_liquidity_with_random_amount( list[Trade[HyperdriveMarketAction]] A list with a single Trade element for adding liquidity to a Hyperdrive pool. """ - # LP is in units of LP, which is always checked against the minimum transaction amount - # as defined in pool config. - minimum_transaction_amount = interface.pool_config.minimum_transaction_amount + # The minimum transaction amount is dependent on if we're trading with + # base or vault shares + if interface.base_is_yield: + minimum_transaction_amount = interface.get_minimum_transaction_amount_shares() + else: + minimum_transaction_amount = interface.pool_config.minimum_transaction_amount # take a guess at the trade amount, which should be about 10% of the agent’s budget initial_trade_amount = FixedPoint(