Satoru keeper service πŸ¦€.

Overview

Satoru keeper service πŸ¦€

πŸ“ Description

The keeper is an offchain service for Satoru protocol. It is responsible for:

  • Watching the user initiated actions and execute them onchain, following the 2-steps process mechanism of GMX v2.

πŸ“¦ Installation

πŸ“‹ Prerequisites

πŸ› οΈ Build

cargo build --release

Usage

RUST_LOG=info cargo run

Configuration

The keeper is configured using environment variables.

Name Description
KEEPER_RPC_URL The RPC URL of the Starket node.
KEEPER_SIGNER_PRIVATE_KEY The private key controlling the keeper account contract.
KEEPER_ACCOUNT_ADDRESS The address of the account contract of the keeper.
KEEPER_SATORU_EXCHANGE_ROUTER_ADDRESS The address of the Satoru exchange router contract.

As library

#[tokio::main]
async fn main() {
    let config = KeeperConfigBuilder::default()
        .rpc_url("https://127.0.0.1:5050")
        .signer_private_key("0x...")
        .account_address("0x...")
        .build()?;
    let keeper = Keeper::new(config).await.unwrap();

    // Then you can use the keeper to execute actions.
    // keeper.execute_deposit(...);
}

πŸ“„ License

This project is licensed under the MIT license.

See LICENSE for more information.

Happy coding! πŸŽ‰

πŸ“š Resources

Here are some resources to help you get started:

🫢 Contributors ✨

Thanks goes to these wonderful people (emoji key):

Abdel @ StarkWare
Abdel @ StarkWare

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

Comments
  • feat: keep a registry of open positions on satoru.

    feat: keep a registry of open positions on satoru.

    Feature Request

    Describe the Feature Request

    To be able to liquidate positions, we first need to keep track of every currently open positions and their state.

    Describe Preferred Solution

    First we should list all Satoru events that are related to creation/update of positions. Then we should listen to those events and store/update positions accordingly in a local database. We should use https://github.com/apibara/dna to accomplish this.

    When launching a liquidation keeper it should sync from a specified block (most likely specified in a config) to have the final state of open positions on Satoru.

    enhancement 
    opened by zarboq 0
  • feat: add a function to check if a position is liquidable.

    feat: add a function to check if a position is liquidable.

    Feature Request

    Describe the Feature Request

    We need a way to check whether we should liquidate a position or not.

    Describe Preferred Solution

    We could do a function that take in input a Position struct and current token prices of the market. Then we check in the function if the position is in a state in which it can be liquidated.

    Additional Context

    Insightful code to check for position liquidation can probably be found in GMX solidity code or here

    enhancement 
    opened by zarboq 0
  • feat: create function to call `execute_adl`

    feat: create function to call `execute_adl`

    Feature Request

    Describe the Feature Request

    Create a function to execute execute_adl function from satoru in adl_handler contract.

    Describe Preferred Solution

    Add it as a function in src/keepers/common.rs

    enhancement 
    opened by zarboq 0
  • feat: create function to call `execute_withdrawal`

    feat: create function to call `execute_withdrawal`

    Feature Request

    Describe the Feature Request

    Create a function to execute execute_withdrawal function from satoru in withdrawal_handler contract.

    Describe Preferred Solution

    Add it as a function in src/keepers/common.rs

    enhancement 
    opened by zarboq 1
  • feat: create function to call `execute_order`

    feat: create function to call `execute_order`

    Feature Request

    Describe the Feature Request

    Create a function to execute execute_order function from satoru in order_handler contract.

    Describe Preferred Solution

    Add it as a function in src/keepers/common.rs

    enhancement 
    opened by zarboq 1
  • feat: create function to call `execute_liquidation`

    feat: create function to call `execute_liquidation`

    Feature Request

    Describe the Feature Request

    Create a function to execute execute_liquidation function from satoru in liquidation_handler contract.

    Describe Preferred Solution

    Add it as a function in src/keepers/common.rs

    enhancement 
    opened by zarboq 0
Owner
Keep StarkNet Strange
Explore and push the frontiers of STARK based technology.
Keep StarkNet Strange
LaaS: Life as a Service

LaaS: Life as a Service $ curl life-as-a-service.herokuapp.com/-1x0~0x0~1x0 0x-1~0x0~0x1 let previous = '0x-1~0x0~0x1' for (let i = 0; i < 5; i++) {

Brandon Smith 5 Nov 1, 2021
A discord bot that safely executes whatever rust you throw at it. Remote code execution as a service

RustBot Bot is still under development and not ready for production use RustBot is a discord bot that executes whatever rust code you throw at it. In

Conner Bradley 7 Jan 3, 2022
Web service for Firefox Suggest

Merino A service to provide address bar suggestions to Firefox. For more details, see the service docs. About the Name This project drives an importan

Mozilla Services 27 Sep 23, 2022
RuES - Expression Evaluation as Service

RuES is a minimal JMES expression evaluation side-car, that uses JMESPath, and it can handle arbitrary JSON. Which effectively makes it general purpose logical expression evaluation engine, just like some Python libraries that used to evaluate logical expression. This in turn can allow you implement complex stuff like Rule engine, RBAC, or Policy engines etc.

Zohaib Sibte Hassan 14 Jan 3, 2022
Runit service management wrappers

void-svtools Basic wrappers for managing services for runit,

Isaac Hung 1 Aug 3, 2022
A Rust client for the NOAA Weather Wire Service Open Interface.

nwws-oi A Rust client for the NOAA Weather Wire Service Open Interface. NWWS-OI is one of several platforms through which the National Weather Service

Will Glynn 3 Sep 15, 2022
Matrix Bot for Bitcoin Push Notification Service

BPNS Matrix Bot Description Matrix Bot for Bitcoin Push Notification Service. Requirements Rust (1.57.0+) BPNS Server Matrix account Build cargo build

BPNS 0 Mar 14, 2022
A rust library for toornament.com service

A rust library for toornament.com service

Victor Polevoy 3 May 30, 2022
Web service generating images of Japanese (Riichi) Mahjong hands.

chombo-gen ChomboGen is a web service that allows to generate images of Japanese (Riichi) Mahjong hands. The hands are provided in a text format and a

Mateusz Maćkowski 5 May 2, 2023
Memory.lol - a tiny web service that provides historical information about social media accounts

memory.lol Overview This project is a tiny web service that provides historical information about social media accounts. It can currently be used to l

Travis Brown 317 Jul 12, 2023
Rust Keeper bots that run various functions, from liquidations, to orderbook cranks, and more.

The zo-keeper (pronounced "zoo keeper") repository runs large scale instructions that secure the 01 network, and allow it to operate in a fully decentralized manner.

Zero One Global Foundation 61 Dec 16, 2022
Wait Service is a pure rust program to test and wait on the availability of a service.

Wait Service Wait Service is a pure rust program to test and wait on the availability of a service.

Magic Len (Ron Li) 3 Jan 18, 2022
A purpose-built proxy for the Linkerd service mesh. Written in Rust.

This repo contains the transparent proxy component of Linkerd2. While the Linkerd2 proxy is heavily influenced by the Linkerd 1.X proxy, it comprises

Linkerd 1.7k Jan 7, 2023
A web service that generates images of dependency graphs for crates hosted on crates.io

crate-deps A web service that generates images of dependency graphs for crates hosted on crates.io This project is built entirely in Rust using these

Corey Farwell 20 Nov 9, 2020
An oauth2 client implementation providing the Device, Installed and Service Account flows.

yup-oauth2 is a utility library which implements several OAuth 2.0 flows. It's mainly used by google-apis-rs, to authenticate against Google services.

Lewin Bormann 174 Dec 30, 2022
A file storage service

hashfs A file storage service How to use it? Start up the service at terminal # You can specify the storage root path and access domain when you start

null 17 Dec 18, 2021
:construction: EXPERIMENTAL :construction: Secure hidden service webserver

narnia narnia is a fast static webserver specifically designed for Tor hidden services. It's also able to spawn a Tor thread and expose itself as a hi

null 41 Dec 30, 2022
ZeroNS: a name service centered around the ZeroTier Central API

ZeroNS: a name service centered around the ZeroTier Central API ZeroNS provides names that are a part of ZeroTier Central's configured networks; once

ZeroTier, Inc. 327 Dec 20, 2022
WebAssembly Service Porter

WebAssembly Service Porter.

henrylee2cn 12 Dec 12, 2022
Rust client for AWS Infinidash service.

AWS Infinidash - Fully featured Rust client Fully featured AWS Infinidash client for Rust applications. You can use the AWS Infinidash client to make

Rafael CarΓ­cio 15 Feb 12, 2022