Open tequdev opened 2 months ago
The code I use to determine which is the issuer:
let limit = obj.LowLimit.value === "0" ? obj.LowLimit : obj.HighLimit;
if (obj.Balance.value !== "0") {
limit = Number(obj.Balance.value) < 0 ? obj.LowLimit : obj.HighLimit;
}
const issuer = limit.issuer;
The balance of an AMM trustline should never be 0, so it should be easy to figure out that way.
It seems that most situations can be handled with that script. but isn't Balance to be 0 in a situation where an AMMDelete transaction could happen?
In that case, both trustlines should be deleted, so only one account should be in both trustlines, right?
The intention of that flag was only to signal to tooling that an AMM is involved. The expectation was that any tools that care can query the account IDs to determine which is the AMM.
In that case, both trustlines should be deleted, so only one account should be in both trustlines, right?
Ah yes, in SeagullCash's experience, when tokens are gone from the pool, the Pool-Issuer trustline is deleted, so there cannot be a Pool-Issuer trustline with a Balance of 0.
But if the issuer changes the trustline flag, the trustline may not be removed.
In that case, both trustlines should be deleted, so only one account should be in both trustlines, right?
Ah yes, in SeagullCash's experience, when tokens are gone from the pool, the Pool-Issuer trustline is deleted, so there cannot be a Pool-Issuer trustline with a Balance of 0.
But if the issuer changes the trustline flag, the trustline may not be removed.
In that case, the AMMDelete
would fail anyways I assume.
Issue Description
Cannot determine which is the AMM Account on the High or Low account on the trust line between the AMM Pool and the token issuer.
This is due to that
lsfAMMNode
does not have High ,Low information.LedgerEntry https://xrpscan.com/object/CDE55A8290DF221A643F51798BE6294A69384066D1ECFB7C2B9BEE2004B38D63
AffectedNodes https://livenet.xrpl.org/transactions/ECF3BDF47CD916F6134C37581D88F96548B07236E25EAB901BCCBEA37DDFFADB