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

CAP-38 AMM Changes #108

Open
paulbellamy opened this issue Sep 1, 2021 · 1 comment
Open

CAP-38 AMM Changes #108

paulbellamy opened this issue Sep 1, 2021 · 1 comment

Comments

@paulbellamy
Copy link

We've just released v6.0.1, of the SDF Javascript base library.

It includes changes to implement CAP-38, supporting automated market makers.

These changes will be released with the protocol v18 upgrade.

There are some further notes on the changes API endpoints, with mock responses, on this APIary. Further notes on the API changes are available in this document.

  • Each SDK must update to enable depositing, and withdrawing from liquidity pools.
  • SDKs must also update to include the new effect types, as well as new fields on Accounts.
  • SDKs should also include methods to query liquidity pool information.

Because the order of the assets must be sorted in the pool ID, as well as in the depositing and withdrawing operations, SDKs should either:

  • error when creating a pool ID with assets in the wrong order
  • or, automatically sort the assets when generating a pool ID and structure the SDK to help users avoid making this mistake. For example, in the Go SDK, we pass in each asset and amount as a tuple, so that they are associated.

Asset ordering is determined by:
Native < AlphaNum4 < AlphaNum12, then by Code, then by Issuer, using lexicographic ordering.

If your SDK has implemented and released these changes, reference the release in a closing comment.

@paulbellamy
Copy link
Author

There were a couple of missed points in the initial version of the linked docs sent out.\n\nFirst, there is also a /liquidity_pools/:pool_id/trades api endpoint for retrieving the trades which have taken place in a pool.\n\nSecond, the numerator and denominator in the price field of trades, will be serialized as strings. This is because they can now be 64-bit integers.\n\nBoth changes are now reflected in the updated apiary docs at https://ammmock.docs.apiary.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant