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

Deterministic addressing for serum markets #122

Open
armaniferrante opened this issue May 16, 2021 · 5 comments
Open

Deterministic addressing for serum markets #122

armaniferrante opened this issue May 16, 2021 · 5 comments
Labels
composition Changes needed for programs composing with the dex

Comments

@armaniferrante
Copy link
Contributor

armaniferrante commented May 16, 2021

It would be great to have a deterministic address for a market, given the base and quote currency. We can do this by having market accounts initialized in a program derived address, using an oracle for lot size configuration. One problem that needs to be considered is how to deal with the case where a price changes enough that the existing lot size configuration no longer makes sense.

@tomjohn1028
Copy link

tomjohn1028 commented Jun 21, 2021

using an oracle for lot size configuration

@armaniferrante can you fill me in on the above? When/Why do lot sizes change on a market? How often does this occur?

@armaniferrante
Copy link
Contributor Author

armaniferrante commented Jun 21, 2021

Lot sizes may need to be adjusted if the value of one of the tokens changes dramatically. I don't have a good answer for how often it occurs.

@armaniferrante armaniferrante added composition Changes needed for programs composing with the dex priority:1 labels Jun 23, 2021
@cdrappi
Copy link

cdrappi commented Jun 29, 2021

@armaniferrante For PsyOptions use case, we care more about deterministic addressing on (baseToken, quoteToken, baseLotSize, quoteLotSize) rather than (baseToken, quoteToken) which might simplify this problem a lot. If so, is this potentially as simple as changing the market initialisation from generating a random address to one that creates one as a function of those 4 params?

@armaniferrante
Copy link
Contributor Author

Related. Once we have "permissioned markets", it would be nice to have a governable market list for each permissioning entity on chain.

@ryoqun
Copy link

ryoqun commented Jul 12, 2021

hi eng from @solana-labs. :)

i think the problem is that downstream programs need to hard-code market id?

fyi, I'm trying to make specifying the market id in the tx needless for the downstream programs to begin with the aid of rpc tx sim:
solana-labs/solana#17796

so, this proposal eventually enables invoked program to dynamically load accounts at arbitrary address (by deterministically deriving the address from some other important parameters like baseToken, quoteToken).

Please have a look and leave comments if any. I'm especially wondering how's the hard requirement of rpc sim could affect latency sensitive defi apps..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
composition Changes needed for programs composing with the dex
Projects
None yet
Development

No branches or pull requests

4 participants