Skip to content
New issue

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

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

Already on GitHub? # to your account

Make new pool in Portfolio #192

Closed
16 tasks done
0xJepsen opened this issue Apr 11, 2023 · 0 comments · Fixed by #216
Closed
16 tasks done

Make new pool in Portfolio #192

0xJepsen opened this issue Apr 11, 2023 · 0 comments · Fixed by #216
Assignees

Comments

@0xJepsen
Copy link
Collaborator

0xJepsen commented Apr 11, 2023

This is a pre-requisite for the sim. The manager should do this with our arb tokens.
Main should:

  • Deploy weth contract
  • Deploy portfolio registry contract
  • Deploy Portfolio Contract
  • Deploy first erc20 arb_token_x
  • Deploy second erc20 arb_token_y
  • Deploy the infinitely liquid exchange
    Then:
  • Mint token_x to our arbitrageur
  • Mint token_y to our arbitrageur
  • Mint max amount of token_y to the liquid exchange
  • Approve the liquid exchange contract for our arbitrageur's token_x
  • Approve the token_x contract for our arbitrageur's token_x
  • Approve the token_y contract for our arbitrageur's token_y
  • deploy encoder contract
  • get fvm call data from encoder
  • Create pair on portfolio and get pair id
  • Create pool on Portfolio with token_x and token_y and pair ID

createPair = Bytes(Opcode | Address | Address) -> pairID
createPool = Bytes( 0x | CREATE_POOL (1 byte) | pairId (3 bytes) | controller (20 bytes) | priorityFee (2 bytes) | fee (2 bytes) | vol (2 bytes) | dur (2 bytes) | jit (2 bytes) | pointerPrice (1 byte) | powerMaxPrice (1 byte) | baseMaxPrice (? bytes) | powerPrice (1 byte) | basePrice (? bytes)`
Allocate: put tokens in contract
swapQuote
swapAsset
getVirtualPrice (can do with the abi)

  • two steps:
  • Create pair
  • Create pool

Ex: eth <> usdc pair -> gets pair ID

After this we can close this issue. Then next we can:

  • create thread for arbitrageur to listen for price update events and swap when they get one
  • Have the admin continuously update price
  • Enjoy our meal + debug
@0xJepsen 0xJepsen added this to the Simulation Testing milestone Apr 11, 2023
@0xJepsen 0xJepsen self-assigned this Apr 14, 2023
This was referenced Apr 14, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant