diem / reference-wallet

A reference wallet.
Apache License 2.0
15 stars 13 forks source link

Documentation on inventory <> liquidity #59

Open sunmilee opened 3 years ago

sunmilee commented 3 years ago

Would love to see more detailed documentation on how the interaction between inventory logic and liquidity emulator works. For example, having more inline documentation in https://github.com/diem/reference-wallet/blob/master/backend/wallet/services/inventory.py would be helpful.

Another example is when I asked how subaddressing works for inventory account in DRW. Yaniv's response was super helpful, and it would be good to write it as code comment as well: "Each time the wallet asks for funds from the liquidity service, it generates a new subaddress for the inventory account. In general, each account (i.e. each user) can have infinite associated sub-addresses (so Account table and SubAddress table have one-to-many relationship). This is a common behavior for blockchain wallets. This is how wallets avoid privacy issues, given all the data on the blockchain is public."