Adrena
  • About Adrena
    • ๐Ÿ‘๏ธVision
    • ๐Ÿ’‰What is Adrena?
      • โœจNo Liquidation Fees
      • ๐Ÿซ—Peer-to-Pool Perp Model (and the risks as a Liquidity Provider)
      • ๐Ÿ‹๏ธTrading Competitions
        • 0๏ธโƒฃPre-Season: Awakening
        • 1๏ธโƒฃSeason 1: Expanse
      • ๐Ÿ’ฝRPC and Trade Execution
    • ๐Ÿง€Fees
      • ๐Ÿ’ฐRevenue Sharing
      • ๐ŸฏWays to Earn Overview
      • ๐Ÿ’ฑBuybacks
    • ๐Ÿ‘พTrader Profile
    • ๐Ÿ“–Achievements
    • ๐ŸงชMutagen (Points System)
    • ๐ŸคReferral System
    • Audits
    • Bug Bounty Program
    • ๐Ÿ”—Useful Links
  • Tokenomics
    • ๐ŸซฆTokenomics Overview
    • ๐Ÿช™ADX
      • ๐Ÿค‘Distribution
      • ๐Ÿ’ธEmissions
      • ๐Ÿ‘ฅForms of ADX
      • ๐ŸฆบVesting
      • ๐ŸšฐStaked ADX - Rewards Emissions Schedule
      • ๐Ÿ”Staking and Duration Locked Parameters for ADX
      • ๐Ÿ—ณ๏ธVoting
    • ๐Ÿ’ŽALP
      • ๐ŸŒŠGenesis Liquidity [terminated]
        • ๐Ÿ’ฆGenesis Liquidity Program [Terminated]
      • ๐ŸšฐStaked ALP - Rewards Emissions Schedule [Terminated]
      • ๐Ÿ”Staking and Locked Stake Parameters for ALP
  • Technical Documentation
    • ๐Ÿ‘คGovernance Shadow Token
    • ๐Ÿค–MrSablier & MrSablierStaking (Open Source Keepers)
    • ๐Ÿ”ฎOracles and Price Feeds
    • โ˜ข๏ธ"Toxic Flow" Countermeasures
    • ๐Ÿช–Position Parameters
    • โŒšSablier Automation Threads (deprecated)
    • ๐ŸฆStaking Implementation Details
    • Terms and Conditions
    • Token Terms and Conditions
  • Guides
    • ๐Ÿ’ปHow to Change to Devnet in Phantom Wallet
    • ๐Ÿ’งHow to get Devnet SOL
    • ๐Ÿ’ฐHow to Get Tokens to Trade
    • ๐Ÿ“ˆHow to Open and Close a Trade
  • Reports
    • 21/11/2024 - BE - Increase Position, position.price miscalculations
    • 22/10/2024 - Upgrade staking accounting issue causing extra reward distribution
    • 12/10/2024 - BE - Borrow fees reset on position increase
    • 01/10/2024 - BE - Custody internal state for `Assets` reports too much locked collateral
    • 27/09/2024 - BE - Missing accounts reload during fee distribution
Powered by GitBook
On this page
  • Future plans
  1. Technical Documentation

Sablier Automation Threads (deprecated)

This page will provide the exhaustive list of the tasks being automated on chain using Sablier (Adrena sponsored Clockwork fork) by the Adrena program.

DEPRECATED - We now use MrSablier and MrSablierStaking gRPC rust client leveraging Triton Yellowstone. More info here MrSablier & MrSablierStaking (Open Source Keepers)


As described in MrSablier & MrSablierStaking (Open Source Keepers), Adrena automates recurring tasks on-chain rather than using keepers. On chain automation is a glorified Keeper, but with a more robust interface, and a better separation of concerns.


Genesis Liquidity Program related automation

In add_pool_part_two a thread is created to automatically terminate (one time) the program at the determined time.

In add_genesis_liquidity a thread is created to terminate this locked stake on behalf of the user at the end of the elected lock duration.

For more info about the Genesis Liquidity Program, see Genesis Liquidity Program [Terminated]

Staking related automation

In init_staking_four a thread is created to resolve staking round automatically (periodically).

In create_locked_stake a thread is created to terminate this locked stake on behalf of the user at the end of the elected lock duration.

In init_user_staking a thread is created to periodically claim rewards on behalf of the user.

In finalize_locked_stake the thread is cancelled if the instruction is called manually by the owner.

In add_locked_stake the auto-rewards-claim thread is resumed if it was paused.

In remove_liquid_stake the auto-reward-claim thread is paused if there isn't any stake left.

In remove_locked_stake the auto-reward-claim thread is paused.

For more info about Staking (Rounds, resolution, user_staking...) see the technicals at Staking Implementation Details.


Future plans

We plan to add support for on chain liquidation, similarly to the above.

The twist for liquidations is that they are a function of a 2 parameters:

  • asset price

  • borrow fees

There are the 2 parameters that affect the position health dynamically and that need to be computed to know wether the position is under water. As it is currently, Sablier threads have triggers for a single on chain value. We are working on implementing a more general solution.

The other thing we have to add, is a existing threads cleanup instruction callabable by the user. That would cleanup past locked stakes thread for instance, and return remaining funds to the user.


PreviousPosition ParametersNextStaking Implementation Details

Last updated 6 months ago

โŒš