Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add collateral to AMM under governance (internal demo) #3913

Closed
dckc opened this issue Sep 30, 2021 · 6 comments
Closed

add collateral to AMM under governance (internal demo) #3913

dckc opened this issue Sep 30, 2021 · 6 comments
Assignees
Labels
Core Economy OBSOLETE in favor of INTER-protocol enhancement New feature or request Governance Governance

Comments

@dckc
Copy link
Member

dckc commented Sep 30, 2021

Internal Demo: New collateral type X added to the treasury, Treasury sells BLD for collateral, then mints RUN and initializes a pool

initially from a Sep 29 meeting.

probably belongs in the treasury epic #3863 and/or the governance planning Epic #3185.

@dckc dckc added enhancement New feature or request Core Economy OBSOLETE in favor of INTER-protocol Governance Governance labels Sep 30, 2021
@dckc dckc added this to the Beta Phase 4: Governance milestone Sep 30, 2021
@dckc
Copy link
Member Author

dckc commented Oct 7, 2021

I asked @michaelfig about the mechanics of adding a collateral type, governance or no governance; he provided me with an addCollateral.js script, presumably developed in the heat of other demos...

https://gist.github.com/dckc/eb16477068dfdc0930ac0e2c2266971f

@dckc
Copy link
Member Author

dckc commented Oct 8, 2021

I spent some quality time with addCollateral.js yesterday:

  1. getting concrete experience with a sim-chain
  2. factored 3 smaller functions out of the one big function (currently c3fe00b)
    • the result probably has more round trips in some cases

What collateral to add? FungibleFaucet.Token

I don't see any way to adding a new issuer / mint from a deploy script alone, without deploying a contract.

The Fungible Faucet does exactly that, so I have been using its Token. As far as I can tell, it does what we need for demo purposes.

@Chris-Hibbert
Copy link
Contributor

The AMM docs also talk about adding liquidity to a pool

@dckc
Copy link
Member Author

dckc commented Oct 11, 2021

I got as far as proposing a parameter change.

deploy script

~/projects/agoric/gov-demo
01:48 connolly@jambox$ yarn deploy:contracts
yarn run v1.22.5
warning package.json: No license field
$ agoric deploy tools/gov-demo-prep.js
Open CapTP connection to ws://127.0.0.1:8000/private/captp...o
agoric: deploy: running /home/connolly/projects/agoric/gov-demo/tools/gov-demo-prep.js
agoric: deploy: Deploy script will run with Node.js ESM
await feesAvailable...
{
  feesAvailable: { brand: Object [Alleged: RUN brand] {}, value: 148100207n }
}
await bundle contracts...
await install contracts...
await start electorate...
await start contractGovernor...
await get board Ids...
{
  governor: '794977354',
  governorInstance: '529406044',
  governedInstance: '715805464',
  committee: '474502210',
  binaryVoteCounter: '688500812',
  contractGovernor: '112440918',
  governedContract: '1675202761'
}
Done in 35.73s.

ui

image

and in the console:

proposing change... 
{paramSpec: {…}, proposedValue: Alleged: USDC brand}
...
{result: {…}}

@dckc
Copy link
Member Author

dckc commented Oct 11, 2021

The progress above depends on a small tweak to the governance package: #3952

@dckc
Copy link
Member Author

dckc commented Oct 16, 2021

We did the demo today. We were able to

  • claim treasury committee member invitations
    • agoric start --reset a local sim chain
    • agoric deploy tools/gov-demo-prep.js to get board ids for agoricNames and chainTimerService
    • agoric open --repl to start the wallet
    • yarn start the gov-demo app; approve it in the wallet
    • Get Committee Invitations with the Agoric Names boardID
    • copy an invitation board id; claim
  • propose to add collateral
    • agoric deploy contract/deploy.js api/deploy.js in the fungible faucet dapp to get a new issuer and its board id
    • Propose New Collateral with the chainTimerService, issuer, and duration
  • vote x4
  • see that the vote passed (though in an error message from the demo UI)
  • see that the treasury added the issuer as a form of collateral
    • getCollaterals() via the public facet of the treasury instance from agoricNames threw Error#3: brandIn not found: "[Alleged: Tokens brand]" because a prerequisite in the AMM or priceAuthority wasn't set up.

versions used:

  • agoric-sdk 0408b5469c616
  • gov-demo b6e8e4f
  • dapp-fungible-faucet a723a99219 (via agoric init)

a recording is available internally

@dckc dckc closed this as completed Oct 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Economy OBSOLETE in favor of INTER-protocol enhancement New feature or request Governance Governance
Projects
None yet
Development

No branches or pull requests

3 participants