Cron agent with price momentum and portfolio info#93
Conversation
…in-ml/alphaswarm into research-cron-momentum-agent
| token_addresses = [ | ||
| "0x4F9Fd6Be4a90f2620860d680c0d4d5Fb53d1A825", # AIXBT | ||
| "0x0b3e328455c4059EEb9e3f84b5543F74E24e7E1b", # VIRTUAL | ||
| "0x731814e491571A2e9eE3c5b1F7f3b962eE8f4870", # VADER | ||
| ] |
There was a problem hiding this comment.
Could read from config with GetTokenAddress but that's good enough for now
There was a problem hiding this comment.
I was also thinking it could be cool to just use the intersection of tokens in the wallet and supported ones in the config (or whatever else is determining the universe of tradable tokens) -- but agree I think this is fine for now.
Co-authored-by: Nikolaiev Dmytro <nikolaevdmitryprog@gmail.com>
…in-ml/alphaswarm into research-cron-momentum-agent
…in-ml/alphaswarm into research-cron-momentum-agent
| "```csv", | ||
| "symbol,address,amount", | ||
| *[f"{token.token_info.symbol},{token.token_info.address},{token.value}" for token in tokens], | ||
| "```", |
There was a problem hiding this comment.
I could implement a toCsv on PortfolioBalance
| f" - {self.long_term_periods * 5}min change: {long_term_change:.2f}%\n" | ||
| ) | ||
|
|
||
| def calculate_price_changes(self, prices: List[Decimal]) -> Tuple[Decimal, Decimal]: |
There was a problem hiding this comment.
Would prefer an object, to avoid any confusion.
@dataclass
class PriceChange:
short_term: Decimal
long_term: Decimal
@classmethod
def null() -> PriceChange:
return PriceChange(..)
def is_above_threshold(short, long) -> bool:
....
@classmethod
def from_prices(prices: Sequence[Decimal], *, short_period, long_period) -> PriceChange:
....
There was a problem hiding this comment.
@aflament good point, updated according to your suggestions
|
@zikunukiz approved, but: |
An example agent that: