anilhelvaci / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
0 stars 0 forks source link

Send invitation to whitelisted accounts #3

Open anilhelvaci opened 3 months ago

anilhelvaci commented 3 months ago

What is the Problem Being Solved?

After we create the new collateral manager we should be able to send invitationMaker invitations to whitelisted accounts without any BLDer DAO intervention so we need to send those invitations without any core-eval.

Description of the Design

Not clear yet. Need insight from @Jorge-Lopes and @alexanderem49

Security Considerations

TBD

Scaling Considerations

TBD

Test Plan

TBD

Upgrade Considerations

TBD

Jorge-Lopes commented 3 months ago

What is the Problem Being Solved?

After we create the new collateral manager we should be able to send invitationMaker invitations to whitelisted accounts without any BLDer DAO intervention so we need to send those invitations without any core-eval.

More specifically, which are the invitationMaker invitations that should be sent to the institutional address deposit facet?

Jorge-Lopes commented 3 months ago

Design to create a new Institutional collateral manager (WIP)

The diagram bellow is a work in progress high level representation, which detail will be further improved.

Assumptions:

sequenceDiagram

    actor I as Institution
    participant EC as EconCommittee
    participant ECC as EconCommitteeCharter
    participant VD as VaultDirector
    participant PS as PostalService

    I ->> EC: provide account addresses to be whitelisted
    I ->> EC: provide desired collateral and initialParamValues
    Note over I, EC: Should the communication above happen off-chain?
    EC ->> ECC: makeCharterMemberInvitation
    ECC -->> EC: invitationMakers
    note over EC: invitationMakerName: 'VoteOnApiCall'
    note over EC: invitationArgs: [VaultDirector, addNewManager, [collateralIssuer, initialParamValues]]
    EC ->> VD : executeOffer()

    create participant VM as VaultManager
    VD ->> VM: makeVaultManagerKit()
    VM -->> VD: VaultManagerKit
    VD ->> VD: Build invitationMaker for the institution
    Note over VD: { invitationMakers = { GetVmPF = kit.self.getPublicFacet } }
    loop VaultDirector addresses
        VD ->> PS: sendTo(addr, payment)
    end
    PS -->> I: Invitation
    I ->> I: Exercise invitation to fetch VaultManager publicFacet
    I ->> VM: makeVaultInvitation()
    VM -->> I: vaultKit

VaultManager PublicFacet (collateral interface):

  collateral: M.interface('collateral', {
        makeVaultInvitation: M.call().returns(M.promise()),
        getPublicTopics: M.call().returns(TopicsRecordShape),
        getQuotes: M.call().returns(NotifierShape),
        getCompoundedInterest: M.call().returns(RatioShape),
      }),

Open Questions

Based on the diagram above:

anilhelvaci commented 3 months ago

What is the Problem Being Solved?

After we create the new collateral manager we should be able to send invitationMaker invitations to whitelisted accounts without any BLDer DAO intervention so we need to send those invitations without any core-eval.

More specifically, which are the invitationMaker invitations that should be sent to the institutional address deposit facet?

What I had in mind is the public facet of the institutional collateral manager but might be just a handle to query institutional collateral managers from vault factory. Don't have any strong opinions on neither one of those.

anilhelvaci commented 3 months ago

For context on PostalService see https://github.com/agoric-labs/ag-power-tools/issues/29

otoole-brendan commented 2 months ago

@anilhelvaci can you explain the UX an Institution would step through with above proposal? Are we saying the in institution has to accept the invitation via Wallet UI before they can see/open the institutional vault in Vault UI?

otoole-brendan commented 2 months ago

@anilhelvaci @Jorge-Lopes re:

image

yes - expectation is these addresses would be provided to the EC off-chain.

Can you explain the 'provided desired collateral and initialParamValues' step? Is this simply them passing information about the kind of institutional vault they want i.e. The Cosmos Hub requests an ATOM vault with specific parameters such as 500% CR and 0% stability fee?

Jorge-Lopes commented 2 months ago

Can you explain the 'provided desired collateral and initialParamValues' step? Is this simply them passing information about the kind of institutional vault they want i.e. The Cosmos Hub requests an ATOM vault with specific parameters such as 500% CR and 0% stability fee?

Yes, it is that the information we expect that the institution will provide to the EC. Are we correct?

anilhelvaci commented 2 months ago

Can you explain the 'provided desired collateral and initialParamValues' step? Is this simply them passing information about the kind of institutional vault they want i.e. The Cosmos Hub requests an ATOM vault with specific parameters such as 500% CR and 0% stability fee?

Yes @otoole-brendan . We basically mean the business negotiation/deal between the EC an the institution.

@anilhelvaci can you explain the UX an Institution would step through with above proposal? Are we saying the in institution has to accept the invitation via Wallet UI before they can see/open the institutional vault in Vault UI?

"Accepting an invitation" means that an offer has to be sent in order to activate certain capabilities that a user can perform. So I assume we need a dapp(frontend app) to formulate and send that offer rather than the Wallet UI. Here's a diagram explaining this flow assuming the dapp sending the accept invite offer is EC UI.

sequenceDiagram
   actor ins as Institutional User
   participant ec as EC UI
   participant sw as User SmartWallet
   participant ecc as EC Charter

   Note over ins, sw: New vm added and invitations already sent
   ec -->> ins: [Off Chain] check your invitation purse and accept it
   ins ->> ec: Click "Accept Institutional Invite"
   ec ->> ec: build offer spec
   note over ec: offerSpec = {invitationSpec= {type = "purse", ...}, ...}
   ec ->> sw: send offer
   sw ->> ecc: accept institutional invite
   ecc -->> sw: invitationMakers = { makeVaultInvitation }
   sw -->> sw: publish offer successful
   note over ins: now ready to open vaults