Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoolAccount management with LP tokens #10386

Closed
Tracked by #10301
turadg opened this issue Nov 1, 2024 · 1 comment · Fixed by #10400
Closed
Tracked by #10301

PoolAccount management with LP tokens #10386

turadg opened this issue Nov 1, 2024 · 1 comment · Fixed by #10400
Assignees
Labels
enhancement New feature or request

Comments

@turadg
Copy link
Member

turadg commented Nov 1, 2024

What is the Problem Being Solved?

Fast USDC needs a PoolAccount, funded by multiple Liquidity Providers.

Description of the Design

FUC holds a PoolAccount. (For now an LCA but should work for any ICA)

Public invitations to:

  • deposit
    • give: USDC
    • want: PoolShare
  • withdraw
    • give: PoolShare
    • want: USDC

Exchange rate between USDC and LP shares is calculated by current size of the pool

  • at any time shareWorth is the pool amount divided by outstanding shares
  • in a withdraw, shares are burned and USDC provided
  • in a deposit new shares are issued

Security Considerations

Scaling Considerations

Test Plan

Unit test of a PoolShare math module.

Contract unit test of deposits and withdrawals.

  • offer overestimates value of share
  • offer underestimates value of share

Upgrade Considerations

not yet deployed

@dckc
Copy link
Member

dckc commented Nov 5, 2024

In my current draft (#10400, 9c389e2), the pool is a ZCF Seat.

Should the pool be an orchestration account, visible at the cosmos level?

? Where to put the pool assets? ZCFSeat or Orc Account?
  : in a ZCFSeat
    + follows the usual Zoe API
    + avoids async flow in deposit / withdraw methods
    ? (How) do clients look up the balance?
      : they don't
        . because they don't need to
      : contract publishes balance to vstorage
  : in an orchestration account
    + cosmos bank module publishes balance
    - goes against "contracts don't handle assets directly" best practice
      . contract has to withdraw from vbank into seat in offer handler

codecider

@mergify mergify bot closed this as completed in #10400 Nov 13, 2024
@mergify mergify bot closed this as completed in 324bca1 Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants