Trade: propose, decline, expire
A settlement that does not happen: the proposer’s side is escrowed at propose, and comes back when the counterparty declines or the proposal expires.
1. The investor offers 20 aeUSD for 50 VOTE units
R=$(alias_tx settlement propose "$ISSUER" "give:coin:20000000aeusd,get:right:$ASSET:2:50" --expires-in 10m --from investor)
wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null
SID2=$(aevad query settlement by-party "$INVESTOR" --status pending --node "$AEVA_NODE" -o json | jq -r '.settlements | max_by(.id | tonumber) | .id')
echo "pending settlement: $AEVA_EXPLORER/settlements/$SID2"
aevad query bank balance "$INVESTOR" aeusd --node "$AEVA_NODE" -o json | jq -r '"investor aeusd while pending: \(.balance.amount)"'The 20 aeUSD left the investor’s balance: they sit in the settlement module account until the settlement ends.
2. The issuer declines
A counterparty declines by cancelling:
R=$(alias_tx settlement cancel "$SID2" --from issuer); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null
aevad query settlement settlement "$SID2" --node "$AEVA_NODE" -o json | jq -r '"status: \(.settlement.status)"'
aevad query bank balance "$INVESTOR" aeusd --node "$AEVA_NODE" -o json | jq -r '"investor aeusd after decline: \(.balance.amount)"'Expected output
status: STATUS_CANCELLED3. Expiry
A proposal nobody answers expires at its expiry: the chain’s end-of-block
sweep releases the escrow, or anyone may cancel it once expired. The maximum
lifetime of a proposal is a chain parameter:
aevad query settlement params --node "$AEVA_NODE" -o json | jq -c .See Settlement.
Last updated