0001 XAS-1d — Interface for AMM Hooks #165
RichardAH
started this conversation in
Standard Proposals
Replies: 1 comment
-
What I would do is change this sentence "To do this anyone can send two currencies" because it might imply bad practice. Hook creator might choose to protect Setup to set this by owner account only or possibly set CUR, A and B state by other installer hook. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
XAS-1d — Interface for AMM Hooks
Introduction
Automated market makers on Xahau are implemented as liquidity pool Hooks, in a similar fashion to many other chains. While the actual mathematical operation of each Hook may differ there should be a standard interface for users to interact with such Hooks. That interface is defined in this standard.
Remit Interface
All movement of funds in an out of the liquidity pool, including use of the liquidity pool for exchanges, occurs via ttREMIT, according to the table below, and is inferred by the sending of 0, 1 or 2 currencies to the Hook.
Query Interface
All querying happens via ttINVOKE. If a user wishes to know what exchange rate they would probably get for a currency they can query that as follows: Send a ttINVOKE to the Hook that specifies the following HookParameters:
The Hook should return binary encoded data in the return string as follows:
AMM PBD\0
Hook State
AMM Hooks are free to store their state any way they please. But they should have at least the following state keys:
Beta Was this translation helpful? Give feedback.
All reactions