Liquidswap Docs
GithubDappPontem Network
Liquidswap V0 Docs
Liquidswap V0 Docs
  • Introduction
    • Security Audits
    • Bounty Program
    • Developer Links
  • Protocol Overview
  • Smart Contracts
    • Generics
    • LP Coins
    • Routers
    • Scripts
    • Advanced Topics
    • 💥V0.5 Update
  • Integration
    • Test Coins
    • Let's Swap
    • Create Pool
    • Add Liquidity
    • Burn Liquidity
    • Basic Oracle
    • Flashloans
    • Unit Testing
  • Staking / Harvest
    • Overview
    • Smart Contracts
    • Integration Examples
    • DApp
    • Create your own farming pool
  • SDKs
  • Liquidswap Widget
  • Liquidswap DApp
    • Bridge
    • Testnet
  • Coins Registry
Powered by GitBook
On this page
  • Add as dependency
  • Register pool / stake
  • Harvest
  • Unstake
  • Boost
  • More
  1. Staking / Harvest

Integration Examples

PreviousSmart ContractsNextDApp

Last updated 2 years ago

Important: you need to have a very good idea of what you are doing, because there are some risks.

Use only test coins for test purposes. Your rewards or NFTs can get stuck in the staking pool if you use a wrong configuration, and you won't be able to withdraw them. First check that everything works on testnet and only then switch to the production environment!

We have prepared a few integration examples in case you want to integrate staking contracts into your Move smart contracts.

Add as dependency

Add the Harvest package as a dependency to your project updating Move.toml:

[dependencies.Harvest]
git = 'https://github.com/pontem-network/harvest.git'
rev = 'latest version'

Replace latest version with the actual one - see the latest version on the page.

As we are going to use Liquidswap LP coins in the example (though it's not mandatory for harvest contracts), add another dependency:

[dependencies.LiquidswapLP]
git = 'https://github.com/pontem-network/liquidswap.git'
subdir = 'liquidswap_lp/'
rev = 'v0.4.4'

Register pool / stake

Important: The following examples show how you can iterate with staking contracts in your smart contracts/product. The example is designed for educational purposes only; your code will probably be very different.

Let's say we want to register a pool that uses Liquidswap LP coins as staking coins and reward coins as an unknown generic. After that, we will immediately stake.

Harvest

If we want to harvest the rewards, we can extend the module above with the harvest function:

Unstake

Once one week has elapsed from the moment of staking or once the established harvesting period is complete, you can unstake:

Boost

To boost or remove a boost, look at the following example where we extract boost collection from config:

More

You can find more examples in our .

⚠️
Releases
tests
Register pool & stake
Harvest
Unstake