delvtech / agent0

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

add wallet_db object for representing wallets with a database #1454

Closed dpaiton closed 2 months ago

dpaiton commented 3 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 3 months ago

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

slundqui commented 2 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