Jobs
Quick Start Examples
Simple Keeper
To setup a keeper function simply add the following modifier in your contract:
It could be then implement it like this:
The above will make sure the caller is a registered keeper as well as reward them with an amount of KP3R equal to their gas spent + premium. Make sure to have enough credits assigned in the Keep3r system for the relevant job.
Adding Jobs
Jobs can be created directly via addJob()
.
Managing Credits
Jobs need credit to be able to pay keepers, this credit can either be paid for directly (see Token Payments), or by being a liquidity provider (see Credit Mining) in the system. If you pay directly, this is a direct expense, if you are a liquidity provider, you get all your liquidity back after you are done being a provider.
Start mining credits for your job via Liquidity
To start mining credits, you will need to provide LP tokens as liquidity by calling addLiquidityToJob()
. You receive all your LP tokens back when you no longer need to provide credit for a contract.
Remove liquidity from a job
To remove your liquidity from a job, you will need to call unbondLiquidityFromJob()
.
Wait UNBOND
(default 14 days) days and call withdrawLiquidityFromJob()
.
Adding credits directly (non ETH)
To add Token Credits to your job, you will need to call addTokenCreditsToJob()
.
Adding KP3R tokens is not allowed this way, the only way is via liquidity mining.
Selecting Keepers
Dependent on your requirements you might allow any keepers, or you want to limit specific keepers, you can filter keepers based on age
, bond
, total earned funds
, or even arbitrary values such as additional bonded tokens.
No access control
Accept all keepers in the system.
Filtered access control
Filter keepers based on bonded amount of tokens, earned funds, and age in system. For example a keeper might need to have SNX
to be able to participate in the Synthetix ecosystem.
Paying Keepers
There are two primary payment mechanisms and these are based on the credit provided;
Pay via liquidity provided tokens (based on
addLiquidityToJob
)Pay in direct token (based on
addTokenCreditsToJob
)
Auto Pay
Pay for Work
If you don't want to worry about calculating payment, you can simply let the system calculate the recommended payment itself.
Pay with KP3R
Pay with an ERC20 token
Disputing and Slashing a Job
Disputed Job
A job might be disputed by a disputer if there is suspicious activity detected within that job.
A good behavior is expected from jobs, this includes but isn't limited to:
NOT leverage the network of keepers for malicious activities (exploits, rug pulls, etc.).
NOT limiting qualified keepers to work on their job.
NOT creating a malicious workable function to drain credits from the network.
In case it's disputed, the job won't be able to be worked by keepers, withdraw LPs / tokens credits nor perform a job migration.
Slashed Jobs
Jobs that are detected to have a malicious behavior within the network (either towards the network or the protocol they are working for — eg: exploiting a protocol) will get their LP tokens slashed and seized by governance.
Job Migration
There may be situations where a job needs to migrate all of their "assets" to another contract address, for a job update for example. A proper migration implies the accountancy (tokens, liquidities, period credits) from the original job address will be transferred to the new one. This process is possible, and it requires the job to call two functions:
migrateJob()
first to start the migration process. This function should be call by the owner of the job that currently holds the assets to migrate.
acceptJobMigration()
to complete the migration process. This function should be call by the owner of the job that will receive the assets to migrate.
There are some considerations the job wishing to migrate must take into account to prevent the functions from reverting:
It must not provide its current address as the address where it wants to migrate to when calling
migrateJob
.Calls to both
migrateJob
andacceptJobMigration
should be done with the same arguments.Neither of the jobs involved in the migration process should be disputed
It must wait at least one minute between migrations
Here's a graphic representation to visualize the resulting changes in the credits of a job that goes through a successful migration.
Additional Information
Once you set up your job on the protocol, you will be able to request for it to be registered on the Job Board providing the following data to governance:
Job Address
Job Name
Job Address Link (Etherscan)
Job Documentation (script)
This information will be used to display the job on the UI, and will provide users and keepers of the network with additional information regarding the jobs of the network.
Last updated