-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace elfpy market with ethpy HyperdriveInterface (#909)
This PR modifies the agent0 policies & accounts to use the new HyperdriveInterface API instead of the elfpy HyperdriveMarket. The new interface lacks some features (e.g. all of the yieldspace math and variable rates) that were required for the smart long and short policies, so we are deleting those for now. I made several new issues to detail follow-up work that is still needed. They are #910 #911 #913 This PR also gets us very close to completely detaching elfpy from the rest of the monorepo, though the rest of the detachment should also happen in a follow-up PR.
- Loading branch information
Showing
23 changed files
with
156 additions
and
582 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
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,3 +1,2 @@ | ||
"""Base classes for interface objects""" | ||
from .eth_wallet import EthWallet, EthWalletDeltas | ||
from .market_state import BaseMarketState |
This file was deleted.
Oops, something went wrong.
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,15 +1,14 @@ | ||
"""Base class for hyperdrive policies""" | ||
|
||
# from agent0.hyperdrive import HyperdriveMarketState # TODO: use agent0 market state instead of elfpy market | ||
from agent0.base.policies import BasePolicy | ||
from agent0.hyperdrive.state import HyperdriveMarketAction, HyperdriveWallet | ||
from elfpy.markets.hyperdrive import HyperdriveMarket as HyperdriveMarketState | ||
from elfpy.types import Trade | ||
from ethpy.hyperdrive import HyperdriveInterface | ||
|
||
|
||
class HyperdrivePolicy(BasePolicy[HyperdriveMarketState, HyperdriveWallet]): | ||
class HyperdrivePolicy(BasePolicy[HyperdriveInterface, HyperdriveWallet]): | ||
"""Hyperdrive policy.""" | ||
|
||
def action(self, market: HyperdriveMarketState, wallet: HyperdriveWallet) -> list[Trade[HyperdriveMarketAction]]: | ||
"""Returns an empty list, indicating no action""" | ||
def action(self, interface: HyperdriveInterface, wallet: HyperdriveWallet) -> list[Trade[HyperdriveMarketAction]]: | ||
"""Returns an empty list, indicating no action.""" | ||
raise NotImplementedError |
Oops, something went wrong.
b23b140
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
elf-simulations – ./
elf-simulations-delvtech.vercel.app
elf-simulations.vercel.app
elfpy.element.fi
elfpy.delv.tech
elf-simulations-git-main-delvtech.vercel.app