Aftermath
  • Aftermath
    • About Aftermath Finance
      • What are we building?
  • Getting Started
    • Creating an account
      • zkLogin
        • Removing a zkLogin account
      • Sui Metamask Snap
      • Native Sui wallets
    • Dynamic Gas
    • Navigating Aftermath
      • Interacting with your Wallet
      • Viewing your Portfolio
      • Changing your Settings
      • Bridge
      • Referrals
  • Trade
    • Smart-Order Router
      • Agg of Aggs
      • Making a trade
      • Exact Out
      • Fees
    • DCA
      • Why should I use DCA
      • How does DCA work
      • Tutorials
        • Creating a DCA order
        • Monitoring DCA progress
        • Advanced Features
      • Fees
      • Contracts
  • Limit Orders
    • Contracts
    • Fees
  • Pools
    • Constant Function Market Maker
      • Tutorials
        • Depositing
        • Withdrawing
        • Creating a Pool
      • Fees
      • Contracts
      • Audit
  • Farms
    • Afterburner Vaults
      • Tutorials
        • Staking into a Farm
        • Claiming Rewards
        • Unstaking
        • Creating a Farm
      • Architecture
        • Vault
        • Stake Position
      • Fees
      • FAQs
  • Liquid Staking
    • afSUI
      • Tutorials
        • Staking
        • Unstaking
      • Architecture
        • Packages & Modules
        • Entry Points
      • Fees
      • FAQs
      • Contracts
      • Audit
  • Perpetuals
    • Aftermath Perpetuals
      • Tutorials
        • Creating an Account
        • Selecting a Market
        • Creating a Market Order
        • Creating a Limit Order
        • Maintaining your Positions
      • Architecture
        • Oracle Prices
        • Margin
        • Account
        • Trading
        • Funding
        • Liquidations
        • Fees
  • GameFi
    • NFT AMM
      • Architecture
        • Fission Vaults
        • AMM Pools
      • Tutorials
        • Buy
        • Sell
        • Deposit
        • Withdraw
      • Sui Overflow
  • Our validator
    • About us
  • Developers
    • Aftermath TS SDK
      • Utils
        • Coin
        • Users Data
        • Authorization
      • Products
        • Prices
        • Router
        • DCA
        • Limit Orders
        • Liquid Staking
        • Pools
        • Farms
    • Aftermath REST API
  • Egg
    • About Egg
  • Legal
    • Terms of Service
    • Privacy Policy
  • Languages
    • 中文
    • 한국어
  • Links
    • X
    • Telegram
    • Discord
    • Github
    • Medium
    • Aftermath Validator
Powered by GitBook
On this page
  • Staked position package
  • Opening a position
  • Harvesting rewards
  • Adding to a stake
  • Withdrawing a stake
  • Prolonging a position's lock
  • Joining positions
  • Splitting positions
  • Closing a position
  1. Farms
  2. Afterburner Vaults
  3. Architecture

Stake Position

Staked position package

This package provides an interface to the staked position manipulation. The main entry point is the StakedPosition structure.

Opening a position

A user can open a position by using the stake function. When opening a position, a user has to specify the lock duration period in milliseconds. The lock duration should respect the boundaries set during the Afterburner Vault configuration.

A locked position will receive bonus rewards in respect of the configured Afterburner Vault’s multiplier.

Harvesting rewards

Rewards harvesting is a three-stage process:

  • a user has to call the begin_harvest<STAKE> function;

  • for each reward, a user should call the harvest_rewards<STAKE, REWARD> function. It will allow the user to obtain rewards accrued for the type `Coin<REWARD>`;

  • to finalize the process a user has to call the end_harvest function which emits the corresponding event.

For a Strict implementation, a user can claim their rewards at any moment.

For a Relaxed implementation, a user can claim their rewards only after the position is unlocked.

Adding to a stake

At any given moment a user can increase the position’s staked amount by using the deposit_principal function. After increasing the stake of a locked position, the lock period is recalculated.

Withdrawing a stake

A user may withdraw the staked principal by using the withdraw_principal<STAKE> function. The position must be unlocked in order to withdraw from it.

It is not possible to unlock a position staked in the Strict Afterburner Vault before the end of the lock period.

Prolonging a position's lock

A user may increase a lock period by using the renew_lock function.

Joining positions

A user may merge two positions by using the join function. The resulting position will have the most recent lock start time and the longer lock duration between the two positions.

Splitting positions

A user may split a position into two by using the split function. The accumulated rewards are split between the two positions determined by the pro-rata amount being split over the total staked amount. All other parameters are kept identical to the original position.

Closing a position

A user may delete an inactive position by using the destroy function. The destroyed position must not have any principal or rewards remaining.

PreviousVaultNextFees

Last updated 1 year ago