This is the github repo for the Spot Lite protocol.

Overview

spot-contract

This is the github repo for the Spot Lite protocol.

Set up local Sei

Please follow the documentation on the official Sei doc to set up your local sei testing environment.

You can also use this deployment script to automate set up Sei locally: https://github.com/sei-protocol/sei-chain/blob/master/scripts/initialize_local_test_node.sh

Instantiating a contract

The following steps show how to upload your contract to the chain. Note that the following steps are run from your contract directory, so they assume seid is in your $PATH:

cargo build

Use rust-optimizer to reduce the size of the compiled wasm file:

docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/rust-optimizer:0.12.11

Deploy Spot Lite contract to Sei

The following steps show how to deploy your contract to the chain and place a test order. Make sure you have the Sei chain running in the background before proceeding!

// store the contract to Sei
seid tx wasm store artifacts/spot_lite.wasm -y --from=admin --chain-id=sei-chain --gas=2000000 --fees=20000usei --broadcast-mode=block

// instantiate the contract
seid tx wasm instantiate 1 "{}" --from admin --broadcast-mode=block --label "spot" --admin sei10fptzxjjewqgrazq6hrn8hvyza6s92qhzqu98h --chain-id sei-chain --gas=2000000 --fees=20000usei -y

// register contract to the dex module
seid tx dex register-contract sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m 1 true true 1000000000 -y --from=admin --chain-id=sei-chain --fees=20000usei --gas=2000000 --broadcast-mode=block

// register tradable pairs 
seid tx dex register-pairs scripts/deployment/data/register_pair_proposal.json -y --from=admin --chain-id=sei-chain --fees=2000usei --gas=200000 --broadcast-mode=block

You can also use the deployment script below to deploy the spot contract:

cd scripts/deployment
chmod 755 spot_deploy.sh
./spot_deploy.sh

Then you're all set! Remember to write down the contract address printed out at the end of the scripts, as you will need the address to interact with the deployed contract.

Interact with Spot Lite contract

You can place order through the seid Cli and query the result there:

# order is formatted in OrderDirection?Quantity?Price?PriceAsset?QuoteAsset?OrderType?OrderData
 seid tx dex place-orders sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m 'LONG?1.01?5?USDC?ATOM?LIMIT?{"leverage":"1","position_effect":"Open"}' --amount=1000000uusdc -y --from=admin --chain-id=sei-chain --fees=1000usei --gas=100000 --broadcast-mode=block
seid q dex list-long-book sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m  uusdc uatom
You might also like...
A working example of multi targets compilation for Rust using Github Actions.

A working example of multi targets compilation for Rust using Github Actions. Supports Windows, MacOSX, x86_64, ARM and Raspberry PI Linux.

Self-Hosted alternative to GitHub Gists

Gists Self-Hosted GitHub Gists Features Upload code snippets Syntax Highlighting Comments Versioning through Git Fork gists Gist privacy: public, unli

runs init, preview and apply on pulumi stacks right in your Github Actions. Inspired from Atalantis for Terraform

pulumi-actions runs init, preview and apply on pulumi stacks right in your Github-Actions. Inspired from Atlantis for Terraform PREVIEW Release Curren

Rust port of the official Windows Driver Samples on Github. Leverages windows-drivers-rs

Rust Driver Samples This is a Rust port of the driver samples from the original Windows Driver Samples on Github. The repository provides examples and

Rust implementation of the legacy Master Server Query Protocol

msq-rs Rust library implementation of the legacy Master Server Query Protocol. Documentation crates.io Repository Release Notes Usage Add this to your

A rust implementation of the reverse-engineered Glorious mouse protocol

gloryctl This project is an implementation of the vendor-specific HID protocol in use by Glorious mice used to configure parameters such as DPI profil

Traction is a protocol for issuing American options on Solana.

Traction is a protocol for issuing American options on Solana.

Noir Pay - Fork of the Light Protocol Program for local testing / optimisation.

Noir Pay v0 Built on Light Protocol Noir Pay will be directly built ontop of the Light Protocol SDK and provide users with a beautifully simple privat

An unofficial and incomplete no_std Rust library for implementing the ElectricUI Binary Protocol
An unofficial and incomplete no_std Rust library for implementing the ElectricUI Binary Protocol

An unofficial and incomplete no_std Rust library for implementing the ElectricUI Binary Protocol

Owner
nick
nick
A small utility for tracking the change in opening and closing of issues in a GitHub repo

A small utility for tracking the change in opening and closing of issues in a GitHub repo. This tool can be used to build visualizations for issue triage over time with the hope of motivating closing more issues than are opened.

Ryan Levick 12 Sep 29, 2021
Github mirror of codeberg repo. Monitor live bandwidth usage/ network speed on PC. Native version also available for Android, separately.

Netspeed Monitor Netspeed is a cross-platform desktop application that shows the live upload speed, download speed and day's usage as an overlay. Feat

Vishnu N K 16 May 3, 2023
A lite tool to make systemd work in any container(Windows Subsystem for Linux 2, Docker, Podman, etc.)

Angea Naming from hydrangea(アジサイ) A lite tool to make systemd work in any container(Windows Subsystem for Linux 2, Docker, Podman, etc.) WSL1 is not s

いんしさくら 16 Dec 5, 2022
Repo for Monaco, a DCA engine for Solana. Built on Solend and lending protocols (Jet, Solend, Port, etc...)

Monaco Monaco is a DCA protocol for solana built on top of Serum and compatible with any program that implements or extends the instruction interface

Rohan Kapur 19 Apr 13, 2022
Ultralight, security-first service mesh for Kubernetes. Main repo for Linkerd 2.x.

Linkerd ?? Welcome to Linkerd! ?? Linkerd is an ultralight, security-first service mesh for Kubernetes. Linkerd adds critical security, observability,

Linkerd 9.2k Jan 1, 2023
This repo is a sample video search app using AWS services.

Video Search This repo is a sample video search app using AWS services. You can check the demo on this link. Features Transcribing Video and generate

AWS Samples 8 Jan 5, 2023
This repo scans pypi, rubygems and hexpm for AWS keys

What is this? This is a project to try to detect any AWS access keys that are accidentally uploaded to the Python Package Index (PyPi). New uploads ar

Tom Forbes 80 Jan 28, 2023
A artifact repo written in rust ! (still in develop)

Rstore A Rust-based artifact repository (still in development) usage name http frame axum orm disel s3 aws-sdk-s3 log log4rs config config-rs http cli

Rambler 3 May 8, 2023
Crate of GitHub’s collection of gitignores, embedded, automatically updated

Gitignores GitHub’s collection of gitignores, embedded, automatically updated. API documentation. Public Domain via CC0-1.0 (same as source data). MSR

null 3 May 3, 2022
Make the github cli even better with fuzzy finding

github-repo-clone (grc) Github Repo Clone is a command line utility written in rust that leverages the power of fuzzy finding with the github cli Usag

Jared Moulton 2 Jul 9, 2022