GithubHelp home page GithubHelp logo

senchahq / sencha Goto Github PK

View Code? Open in Web Editor NEW
43.0 0.0 17.0 2.96 MB

Sencha is an automated market maker for Solana tokens.

Home Page: https://sencha.so

License: GNU Affero General Public License v3.0

JavaScript 0.23% Shell 1.43% Nix 0.15% Rust 44.92% TypeScript 53.27%

sencha's Introduction

Sencha ๐Ÿต

License Build Status Contributors

Sencha

Sencha is an automated market maker for Solana tokens.

We're in active development. For the latest updates, please join our community:

Note

  • Sencha is in active development, so all APIs are subject to change.
  • This code is unaudited. Use at your own risk.

Packages

Package Description Version Docs
cpamm Constant product automated market maker. Crates.io Docs.rs
xyk Constant product AMM calculator used for Sencha. Crates.io Docs.rs
@senchahq/sencha-sdk TypeScript SDK for Sencha npm Docs

Addresses

Program addresses are the same on devnet, testnet, and mainnet-beta.

Developing

# Setup
yarn install
yarn idl:generate
anchor build

# Testing
yarn test:e2e

# Building SDK
yarn build

Contribution

Thank you for your interest in contributing to Sencha Protocol! All contributions are welcome no matter how big or small. This includes (but is not limited to) filing issues, adding documentation, fixing bugs, creating examples, and implementing features.

When contributing, please make sure your code adheres to some basic coding guidelines:

  • Code must be formatted with the configured formatters (e.g. rustfmt and prettier).
  • Comment lines should be no longer than 80 characters and written with proper grammar and punctuation.
  • Commit messages should be prefixed with the package(s) they modify. Changes affecting multiple packages should list all packages. In rare cases, changes may omit the package name prefix.

License

Sencha Protocol is licensed under the AGPL-3.0 license.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Sencha Protocol by you, as defined in the AGPL-3.0 license, shall be licensed as above, without any additional terms or conditions.

sencha's People

Contributors

andrewtian avatar dependabot[bot] avatar jjmatcha avatar leofisg avatar vineam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sencha's Issues

Build fails

Trying to run the commands in the readme. Fails at the anchor build step.

soldev@glide:~/senchadexupstream/sencha$ anchor build
BPF SDK: /home/soldev/.local/share/solana/install/releases/1.8.0/solana-release/bin/sdk/bpf
Running: rustup toolchain list -v
Running: rustup toolchain uninstall bpf
info: uninstalling toolchain 'bpf'
info: toolchain 'bpf' uninstalled
Running: rustup toolchain link bpf /home/soldev/.local/share/solana/install/releases/1.8.0/solana-release/bin/sdk/bpf/dependencies/bpf-tools/rust
Running: cargo +bpf build --target bpfel-unknown-unknown --release
    Updating crates.io index
error: failed to download `solana-frozen-abi v1.9.2`

Caused by:
  unable to get packages from source

Caused by:
  failed to parse manifest at `/home/soldev/.cargo/registry/src/github.com-1ecc6299db9ec823/solana-frozen-abi-1.9.2/Cargo.toml`

Caused by:
  feature `edition2021` is required

  consider adding `cargo-features = ["edition2021"]` to the manifest

Swap not working with prior TokenApprove instruction

Program throws > Program log: Key mismatch: output.user.owner must be user.user_authority if a delegated token account is defined as input owner and that delegated token account itself is not the owner of the output token account (typical scenario for swaps. Temporary delegated token account -> Used as input for Swap -> Output goes to original owner).

0.9.4 / 0.9.6 build fails

30 \| #[program]
--
911 | \| ^^^^^^^^^^ method not found in `account_structs::NewSwap<'_>`
912 | \|
913 | ::: /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/cpamm-0.9.6/src/account_structs.rs:36:1
914 | \|
915 | 36 \| pub struct NewSwap<'info> {
916 | \| ------------------------- method `exit` not found for this
917 | \|
918 | = help: items from traits can only be used if the trait is implemented and in scope
919 | = note: the following trait defines an item `exit`, perhaps you need to implement it:
920 | candidate #1: `anchor_lang::AccountsExit`
921 | = note: this error originates in the attribute macro `program` (in Nightly builds, run with -Z macro-backtrace for more info)
922 | ย 
923 | error[E0599]: no function or associated item named `try_accounts` found for struct `account_structs::NewSwapMeta` in the current scope
924 | --> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/cpamm-0.9.6/src/lib.rs:30:1
925 | \|

Edit: getting similar errors for cpamm-0.9.4

cpamms's Cargo.toml

I guess it's due to and anchor-lang v0.20.1 being used in my build

anchor-lang = ">=0.17.0"
anchor-spl = ">=0.17.0" 

Can't get IDL

yarn install
yarn idl:generate

โžค YN0000: โ”” Completed in 4s 397ms
โžค YN0000: Done with warnings in 59s 962ms
Parsing IDL for cpamm
thread 'main' panicked at 'Could not resolve Accounts symbol', lang/syn/src/idl/file.rs:450:22
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Could not parse IDL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.