Skip to content
On this page

Pando Leaf Design Document

Interact with Pando

All participants of Pando complete the interaction by transferring tokens to the multisig wallet. Node worker Syncer syncs the payments as mixin multisig outputs; another worker Payee processes all outputs in order.

Pando Design

Mixin Multisig Output

Output:

fielddescription
Senderuser mixin id
CreatedAtpayment time
AssetIDpayment asset id
Amountpayment amount
Memoextra message

Output Memo:

Memo contain the TransactionAction information, see details in DecodeTransactionAction.

The memo is maybe AES-encrypted, an ed25519 public key used for compound AES key/iv will be in the first 32 bytes.

TransactionAction Definition

fielddescriptiontype
FollowIDuser defined trace id for this transactionuuid
Bodyaction type & relevant parametersbytes

Workers

  1. Syncer sync unhanded utxo by mixin messenger api & store into WalletStore as outputs in updated asc order.
  2. Payee pull unhanded utxo from WalletStore in order and parse memo to get the action then handle it. Transfers may be created during handling.
  3. Assigner select enough unspent UTXO and assign to a pending transfer.
  4. Cashier pull unhandled transfers from WalletStore in order, then request & sign multisig transfer. If enough signatures collected, generate a raw transaction.
  5. TxSender commit raw transactions to Mixin Network.

Syncer Workflow

Syncer Workflow

Payee Workflow

Payee Workflow

Assigner & Cashier & TxSender Workflow

Assigner & Cashier Workflow

Actions

All actions supported by Pando with groups cat,flip,oracle,proposal,sys and vat. see core/action for details.

Sys - system operations

#1 Withdraw

pkg/maker/sys/withdraw.go

withdraw any assets from the multisig wallet, proposal required.

Parameters:

nametypedescription
assetuuidwithdraw asset id
amountuuidwithdraw amount
opponentuuidreceiver's mixin id

Proposal - governance system

#11 Make

pkg/maker/proposal/make.go

create a new proposal

Parameters:

nametypedescription
databytesaction type & parameters will be executed if passed

#12 Shout

pkg/maker/proposal/shout.go

request node administrator to vote for this proposal

Parameters:

nametypedescription
iduuidproposal trace id

#13 Vote

pkg/maker/proposal/vote.go

vote for a proposal, nodes only. If enough votes collected, the attached action will be executed on all nodes automatically.

Parameters:

nametypedescription
iduuidproposal trace id

Cat - manager collaterals

#21 Create

pkg/maker/cat/create.go

create a new collateral type, proposal required.

Parameters:

nametypedescription
gemuuidcollateral asset id
daiuuiddebt asset id
namestringcollateral type name

#22 Supply

pkg/maker/cat/supply.go

supply dai token to increase the total debt ceiling for this collateral type. Payment asset id must be equal to the debt asset id.

Parameters:

nametypedescription
iduuidcollateral trace id

#23 Edit

pkg/maker/cat/edit.go

modify collateral's one or more attributes, proposal required.

Parameters:

nametypedescription
iduuidcollateral trace id
keystringattribute name
valuestringattributes value

#24 Fold

pkg/maker/cat/fold.go

modify the debt multiplier(rate), creating / destroying corresponding debt.

Parameters:

nametypedescription
iduuidcollateral trace id

Vat - manager vaults

#31 Open

pkg/maker/vat/open.go

open a new vault with the special collateral type

Parameters:

nametypedescription
iduuidcollateral trace id
debtdecimalinitial debt

#32 Deposit

pkg/maker/vat/deposit.go

transfer collateral into a Vault.

Parameters:

nametypedescription
iduuidvault trace id

#33 Withdraw

pkg/maker/vat/withdraw.go

withdraw collateral from a Vault, vault owner only.

Parameters:

nametypedescription
iduuidvault trace id
dinkdecimalchange in collateral

#34 Payback

pkg/maker/vat/payback.go

decrease Vault debt.

Parameters:

nametypedescription
iduuidvault trace id

#35 Generate

pkg/maker/vat/generate.go

increase Vault debt, vault owner only.

Parameters:

nametypedescription
iduuidvault trace id
debtdecimalchange in debt

Flip - manager auctions

#41 Kick

pkg/maker/flip/kick.go

put collateral up for auction from an unsafe vault.

Parameters:

nametypedescription
iduuidvault trace id

#42 Bid

pkg/maker/flip/bid.go

pay dai to participate in the auction.

Starting in the tend-phase, bidders compete for a fixed lot amount of Gem with increasing bid amounts of Dai. Once tab amount of Dai has been raised, the auction moves to the dent-phase. The point of the tend phase is to raise Dai to cover the system's debt. During the dent-phase bidders compete for decreasing lot amounts of Gem for the fixed tab amount of Dai. Forfeited Gem is returned to the liquidated vault for the owner to retrieve. The point of the dent phase is to return as much collateral to the Vault holder as the market will allow.

Parameters:

nametypedescription
iduuidflip trace id
lotdecimalcollateral amount

#43 Deal

pkg/maker/flip/deal.go

claim a winning bid / settles a completed auction

Parameters:

nametypedescription
iduuidflip trace id

Oracle - manager price oracle

#51 Create

pkg/maker/oracle/create.go

register a new oracle for the asset, proposal required.

Parameters:

nametypedescription
iduuidasset id
pricedecimalinitial price
hopint64time delay in seconds between poke calls
thresholdint64number of governors required when poke
tstimestamprequest timestamp

#52 Edit

pkg/maker/oracle/edit.go

modify an oracle's next price, hop & threshold, proposal required.

Parameters:

nametypedescription
iduuidasset id
keystringattribute name
valuestringattributes value

#53 Poke

pkg/maker/oracle/poke.go

updates the current feed value and queue up the next one.

Parameters:

nametypedescription
iduuidasset id
pricedecimalnew next price
tstimestamprequest timestamp

#54 Rely

pkg/maker/oracle/rely.go

add a new price feed to the whitelist, proposal required

Parameters:

nametypedescription
iduuidfeed mixin id
keybytespublic key

#55 Deny

pkg/maker/oracle/deny.go

remove a price feed from the whitelist, proposal required

Parameters:

nametypedescription
iduuidfeed mixin id