30 lines
1.2 KiB
Plaintext
30 lines
1.2 KiB
Plaintext
# Keepers
|
||
|
||
## Keeper Bots
|
||
|
||
Keeper Bots listen, store, sort and fill valid limit orders. Keepers do this by compiling all valid open orders found on-chain and organising them into an off-chain orderbook. These orders are sorted by price and age, and if two orders have the same age, they’re then sorted by position size.
|
||
|
||
Each Keeper holds its own orderbook (hence _decentralised_ orderbook).
|
||
|
||
Keepers then listen to trigger conditions and match crossing orders and limit orders against the AMM when the users’ trigger or limit price is met.
|
||
|
||
For performing this critical duty, the Keepers earn a fee for every trade they execute. Similar to liquidation bots, Keepers will compete for fees in a decentralised system; the most profitable Keepers are:
|
||
|
||
<Steps>
|
||
### Fastest
|
||
|
||
Speed is a primary advantage in competing for fees.
|
||
|
||
### Best price improvement for takers
|
||
|
||
Keepers that provide better prices to takers gain a competitive edge.
|
||
|
||
### Fulfil orders in the protocol’s desired sequence
|
||
|
||
Keepers that execute orders in the desired order, oldest and largest first, are preferred.
|
||
</Steps>
|
||
|
||
Reference implementations for the filler and trigger Keepers are provided: [Keeper Bots](/developers/trading-automation).
|
||
|
||

|