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

Negative LPTokenValue following AMMWithdraw transaction #5015

Open
donovanhide opened this issue May 10, 2024 · 1 comment
Open

Negative LPTokenValue following AMMWithdraw transaction #5015

donovanhide opened this issue May 10, 2024 · 1 comment

Comments

@donovanhide
Copy link
Contributor

 rippled -q json amm_info '{"asset":{"currency":"XRP"},"asset2":{"currency":"446F676500000000000000000000000000000000","issuer":"rKRXaQi8wQrYNs3MRHdyFpf3zWRV62xmPa"}}'
{
   "result" : {
      "amm" : {
         "account" : "rGzyAVXRUoHR6UWB2GbSeJ55B4Wa1JHFB4",
         "amount" : "0",
         "amount2" : {
            "currency" : "446F676500000000000000000000000000000000",
            "issuer" : "rKRXaQi8wQrYNs3MRHdyFpf3zWRV62xmPa",
            "value" : "0"
         },
         "asset2_frozen" : false,
         "auction_slot" : {
            "account" : "rMFyohsvH6zNvyjEiZCDXfPmpdpy4KPkhX",
            "discounted_fee" : 5,
            "expiration" : "2024-04-22T22:00:12+0000",
            "price" : {
               "currency" : "0349194ECF9F5CBC59BF04CB08D85FF6651055DC",
               "issuer" : "rGzyAVXRUoHR6UWB2GbSeJ55B4Wa1JHFB4",
               "value" : "0"
            },
            "time_interval" : 20
         },
         "lp_token" : {
            "currency" : "0349194ECF9F5CBC59BF04CB08D85FF6651055DC",
            "issuer" : "rGzyAVXRUoHR6UWB2GbSeJ55B4Wa1JHFB4",
            "value" : "-0.000001"
         },
         "trading_fee" : 50,
         "vote_slots" : [
            {
               "account" : "rMFyohsvH6zNvyjEiZCDXfPmpdpy4KPkhX",
               "trading_fee" : 50,
               "vote_weight" : 100000
            }
         ]
      },
      "ledger_current_index" : 87898741,
      "status" : "success",
      "validated" : false
   }
}

as a result of this AMMWithdraw transaction:
https://livenet.xrpl.org/transactions/846057F4E027590A502653BBAFD524C1D72D01EAA71233065E0A58D0CF3DCEEF/raw

@donovanhide
Copy link
Contributor Author

Possibly this needs to be less than or equal to zero, or the rounding and/or floating point backwards and forwards needs to be fixed:

if (newLPTokenBalance == beast::zero)

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