►
From YouTube: How To: Treasury & Swap
Description
In part 2 of our tutorial series, Rowland Graus shows you how to navigate the treasury and the Swap in the Agoric beta. Create vaults, manage an existing vault that you've set up, and learn how to swap tokens on the AMM.
A
Welcome
I'm
roland
grouse
product
manager
at
gorick
and
in
this
video
I'm
going
to
walk
through
the
treasury
that
agorak
launched
as
part
of
the
gorick
beta.
So
in
a
previous
video,
I
went
through
the
process
to
set
up
your
wallet
and
in
this
video
I
will
have
already
set
it
up.
So
if
you
haven't
done
that
yet
take
a
look
at
the
previous
video
or
just
go
to
the
documentation,
that's
linked
from
the
beta
site
and
walk
through
the
steps
there.
A
If
you
have
questions
again,
please
jump
into
the
discord,
ask
team
members
or
ask
part
of
the
community
and
they
can
help
set
you
up.
So
I've
got
two
tabs
open.
One
is
the
treasury
itself
at
treasury.gork.app
and
then
the
other
is
the
wallet
which
again,
we've
already
set
up.
So
as
a
reminder,
as
part
of
the
setup
process
for
the
wallet,
I
was
provisioned
with
a
number
of
different
tokens,
so
I
have
different
purses
here
and
each
purse
is
specific
to
a
token
type.
A
So,
in
my
cosmos
staking
purse,
I've
got
fake
atoms
here
in
my
gorick
staking
purse,
I've
got
fake,
build
here,
etc.
I've
also
already
connected
to
the
treasury
app.
So
you
saw
me
do
that
at
the
end
of
the
wallet
setup
video,
but
when
you
launch
after
the
wallet
is
launched,
if
you
launch
the
application
here,
it
will
ask
you
to
connect
and
I've
gone
ahead
and
done
that.
A
Okay.
So
to
start
with,
I,
and
and
this
is
not
a
video
about
vaults
or
the
economy,
but
I
want
to
introduce
a
couple
of
these
concepts
if
you're
not
familiar
the
the
vault
concept
is
similar
to
those
of
you
familiar
with
maker,
dao
or
synthetic
susd.
A
It's
a
similar
model
where
you
can
create
an
over
collateralized
loan
position
and
the
contract
will
mint
a
currency.
In
this
case,
the
currency
is
run,
which
is
agorik's
local
currency
and
run
is
what
you
use
to
pay
for
transactions
in
a
future
release
in
agoric,
and
it
will
be
the
the
primary
currency
that
services
and
products
are
denominated
in
india
ecosystem
and
the
only
way
to
create
run
is
to
create
a
vault
right
now.
A
So
what
you
do
to
when,
when
you
see
this
first
page
here,
you're
shown
a
list
of
different
collateral
types
and
I'm
actually
I'm
only
showing
collateral
types
where
I
already
have
a
purse
for
them.
So,
for
example,
if
the
vault
accepted
ethereum,
but
I
did
not
have
a
purse
or
ethereum,
I
wouldn't
be
shown
that
as
an
option
here,
I'm
also
shown
a
current
market
price
for
these
assets.
And
again
this
is
fake.
A
I'm
shown
what
the
minimum
collateralization
ratio
is
to
start
a
vault
with,
which
is
just
really
some
buffer
to
make
sure
that
I'm
not
starting
a
vault.
That's
too
close
to
the
liquidation
ratio
and
liquidation
ratio
is
if
the
price
of
the
collateral
falls
too
much.
A
The
the
treasury
will
protect
the
debt
by
selling
some
of
the
collateral
or
all
the
collateral
and
paying
off
your
debt.
So
that's
the
ratio
at
which
liquidation
occurs,
and
then
I'm
also
shown
at
interest
rate
which,
in
at
the
time
of
this
video,
is
extremely
competitive.
A
So,
okay,
so
I'm
going
to
start
by
creating
a
vault
with
let's
say
atom.
Here,
I'm
taken
now
to
a
screen
where
I
can
configure
the
vault
itself.
So
I've
got
I'm
shown
here
that
I've
got
68
atoms
available
in
my
funding
purse,
and
I
can
confirm
that
here
and
therefore
I
can
lock
up
up
to
that
much.
It
asks
me
to
choose
a
purse,
but
in
this
case
I
only
have
one
purse
that
is
connected
to
the
atom
asset.
A
So
I
don't
have
an
option
here
and
I'm
going
to
choose
30
adam
to
lock
up,
so
you
can
see
that
the
run
got
populated
right
away
and
what
that
the
way
that
got
calculated
is
the
system
has
a
price
for
adam
and
which
was
shown
in
the
previous
page.
And
then
it
knows
it's
got
a
collateralization
percent
that
it
started
with.
So
this
ensures
this
calculation
is
really
just
saying
atom
times
the
price
which
I
think
was
roughly
18
and
over
collateralized
at
150
percent
gets
you
to
370
run.
A
I
can
change
any
of
these
and
and
have
it
adjust
the
rest.
So,
for
example,
if
I
want
to
have
a
collateralization
ratio
of
180
instead
it
will
keep
my
previous
entry
of
30
atoms,
but
change
the
amount
of
run
that
I
would
get.
This
will
be
a
slightly
safer,
evolved
safer
in
the
sense
that
I'm
less
likely
to
get
liquidated.
A
Okay.
So
that's
really
the
configuration
screen
here,
I'm
going
to
go
ahead
and
move
forward
with
this
vault
that
I've
I've
selected
here,
so
I
would
expect
to
receive
somewhere
around
309
run
that
will
get
modified
a
little
bit
based
on
calculations
on
the
chain,
so
hit
configure
and
again
it'll
remind
me
of
what
I'm
about
to
do
and
then
I'm
going
to
hit
create
and
you
can
see
I've
got
an
existing
vault
here.
This
new
one
is
now
pending
wallet
acceptance
so
in
in
a
second.
A
This
will
plumb
through
the
system
and
it
will
be
shown
as
an
offer
and
there
we
go
and
one
thing
especially
for
those
of
you
that
are
new
to
the
igork
system.
One
thing
that
is
really
important
about
the
way
offers
are
structured
is
that
it
includes
a
give
and
a
want.
So
in
this
case
I'm
giving
30
atoms
to
create
the
vault
and
I
want
309.23
etc
run.
The
exchange
of
these
assets
is
is
enforced
at
the
protocol
level.
A
That's
what
our
zoe
framework
is
doing,
or
one
of
the
things
our
zoe
framework
is
doing,
and
therefore
I
know
that
if
something
goes
wrong
with
receiving
my
run
here,
I'll
get
my
atoms
back
and
because
the
system
is
doing
an
escrow
and
an
exchange
and
it
won't,
it
won't
trigger
that
until
it
has
what
it
needs
to
fulfill
this
offer
so
anytime
in
a
gorg.
A
There
is
a
direct
exchange
of
like
for
like
in
in
an
atomic
transaction
that
can
get
enforced
at
the
protocol
level
with
what
we
call
offer
safety
in
zoe.
So
I'm
gonna
go
ahead
and
accept
this
offer
and
you'll
see
here
before.
That
goes
through,
you
can
see,
I've
got
417
run
before
this
vault
gets
created,
and
that
was
from
my
previous
vault
and
I
had
68
atoms
so
once
that
runs
through
the
system
that
will
refresh
you
can
see
here
back
on
the
treasury.
A
I
now
have
two
volts
one
for
30
build
another
for
30
atom.
I've
got
a
borrow
position
of
310
run
on
this.
If
I
want
to
go
in
and
manage
the
vault,
I
can
do
that.
A
A
So,
for
example,
if
I
want
to
deposit
additional
atoms,
I
can
deposit
four
atoms
here,
and
you
can
see
that
my
you
know
my
current
vault
values
will
remain,
but
it's
going
to
show
me
the
new
proposed
vault
value,
so
adding
four
atoms
gets
my
collateralization
ratio
up
to
202,
but
for
example,
if
I
want
to
do
something
bad,
so
I
want
to
withdraw
enough
collateral.
That
would
put
me
below
the
liquidation
threshold.
A
Let's
say
I
want
to
withdraw
20
atoms,
it's
going
to
gray
out
to
make
offer
it
won't.
Let
me
it
won't.
Let
me
make
that
offer
to
the
system
all
right.
So
let's
stick
with
depositing
a
few
more
atoms
in
here.
I
also
can
borrow
a
little
bit
more
debt,
so
I'll
borrow
a
little
bit
more
run.
So
let's
say
I
want
another
50
run,
it's
going
to
show
me
the
collateralization
ratio,
and
that's
the
same.
A
So,
let's
just
change
that
a
little
bit
my
collateralization
ratio
will
drop
but
and
my
debt
will
go
up,
but
I
can
do
that
all
in
one
transaction,
so
I'm
going
to
go
ahead
and
make
offer,
and
it's
going
to
ask
me
to
approve
that
in
my
wallet
so
that
will
come
through
and
again
that
will
be
a
similar
transaction
to
what
you
just
saw.
So
this
is
how
you
manage
your
your
existing
vaults
in
the
system.
A
We
also
have
an
option
here
to
automatically
close
out
the
vault
and
all
that's
all
that
will
do
is
it
will
repay
all
the
debt
it
will
deposit
or
it
will
withdraw
all
the
collateral
and
quote
end
the
vault
and
actually
close
the
record
out.
A
Let's
see
yep,
so
I've
got
a
give
of
five
atoms
and
I
want
70
run
I'm
going
to
go
ahead
and
accept
that
as
well,
but
I'm
going
to
move
on
before
that
before
that
process
is
through.
So
the
last
thing
that
I
want
to
show
in
this
video
is
operating
our
swap
and
so
swap
is
similar
to
amms
that
you've
seen
in
in
other
applications
for
the
initial
beta.
A
Here
we
have
implemented
this
with
just
a
standard
xyk
curve
that
importantly,
as
we
approach
mainnet
will
start
to
get
more
interesting,
as
we
add
plugable
curves,
pluggable
fees
and
anything
else
that
you
as
developers
are
interested
in
building
on
top,
because
the
swap
application
will
be
likely
one
of
the
primary
places
to
to
buy
and
sell,
run
and
build
currencies.
But
then,
if
you're
building
your
own
app
your
own
application-
and
you
have
a
native
token
there-
you
may
want
to
list
it
on
swap
as
well.
A
So,
let's
start
when
I
go
to
the
swap
page
here,
I
I'm
started:
I'm
defaulted
to
input
as
run,
so
if
I
want
to
buy
a
new
currency,
this
would
be
how
I
would
do
that
and
then
I
can
decide
what
kind
of
token
I
want
to
buy.
So
let's
say
that
I
actually
want
to
buy
some
build
here
and
I'll.
I
want
to
spend
about
100
run
on
my
build
it's
going
to
take
a
second
to
get
the
price
loaded.
A
It
knows
that
one
build
equals
27
run,
so
I'm
only
buying
a
few
build
here.
Maybe
let's,
let's
up
this
a
little
bit
and
again
for
those
of
you
familiar
with
an
automated
market
maker,
you
likely
understand
what
this
is
doing
here.
If
you're,
not
that's,
probably
a
subject
for
a
different
video,
but
the
price
is
determined
based
on
the
amount
of
liquidity
that
is
in
the
liquidity
pool
underlying
the
swap.
A
So
I'm
going
to
go
ahead
and
decide
to
swap
this,
so
I'm
spending
500
run
to
buy
roughly
18
build
and
again
I'm
notified
that
I
want
to.
I
need
to
approve
that
in
my
wallet
and
so
that
offer
is
going
to
come
through
and
again.
This
is
another
offer,
that's
structured
with
offer
safety,
so
I
have
a
give
the
510
run
and
then
a
want
which
is
17.92
build.
A
One
thing
to
note
is
that
when
you
see
this
given
want
come
through,
the
numbers
may
not
entirely
match
exactly
what
you
put
into
the
swap
and
the
reason
for
that
is
it's
building
in
a
little
bit
of
slack
around
slippage
on
the
amm
and
actually,
if
you're,
if
you
use
uniswap
this
is
this
is
sort
of
done
in
the
background.
Without
you
really
realizing
it
as
well.
If
you
go
into
the
settings,
you
can
set
your
slippage
tolerance
and
you're
effectively
putting
a
limit
order
into
the
system.
A
That
says,
don't
execute
if
the
price
moves
more
than
this
much,
and
that's
all
that
this
is
doing
as
well,
so
I'm
gonna
go
ahead
and
accept
that.
So
again,
I
should
have
510
fewer
run
at
the
end
of
this
and
some
additional
build.
So
I've
got
43
build
right
now
and
then
796
run.
A
And
you
can
see
this
is
reset
here
and
if
I
reset
the
the
wallet
there
we
go,
payments
will
come
through
and
we'll
just
take
a
minute
to
plumb
through
the
system.
Here,
all
right,
so
I've
got
fewer
run.
I've
got
will
have
additional.
A
A
All
right,
so
the
build
has
now
refreshed.
Okay,
great.
So
this
is
the
these.
Are
the
primary
mechanics
of
the
treasury
application
that
we're
launching
as
part
of
beta
from
a
ui
perspective?
There's
there's
a
lot
that
we
want
to
improve
here.
A
lot
of
our
work
has
been
on
the
back
end
and
making
sure
that
things
link
together
correctly
a
lot
of
stuff.
We
want
to
improve
on
latency,
but
the
core
mechanics
are
here
and
as
a
developer,
you
can
see
how
they're
implemented.