Anchor-Protocol / anchorcli

Command-line interface for Anchor Protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Liquidation contract submit bid requires coin as "uusd" but processes the value in "usd".

kasimte opened this issue · comments

When submitting a bit to the liquidation contract, the coin denomination must be uusd:

$ ANCHORCLI_NETWORK=tequila-0004 anchorcli x \
>   liquidation submit-bid \
>   --collateral-token terra1u0t35drzyy0mujj8rkdyzhe264uls4ug3wdp3x \
>   --premium-rate 0.25 \
>   --coin 100usd \
>   --from playground \
>   --gas auto \
>   --fees=1000000uusd
 ERROR  Error: invalid coin 'usd', MUST be uusd; use --verbose for more details

But when uusd is specified, the number is parsed as usd equivalent. In the example below, --coin 100uusd becomes 100000000uusd:

$ ANCHORCLI_NETWORK=tequila-0004 anchorcli x \
>   liquidation submit-bid \
>   --collateral-token terra1u0t35drzyy0mujj8rkdyzhe264uls4ug3wdp3x \
>   --premium-rate 0.25 \
>   --coin 100uusd \
>   --from playground \
>   --gas auto \
>   --fees=1000000uusd
chainId: tequila-0004
msg:
  type: wasm/MsgExecuteContract
  value:
    sender: SENDER_ADDRESS
    contract: terra16vc4v9hhntswzkuunqhncs9yy30mqql3gxlqfe
    execute_msg:
      submit_bid:
        collateral_token: terra1u0t35drzyy0mujj8rkdyzhe264uls4ug3wdp3x
        premium_rate: "0.250000000000000000"
    coins:
      - denom: uusd
        amount: "100000000"
fee:
  gas: "138288"
  amount:
    - denom: uusd
      amount: "1000000"
memo: ""

Or perhaps I'm missing something?

@kasimte Thank you for the report and sorry for the late response. Yes, the problem is with the denomination. will fix the problem in the new anchorcli version.