Skip to content

Commit

Permalink
Adjusting minimum transaction amount for add lp (#1716)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheng Lundquist authored Oct 25, 2024
1 parent 6d69fa8 commit 85ce4d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/agent0/core/hyperdrive/policies/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 85ce4d4

Please sign in to comment.