Comment on page
WUSETHer
The
WUSETHer
is the "liquidity mining" contract for WUSD. In contrast to traditional liquidity mining that relies on inflation and is inherently vulnerable to mercenaries or, more recently, bonding mechanisms with tenuous efficacy, GLO's unique credit system offers a third way: granting credit to liquidity providers.
The
WUSETHer
allows users to earn GLO credit (for the GLO in their wallets) and trading fees for providing full-range Uniswap v3 WUSD-WETH liquidity.The
WUSETHer
is basically a simplified interface to the canonical WUSD-WETH Uniswap v3 1% fee tier pool with the ability to grant GLO credit for usage.Liquidity created on Uniswap v3 is identified by nfts. This returns a list of all such nfts created via the
WUSETHer
.Returns the Uniswap v3 liquidity nft owned by
account
. Unlike
Provisioner
, there's only one range here so account
can have only one nft, hence the lack of "s" in the functionThis returns data about some WUSD-WETH provision of liquidity identified by its Uniswap v3
nft
id.Name | Meaning |
---|---|
liquidity | |
timestamp | Timestamp of provide() or last executed updating function |
withdrawable | Timestamp past which owner of nft can withdraw some liquidity |
withdrawable
is a timestamp 24 hours ahead of the initial provide()
or last increase()
.Used to provide the WUSD-WETH full-range liquidity for the first time via
referrer
's frontend.Name | Meaning |
---|---|
addable0 | Amount of WUSD to optimistically create liquidity position with |
addable1 | Amount of WETH to optimistically create liquidity position with |
referrer | Address of registered frontend enabling the interaction or 0 address |
Like wrapping, there's a service fee, paid in USDT, of 1% of the actually added WUSD amount — or 100, whichever is higher. This can be executed only once per user.
The liquidity position created cannot be withdrawn for 24 hours, available through
withdrawable
in the preceding function.The caller must approve
WUSETHer
to spend their WUSD, WETH, and USDTUsed to increase a user's WUSD-WETH liquidity.
Name | Meaning |
---|---|
addable0 | Amount of WUSD to optimistically add to existing liquidity |
addable1 | Amount of WETH to optimistically add to existing liquidity |
Just as with
provide()
above, there's a service fee, also paid in USDT, of 1% of the actually added WUSD amount — or 100, whichever is higher.- The caller must approve
WUSETHer
to spend their WUSD, WETH, and USDT provisionOf(nft).withdrawable
is updated after execution
Used to decrease a user's WUSD-WETH liquidity.
Name | Meaning |
---|---|
percentage | A percentage, in basis point, to decrease the liquidity by |
When a liquidity position is decreased, the constituent tokens — WUSD and WETH — that make up the position, as well as any fees earned, are withdrawn from Uniswap and returned to the user.
The WUSD withdrawn is then used to calculate how much GLO credit a user has earned for their GLO wallet balance. The credit earned is, at most, +1% for every 100K WUSD deposited per week since the last
provisionOf(nft).timestamp
update. It is always, at most, 1% per week deposited, where 100K (or more) WUSD deposited gives the full 1%.If the WUSD being withdrawn — whether via this function,
collect()
, or decrease()
— is under ~1% of 100K, no credit will be earned unless the deposit was left for several weeks.block.timestamp > provisionOf(nft).withdrawable
must be truepercentage
must be>0 && <100e18
, scaled such that 1% is 1e18provisionOf(nft).timestamp
is updated after execution
Used to collect fees earned by user's WUSD-WETH liquidity.
In the manner of
decrease()
, this returns the constituent tokens that make up the fee and the WUSD portion is used to calculate how much GLO credit the user gets.provisionOf(nft).timestamp
is updated after executionUsed to completely withdraw a user's WUSD-WETH liquidity.
Identical to
decrease()
but effectively presets percentage
to 100%
.The
nft
is deleted from both WUSETHer
and Uniswap and can no longer be used in either system.Last modified 5mo ago