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

failed PSM trade prevents further service due to inconsistent seat staging #6096

Closed
dckc opened this issue Aug 31, 2022 · 1 comment · Fixed by #6102
Closed

failed PSM trade prevents further service due to inconsistent seat staging #6096

dckc opened this issue Aug 31, 2022 · 1 comment · Fixed by #6102
Assignees
Labels
bug Something isn't working Inter-protocol Overarching Inter Protocol
Milestone

Comments

@dckc
Copy link
Member

dckc commented Aug 31, 2022

Describe the bug

After accidentally trying to buy AUSD whent he PSM had none, attempts to trade 20 IST for USDC result in a refund rather than a trade.

To Reproduce

In agoricollinet-22, check wallet balances and then attempt to trade 20 IST for USDC:

$ psm-tool --net ollinet --wallet $addr
{
  "balances": [
    [null,"zoe invite"],
    [1.99747,"AUSD"],
    [0,"BLD"],
    [46.800225,"IST"]
  ],
...
}

$ psm-tool --giveStable 20 --boardId $psmInstance --feePct 0.05 >,give20.json
$ agd --from=k1 tx swingset wallet-action --allow-spend "$(cat ,give20.json)"  --node https://ollinet.rpc.agoric.net:443 --chain-id agoricollinet-22 -y
code: 0
...
txhash: 07A7B0CCCD655F0EF2F8ED566380E23D23D6D665B0308671346A250880C6F3FF

Note that 20 IST is withdrawn for this trade:

$ psm-tool --net ollinet --wallet $addr
{
  "balances": [
    [null,"zoe invite"],
    [1.99747,"AUSD"],
    [0,"BLD"],
    [26.800225,"IST"]
  ],
  "offers": [
    ["2022-08-31T14:25:13.203Z","pending","psm","giveStable",{"give":{"In":[20,"IST"]},"want":{"Out":[19.990005,"AUSD"]}}]
  ]
}

But then it gets refunded:

$ psm-tool --net ollinet --wallet $addr
{
  "balances": [
    [null,"zoe invite"],
    [1.99747,"AUSD"],
    [0,"BLD"],
    [46.800225,"IST"]
  ],
  "offers": [
    ["2022-08-31T14:25:13.203Z","accept","psm","giveStable",{"give":{"In":[20,"IST"]},"want":{"Out":[19.990005,"AUSD"]}}]
  ]
}

Use metrics to check PSM pool balance:

$ agoric follow -B https://ollinet.agoric.net/network-config :published.psm.IST.AUSD.metrics
{
  anchorPoolBalance: {
    brand: slot(0,"Alleged: AUSD brand"),
    value: 23002530n,
  },
  feePoolBalance: {
    brand: slot(1,"Alleged: IST brand"),
    value: 2305n,
  },
  totalAnchorProvided: {
    brand: slot(0),
    value: 0n,
  },
  totalStableProvided: {
    brand: slot(1),
    value: 23002530n,
  },
}

Expected behavior

Take my money! And give me USDC in return :)

Platform Environment

ollinet, which is running 1af6550

cc @turadg @dtribble

blocking #6064

@dckc dckc added bug Something isn't working pso labels Aug 31, 2022
@dckc
Copy link
Member Author

dckc commented Aug 31, 2022

Transaction Details

Since these details go away when we restart ollinet:

https://ollinet.explorer.agoric.net/agoric/tx/07A7B0CCCD655F0EF2F8ED566380E23D23D6D665B0308671346A250880C6F3FF

timestamp | 2022-08-31 09:25

property value
@type /agoric.swingset.MsgWalletSpendAction
Owner agoric12x5xgl573q89x6mpx3pz8h4a2m0nw4cl8lhv6h
Spend_action { "type": "acceptOffer", "data": { "id": "1661955913203", "instancePetname": "instance@board05311", "requestContext": { "dappOrigin": "unknown", "origin": "unknown" }, "meta": { "id": "1661955913203", "creationStamp": 1661955913203 }, "status": "proposed", "invitationMaker": { "method": "makeGiveStableInvitation" }, "instanceHandleBoardId": "board05311", "proposalTemplate": { "give": { "In": { "pursePetname": "Agoric stable local currency", "value": 20000000 } }, "want": { "Out": { "pursePetname": "AUSD", "value": 19990005 } } } } }

@dckc dckc assigned dckc and dtribble and unassigned turadg Aug 31, 2022
@Tartuffo Tartuffo added this to the Mainnet 1 RC0 milestone Aug 31, 2022
@dckc dckc added the Inter-protocol Overarching Inter Protocol label Sep 1, 2022
@dckc dckc changed the title failing to trade stable for anchor/reference in PSM failed PSM trade prevents further service due to inconsistent seat staging Sep 1, 2022
@mergify mergify bot closed this as completed in #6102 Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Inter-protocol Overarching Inter Protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants