delvtech / agent0

Analysis & simulation repo for Delv
https://agent0.readthedocs.io/en/latest/
Apache License 2.0
52 stars 21 forks source link

add wallet_db object for representing wallets with a database #1454

Closed dpaiton closed 5 months ago

dpaiton commented 6 months ago

Current Wallet objects are pool-specific. They specify balance, longs, shorts, etc agnostic to what pool they are on and only for a single pool. However, Wallets are a view of information tied to a wallet address, which is not pool specific. I use the same address for interfacing across multiple pools. Since wallets are tied to agents which are tied to pools, I am unable to easily jump from pool to pool and see my wallet details.

We want to solve this by using a single "wallet" database for a given private key. The Chain object will hold these wallets. The wallet includes a pool column, so we can access all trades for a given pool with an address key.

dpaiton commented 6 months ago

Related test for this https://github.com/delvtech/agent0/issues/1408

slundqui commented 5 months ago

Issue solved by keeping the Wallet object to be pool specific, while having positions across pools viewed in a separate function. Fixed in https://github.com/delvtech/agent0/pull/1467