Sablier Automation Threads

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

As described in On-chain Automation Instead of 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.


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

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.


Last updated