Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lp extension #192

Merged
merged 28 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
84e39cc
initial changes
poliwop Aug 8, 2024
e7e2e68
WIP, reimplementing multiple LP positions in same asset to use agent.…
poliwop Aug 8, 2024
909ab4b
WIP, reimplementing multiple LP positions in same asset to use agent.…
poliwop Aug 9, 2024
692a1b1
Fixed dca_with_lping strategy to take advantage of new LPing features
poliwop Aug 23, 2024
b6f519e
Fixed test_compare_several_lp_adds_to_single
poliwop Aug 23, 2024
ef0d967
Fixed remove_liquidity handling of removing all liquidity when quanti…
poliwop Aug 28, 2024
6e6d8ae
Extended simulate_remove_liquidity
poliwop Sep 5, 2024
bcfa1a1
Extended exact test for remove liquidity
poliwop Sep 6, 2024
d224f4a
Added test to compare basic case with case where shares are in holdings
poliwop Sep 6, 2024
76bc198
Added test to compare basic usage when quantity is unspecified
poliwop Sep 6, 2024
86c2725
Added test to compare base case to case where both quantity and nft_i…
poliwop Sep 6, 2024
672020a
Removed outdated test
poliwop Sep 9, 2024
af32d65
reverted change
poliwop Sep 10, 2024
fb69dbd
Added logic to pull tkn_remove from nft in remove_liquidity if necessary
poliwop Sep 10, 2024
1431339
Fixed some tests
poliwop Sep 10, 2024
02befd5
removed commented out test
poliwop Sep 11, 2024
74291d7
Removed commented out function
poliwop Sep 11, 2024
0d2b83a
Removed commented out function
poliwop Sep 11, 2024
cfec790
Removed old test
poliwop Sep 11, 2024
c18afa9
Formatting
poliwop Sep 11, 2024
560ad7e
Optimized cash_out
poliwop Sep 18, 2024
7b6b1e7
Added test_cash_out_omnipool_exact
poliwop Sep 18, 2024
5b7838a
add test_cash_out_multiple_positions
jepidoptera Sep 20, 2024
c9b542f
Allowing LRNA price in cash_out_omnipool. Fixed test_cash_out_multipl…
poliwop Sep 20, 2024
758f27d
fixed liquidation test
poliwop Sep 20, 2024
a5b56b1
fixed stableswap test
poliwop Sep 20, 2024
e807eb5
Removed unused function
poliwop Sep 23, 2024
2a9b7b4
Fixed calculate_remove_liquidity so it always returns nft_ids
poliwop Sep 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions hydradx/model/amm/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def __init__(self,
share_prices: dict[str: float] = None,
delta_r: dict[str: float] = None,
trade_strategy: any = None,
unique_id: str = 'agent'
unique_id: str = 'agent',
nfts: dict[str: any] = None,
):
"""
holdings should be in the form of:
Expand All @@ -29,6 +30,7 @@ def __init__(self,
self.trade_strategy = trade_strategy
self.asset_list = list(self.holdings.keys())
self.unique_id = unique_id
self.nfts = nfts or {}

def __repr__(self):
precision = 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to fix repr() so it can correctly display nfts

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to address this in a future PR

Expand All @@ -52,7 +54,8 @@ def copy(self):
share_prices={k: v for k, v in self.share_prices.items()},
delta_r={k: v for k, v in self.delta_r.items()},
trade_strategy=self.trade_strategy,
unique_id=self.unique_id
unique_id=self.unique_id,
nfts={id: copy.deepcopy(nft) for id, nft in self.nfts.items()}
)
copy_self.initial_holdings = {k: v for k, v in self.initial_holdings.items()}
copy_self.asset_list = [tkn for tkn in self.asset_list]
Expand Down
Loading