Liquity - Mainnet

Lending & Borrowing. Liquity-v1 connector on mainnet triggers methods like open, close, deposit, withdraw, borrow, repay, adjust, claimCollateralFromRedemption, stabilityDeposit, stabilityWithdraw, stabilityMoveEthGainToTrove, stake, unstake, claimStakingGains. You can view details like source code, ABIs on Etherscan.

  • Use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee to indicate ETH.
  • use -1 or dsa.maxValue for the maximum amount in function.
  • If not sure about the arguments getId and setId, pass 0.

Open

Opens a Trove by depositing ETH and borrowing LUSD

spells.add({  connector: "LIQUITY-A",  method: "open",  args: [depositAmount, maxFeePercentage, borrowAmount, upperHint, lowerHint, getIds, setIds]});
Parameter Type Description
depositAmount uint The amount of ETH to deposit
maxFeePercentage uint The maximum borrow fee that this transaction should permit
borrowAmount uint The amount of LUSD to borrow
upperHint address Address of the Trove near the upper bound of where the user's Trove should now sit in the ordered Trove list
lowerHint address Address of the Trove near the lower bound of where the user's Trove should now sit in the ordered Trove list
getIds uint[] Optional (default: 0) Optional storage slot to get deposit & borrow amounts stored using other spells
setIds uint[] Optional (default: 0) Optional storage slot to set deposit & borrow amounts to be used in future spells

Close

Closes a Trove by repaying LUSD debt

spells.add({  connector: "LIQUITY-A",  method: "close",  args: [setId]});
Parameter Type Description
setId uint Optional storage slot to store the ETH withdrawn from the Trove

Deposit

Increase Trove collateral (collateral Top up)

spells.add({  connector: "LIQUITY-A",  method: "deposit",  args: [amount, upperHint, lowerHint, getId, setId]});
Parameter Type Description
amount uint Amount of ETH to deposit into Trove
upperHint address Address of the Trove near the upper bound of where the user's Trove should now sit in the ordered Trove list
lowerHint address Address of the Trove near the lower bound of where the user's Trove should now sit in the ordered Trove list
getId uint Optional storage slot to retrieve the ETH from
setId uint Optional storage slot to set the ETH deposited

Withdraw

Move Trove collateral from Trove to DSA

spells.add({  connector: "LIQUITY-A",  method: "withdraw",  args: [amount, upperHint, lowerHint, getId, setId]});
Parameter Type Description
amount uint Amount of ETH to move from Trove to DSA
upperHint address Address of the Trove near the upper bound of where the user's Trove should now sit in the ordered Trove list
lowerHint address Address of the Trove near the lower bound of where the user's Trove should now sit in the ordered Trove list
getId uint Optional storage slot to get the amount of ETH to withdraw
setId uint Optional storage slot to store the withdrawn ETH in

Borrow

Borrow LUSD via an existing Trove

spells.add({  connector: "LIQUITY-A",  method: "borrow",  args: [maxFeePercentage, amount, upperHint, lowerHint, getId, setId]});
Parameter Type Description
maxFeePercentage uint The maximum borrow fee that this transaction should permit
amount uint Amount of LUSD to borrow
upperHint address Address of the Trove near the upper bound of where the user's Trove should now sit in the ordered Trove list
lowerHint address Address of the Trove near the lower bound of where the user's Trove should now sit in the ordered Trove list
getId uint Optional storage slot to retrieve the amount of LUSD to borrow
setId uint Optional storage slot to store the final amount of LUSD borrowed

Repay

Repay LUSD Trove debt

spells.add({  connector: "LIQUITY-A",  method: "repay",  args: [amount, upperHint, lowerHint, getId, setId]});
Parameter Type Description
amount uint Amount of LUSD to repay
upperHint address Address of the Trove near the upper bound of where the user's Trove should now sit in the ordered Trove list
lowerHint address Address of the Trove near the lower bound of where the user's Trove should now sit in the ordered Trove list
getId uint Optional storage slot to retrieve the amount of LUSD from
setId uint Optional storage slot to store the final amount of LUSD repaid

Adjust

Adjust Trove debt and/or collateral

spells.add({  connector: "LIQUITY-A",  method: "adjust",  args: [maxFeePercentage, depositAmount, withdrawAmount, borrowAmount, repayAmount, upperHint, lowerHint, getIds, setIds]});
Parameter Type Description
maxFeePercentage uint The maximum borrow fee that this transaction should permit
depositAmount uint Amount of ETH to deposit
withdrawAmount uint Amount of ETH to withdraw
borrowAmount uint Amount of LUSD to borrow
repayAmount uint Amount of LUSD to repay
upperHint address Address of the Trove near the upper bound of where the user's Trove should now sit in the ordered Trove list
lowerHint address Address of the Trove near the lower bound of where the user's Trove should now sit in the ordered Trove list
getIds uint[] Optional Get Ids for deposit, withdraw, borrow & repay
setIds uint[] Optional Set Ids for deposit, withdraw, borrow & repay

ClaimCollateralFromRedemption

Claim remaining collateral from Trove

spells.add({  connector: "LIQUITY-A",  method: "claimCollateralFromRedemption",  args: [setId]});
Parameter Type Description
setId uint Optional storage slot to store the ETH claimed

StabilityDeposit

Deposit LUSD into Stability Pool

spells.add({  connector: "LIQUITY-A",  method: "stabilityDeposit",  args: [amount, frontendTag, getDepositId, setDepositId, setEthGainId, setLqtyGainId]});
Parameter Type Description
amount uint Amount of LUSD to deposit into Stability Pool
frontendTag address Address of the frontend to make this deposit against (determines the kickback rate of rewards)
getDepositId uint Optional storage slot to retrieve the amount of LUSD from
setDepositId uint Optional storage slot to store the final amount of LUSD deposited
setEthGainId uint Optional storage slot to store any ETH gains in
setLqtyGainId uint Optional storage slot to store any LQTY gains in

StabilityWithdraw

Withdraw LUSD from Stability Pool

spells.add({  connector: "LIQUITY-A",  method: "stabilityWithdraw",  args: [amount, getWithdrawId, setWithdrawId, setEthGainId, setLqtyGainId]});
Parameter Type Description
amount uint Amount of LUSD to withdraw from Stability Pool
getWithdrawId uint Optional storage slot to retrieve the amount of LUSD to withdraw from
setWithdrawId uint Optional storage slot to store the withdrawn LUSD
setEthGainId uint Optional storage slot to store any ETH gains in
setLqtyGainId uint Optional storage slot to store any LQTY gains in

StabilityMoveEthGainToTrove

Moves user's ETH gain from the Stability Pool into their Trove

spells.add({  connector: "LIQUITY-A",  method: "stabilityMoveEthGainToTrove",  args: [upperHint, lowerHint]});
Parameter Type Description
upperHint address Address of the Trove near the upper bound of where the user's Trove should now sit in the ordered Trove list
lowerHint address Address of the Trove near the lower bound of where the user's Trove should now sit in the ordered Trove list

Stake

Stake LQTY in Staking Pool

spells.add({  connector: "LIQUITY-A",  method: "stake",  args: [amount, getStakeId, setStakeId, setEthGainId, setLusdGainId]});
Parameter Type Description
amount uint Amount of LQTY to stake
getStakeId uint Optional storage slot to retrieve the amount of LQTY to stake
setStakeId uint Optional storage slot to store the final staked amount (can differ if requested with max balance: uint(-1))
setEthGainId uint Optional storage slot to store any ETH gains
setLusdGainId uint Optional storage slot to store any LUSD gains

Unstake

Unstake LQTY in Staking Pool

spells.add({  connector: "LIQUITY-A",  method: "unstake",  args: [amount, getUnstakeId, setUnstakeId, setEthGainId, setLusdGainId]});
Parameter Type Description
amount uint Amount of LQTY to unstake
getUnstakeId uint Optional storage slot to retrieve the amount of LQTY to unstake
setUnstakeId uint Optional storage slot to store the unstaked LQTY
setEthGainId uint Optional storage slot to store any ETH gains
setLusdGainId uint Optional storage slot to store any LUSD gains

ClaimStakingGains

Claim ETH and LUSD gains from Staking

spells.add({  connector: "LIQUITY-A",  method: "claimStakingGains",  args: [setEthGainId, setLusdGainId]});
Parameter Type Description
setEthGainId uint Optional storage slot to store the claimed ETH
setLusdGainId uint Optional storage slot to store the claimed LUSD

If you still can't find something you're looking for or have any questions, ask them at our developers community on Discord or simply send an Email.


Our team is excited about assisting you to build an application using Instadapp Developer Platform. Your questions and feedback help us make a better development environment for future developers.