Sperax
  • USDs (Sperax USD)
    • Minting and Redeeming
    • Auto Yield
      • Smart Contracts can opt in for the rebase feature (Auto-yield).
    • Stability Mechanism
    • Key parameters and functions
    • Technical documents
      • Sequence diagrams
      • Smart contracts
        • Vault
        • USDs
        • CollateralManager
        • SPA Buyback
        • MasterPriceOracle
        • Yield Reserve
        • Fee Calculator
        • RebaseManager
        • Dripper
        • BaseStrategy
      • Deployed contracts
  • Buyback Contract
  • Staking Protocol
    • Locking SPA
    • Withdrawing SPA
    • Staking Rewards
  • Demeter Protocol
    • How does Demeter Work?
    • Technical documents
      • Smart contracts
        • E721 Farms
          • E721Farm
          • Camelot V3
            • CamelotV3FarmDeployer
            • CamelotV3Farm
        • Base contracts
          • Farm
          • FarmStorage
          • FarmRegistry
          • FarmDeployer
        • Features
          • ClaimableFee
          • ExpirableFarm
          • OperableDeposit
        • Rewarder
          • Rewarder
          • RewarderFactory
      • Deployed contracts
  • Getting Started on Our DApp
    • Minting & Redeeming USDs
    • Stake SPA
  • Governance
  • Bug Bounty Program
  • FAQ
    • SPA Tokenomics
    • xSPA token
    • Smart Contract Addresses
    • How to Transfer SPA from Ethereum to Arbitrum
  • Quick Links
    • Audit Reports
    • Sperax Dapp
    • Demeter Dapp
    • Discord
    • Forum
    • Snapshot
Powered by GitBook
On this page
  • Functions
  • _updateSubscriptionForIncrease
  • _updateSubscriptionForDecrease
  • _increaseDeposit
  • _decreaseDeposit
  • Events
  • DepositIncreased
  • DepositDecreased
  • Errors
  • DecreaseDepositNotPermitted
  • InsufficientLiquidity

Was this helpful?

Export as PDF
  1. Demeter Protocol
  2. Technical documents
  3. Smart contracts
  4. Features

OperableDeposit

PreviousExpirableFarmNextRewarder

Was this helpful?

Inherits: Farm

Author: Sperax Foundation.

This contract helps in creating farms with increase/decrease deposit functionality.

Functions

_updateSubscriptionForIncrease

Update subscription data of a deposit for increase in liquidity.

function _updateSubscriptionForIncrease(uint256 _depositId, uint256 _amount) internal;

Parameters

Name
Type
Description

_depositId

uint256

Unique deposit id for the deposit.

_amount

uint256

_amount to be increased.

_updateSubscriptionForDecrease

Update subscription data of a deposit after decrease in liquidity.

function _updateSubscriptionForDecrease(uint256 _depositId, uint256 _amount) internal;

Parameters

Name
Type
Description

_depositId

uint256

Unique deposit id for the deposit

_amount

uint256

_amount to be decreased.

_increaseDeposit

Common logic for increasing a deposit.

function _increaseDeposit(uint256 _depositId, uint256 _amount) internal;

Parameters

Name
Type
Description

_depositId

uint256

Unique deposit id for the deposit

_amount

uint256

_amount to be decreased.

_decreaseDeposit

Common logic for decreasing a deposit.

function _decreaseDeposit(uint256 _depositId, uint256 _amount) internal;

Parameters

Name
Type
Description

_depositId

uint256

Unique deposit id for the deposit

_amount

uint256

_amount to be decreased.

Events

DepositIncreased

event DepositIncreased(uint256 indexed depositId, uint256 liquidity);

DepositDecreased

event DepositDecreased(uint256 indexed depositId, uint256 liquidity);

Errors

DecreaseDepositNotPermitted

error DecreaseDepositNotPermitted();

InsufficientLiquidity

error InsufficientLiquidity();
Git Source