Skip to Content
GuidesDistribute, claim, delegate

Distribute, claim, delegate

After the Quickstart’s trade, the INCOME kind (1) of $ASSET is held 900 by the issuer and 100 by the investor.

1. Distribute 30 aeUSD to the INCOME holders

R=$(alias_tx payout distribute "$ASSET" 1 30000000aeusd --from issuer); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null aevad query payout claimable "$INVESTOR" --node "$AEVA_NODE" -o json | jq -r '.claimable[] | "\(.denom): \(.total)"' echo "distributions: $AEVA_EXPLORER/income"
Expected output
aeusd: 3000000

The investor holds 100 of 1000 units, so it can claim 3 aeUSD (3000000aeusd). Anyone may distribute; the payer is recorded.

2. Claim

R=$(alias_tx payout claim "$ASSET" --from investor); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null echo "claim tx: $AEVA_EXPLORER/tx/$(jq -r .txhash <<<"$R")"

3. Route income to someone else

The investor delegates the income of 50 of its INCOME units to a third account for 30 days, revocable. The units are locked for the period; their income accrues to the delegate.

aevad keys add friend --home "$AEVA_HOME" --keyring-backend test --no-backup >/dev/null 2>&1 || true FRIEND=$(aevad keys show friend -a --home "$AEVA_HOME" --keyring-backend test) UNTIL=$(date -u -v+30d +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u -d '+30 days' +%Y-%m-%dT%H:%M:%SZ) R=$(alias_tx delegation delegate "$ASSET" 1 50 "$FRIEND" "$UNTIL" income --revocable --from investor); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null DID=$(aevad query delegation by-account "$INVESTOR" --node "$AEVA_NODE" -o json | jq -r '.delegations | max_by(.id | tonumber) | .id') echo "delegation: $AEVA_EXPLORER/delegations/$DID" R=$(alias_tx payout distribute "$ASSET" 1 10000000aeusd --from issuer); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null aevad query payout claimable "$FRIEND" --node "$AEVA_NODE" -o json | jq -r '.claimable[] | "\(.denom): \(.total)"'
Expected output
aeusd: 500000

Of the second distribution (10 aeUSD over 1000 units), the 50 delegated units earn 0.5 aeUSD for the friend; the investor earns on its other 50.

4. Revoke

R=$(alias_tx delegation revoke "$DID" --from investor); wait_tx "$(jq -r .txhash <<<"$R")" >/dev/null aevad query delegation delegation "$DID" --node "$AEVA_NODE" -o json | jq -r '"ended: \(.delegation.ended)"'
Expected output
ended: END_REASON_REVOKED

Income already routed stays claimable by the friend. A delegation with purpose vote counts the units in the delegate’s voting power instead (aevad query delegation voting-power <asset-id> <address>, VOTE-class kinds only). See Income.

Last updated