Convert Figma logo to code with AI

scrtlabs logocatalyst

An Algorithmic Trading Library for Crypto-Assets in Python

2,484
723
2,484
136

Top Related Projects

Framework for building smart contracts in Wasm for the Cosmos SDK

Substrate: The platform for blockchain innovators

:chains: A Framework for Building High Value Public Blockchains :sparkles:

The current, performant & industrial strength version of Holochain on Rust.

Quick Overview

Catalyst is a framework for building decentralized applications (dApps) on the Secret Network blockchain. It provides a set of tools and libraries to simplify the development process, allowing developers to create privacy-preserving smart contracts and interact with the Secret Network ecosystem more easily.

Pros

  • Simplifies development of privacy-preserving dApps on Secret Network
  • Provides a comprehensive set of tools and libraries for smart contract development
  • Supports multiple programming languages, including Rust and CosmWasm
  • Offers enhanced security features through encryption and privacy-preserving computations

Cons

  • Limited documentation and learning resources compared to more established blockchain development frameworks
  • Relatively small community and ecosystem compared to other blockchain platforms
  • Steep learning curve for developers new to privacy-preserving smart contracts
  • Potential performance limitations due to the overhead of encryption and privacy features

Code Examples

  1. Creating a simple Secret Contract:
use cosmwasm_std::{entry_point, DepsMut, Env, MessageInfo, Response};
use secret_toolkit::crypto::Prng;

#[entry_point]
pub fn instantiate(
    deps: DepsMut,
    env: Env,
    info: MessageInfo,
    msg: InstantiateMsg,
) -> StdResult<Response> {
    // Contract initialization logic
    Ok(Response::default())
}
  1. Querying contract state:
use cosmwasm_std::{Deps, Env, StdResult};

#[entry_point]
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
    match msg {
        QueryMsg::GetValue {} => to_binary(&query_value(deps)?),
        // Other query handlers
    }
}
  1. Executing a contract function:
use cosmwasm_std::{DepsMut, Env, MessageInfo, Response};

#[entry_point]
pub fn execute(
    deps: DepsMut,
    env: Env,
    info: MessageInfo,
    msg: ExecuteMsg,
) -> Result<Response, ContractError> {
    match msg {
        ExecuteMsg::SetValue { value } => execute_set_value(deps, info, value),
        // Other execute handlers
    }
}

Getting Started

To start developing with Catalyst:

  1. Install Rust and cargo-generate:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    cargo install cargo-generate
    
  2. Create a new Secret Contract project:

    cargo generate --git https://github.com/scrtlabs/secret-template.git --name my-secret-contract
    cd my-secret-contract
    
  3. Build and test your contract:

    cargo build
    cargo test
    
  4. Deploy your contract to a local Secret Network node or testnet using the Secret Network CLI or SecretCLI.

Competitor Comparisons

Framework for building smart contracts in Wasm for the Cosmos SDK

Pros of cosmwasm

  • More mature and widely adopted in the Cosmos ecosystem
  • Supports multiple programming languages (Rust, Go, AssemblyScript)
  • Extensive documentation and community support

Cons of cosmwasm

  • Steeper learning curve for developers new to Cosmos
  • Limited to Cosmos-based blockchains

Code Comparison

cosmwasm:

#[entry_point]
pub fn instantiate(
    deps: DepsMut,
    _env: Env,
    info: MessageInfo,
    msg: InstantiateMsg,
) -> Result<Response, ContractError> {
    // Contract initialization logic
}

catalyst:

#[no_mangle]
pub extern "C" fn init(env: Env, msg: InitMsg) -> Result<InitResponse, ContractError> {
    // Contract initialization logic
}

Key Differences

  • cosmwasm uses the #[entry_point] macro, while catalyst uses #[no_mangle]
  • cosmwasm's instantiate function has more parameters compared to catalyst's init
  • cosmwasm returns a Response, while catalyst returns an InitResponse

Both projects aim to provide smart contract development frameworks, but cosmwasm is more established within the Cosmos ecosystem. catalyst, being newer, may offer more flexibility for Secret Network-specific features but has a smaller community and less documentation.

Substrate: The platform for blockchain innovators

Pros of Substrate

  • More extensive documentation and community support
  • Highly modular and customizable framework
  • Supports multiple consensus mechanisms out-of-the-box

Cons of Substrate

  • Steeper learning curve due to complexity
  • Requires more resources to run and maintain
  • Rust-centric, which may limit accessibility for some developers

Code Comparison

Substrate example (runtime configuration):

#[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default)]
pub struct Runtime;

impl_opaque_keys! {
    pub struct SessionKeys {
        pub grandpa: Grandpa,
        pub babe: Babe,
    }
}

impl system::Config for Runtime {
    // ... configuration details
}

Catalyst example (contract implementation):

#[contract]
pub mod contract {
    use cosmwasm_std::{entry_point, DepsMut, Env, MessageInfo, Response};

    #[entry_point]
    pub fn instantiate(
        deps: DepsMut,
        _env: Env,
        _info: MessageInfo,
        _msg: InstantiateMsg,
    ) -> StdResult<Response> {
        // ... contract initialization
    }
}

Both repositories focus on blockchain development, but Substrate offers a more comprehensive framework for building entire blockchain networks, while Catalyst is tailored for smart contract development on the Secret Network. Substrate provides greater flexibility and scalability, but at the cost of increased complexity. Catalyst offers a more straightforward approach for developers familiar with CosmWasm, but with a narrower scope limited to the Secret Network ecosystem.

:chains: A Framework for Building High Value Public Blockchains :sparkles:

Pros of Cosmos SDK

  • More extensive documentation and community support
  • Broader ecosystem with numerous projects and integrations
  • Well-established framework for building blockchain applications

Cons of Cosmos SDK

  • Steeper learning curve for developers new to blockchain
  • More complex architecture, potentially overkill for simpler projects
  • Slower development cycle due to its size and scope

Code Comparison

Cosmos SDK (Go):

func (app *SimApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
    var genesisState GenesisState
    if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
        panic(err)
    }
    return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
}

Catalyst (Rust):

pub fn init_chain(
    &mut self,
    req: RequestInitChain,
) -> ResponseInitChain {
    let state: GenesisState = serde_json::from_slice(&req.app_state_bytes).unwrap();
    self.app.init_genesis(&state);
    Default::default()
}

Both examples show chain initialization, but Cosmos SDK uses Go and has more complex error handling, while Catalyst uses Rust with a more concise syntax.

The current, performant & industrial strength version of Holochain on Rust.

Pros of Holochain

  • More active development with frequent updates and contributions
  • Larger community and ecosystem, providing better support and resources
  • Focuses on distributed computing, offering a unique approach to decentralized applications

Cons of Holochain

  • Steeper learning curve due to its novel architecture and concepts
  • Less emphasis on privacy and encryption compared to Catalyst
  • May require more resources to run and maintain nodes

Code Comparison

Holochain (Rust):

#[hdk_extern]
pub fn create_entry(entry: EntryTypes) -> ExternResult<HeaderHash> {
    create_entry(&entry)?;
    let hash = hash_entry(&entry)?;
    Ok(hash)
}

Catalyst (JavaScript):

const createEntry = async (entry) => {
  const hash = await catalyst.createEntry(entry);
  return hash;
}

Both examples show creating an entry, but Holochain uses Rust with more explicit type handling, while Catalyst uses JavaScript with a simpler API. Holochain's approach offers stronger type safety but may be more complex for beginners.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

.. image:: https://s3.amazonaws.com/enigmaco-docs/catalyst-crypto.png :target: https://enigmampc.github.io/catalyst :align: center :alt: Enigma | Catalyst

|version tag| |version status| |forum| |discord| |twitter|

========= =============== ================ Service Master Develop


CI Badge |travis-master| |travis-develop| ========= =============== ================

⚠️ DEPRECATION WARNING ⚠️

This repo is no longer actively maintained since the end of 2018. If you wish to use this project or get support for it, there are many forks that may be more active. If any of those is still active, please get in touch with them, as we can no longer provide support for it.


Catalyst is an algorithmic trading library for crypto-assets written in Python. It allows trading strategies to be easily expressed and backtested against historical data (with daily and minute resolution), providing analytics and insights regarding a particular strategy's performance. Catalyst also supports live-trading of crypto-assets starting with four exchanges (Binance, Bitfinex, Bittrex, and Poloniex) with more being added over time. Catalyst empowers users to share and curate data and build profitable, data-driven investment strategies. Please visit catalystcrypto.io <https://www.catalystcrypto.io>_ to learn more about Catalyst.

Catalyst builds on top of the well-established Zipline <https://github.com/quantopian/zipline>_ project. We did our best to minimize structural changes to the general API to maximize compatibility with existing trading algorithms, developer knowledge, and tutorials. Join us on the Catalyst Forum <https://forum.catalystcrypto.io/>_ for questions around Catalyst, algorithmic trading and technical support. We also have a Discord <https://discord.gg/SJK32GY>_ group with the #catalyst_dev and #catalyst_setup dedicated channels.

Overview

  • Ease of use: Catalyst tries to get out of your way so that you can focus on algorithm development. See examples of trading strategies <https://github.com/enigmampc/catalyst/tree/master/catalyst/examples>_ provided.
  • Support for several of the top crypto-exchanges by trading volume: Bitfinex <https://www.bitfinex.com>, Bittrex <http://www.bittrex.com>, Poloniex <https://www.poloniex.com>_ and Binance <https://www.binance.com/>_.
  • Secure: You and only you have access to each exchange API keys for your accounts.
  • Input of historical pricing data of all crypto-assets by exchange, with daily and minute resolution. See Catalyst Market Coverage Overview <https://www.enigma.co/catalyst/status>_.
  • Backtesting and live-trading functionality, with a seamless transition between the two modes.
  • Output of performance statistics are based on Pandas DataFrames to integrate nicely into the existing PyData eco-system.
  • Statistic and machine learning libraries like matplotlib, scipy, statsmodels, and sklearn support development, analysis, and visualization of state-of-the-art trading systems.
  • Addition of Bitcoin price (btc_usdt) as a benchmark for comparing performance across trading algorithms.

Go to our Documentation Website <https://enigmampc.github.io/catalyst/>_.

.. |version tag| image:: https://img.shields.io/pypi/v/enigma-catalyst.svg :target: https://pypi.python.org/pypi/enigma-catalyst

.. |version status| image:: https://img.shields.io/pypi/pyversions/enigma-catalyst.svg :target: https://pypi.python.org/pypi/enigma-catalyst

.. |forum| image:: https://img.shields.io/badge/forum-join-green.svg :target: https://forum.catalystcrypto.io/

.. |discord| image:: https://img.shields.io/badge/discord-join%20chat-green.svg :target: https://discordapp.com/invite/SJK32GY

.. |twitter| image:: https://img.shields.io/twitter/follow/enigmampc.svg?style=social&label=Follow&style=flat-square :target: https://twitter.com/catalystcrypto

.. |travis-develop| image:: https://travis-ci.com/enigmampc/catalyst.svg?branch=develop :target: https://travis-ci.com/enigmampc/catalyst

.. |travis-master| image:: https://travis-ci.com/enigmampc/catalyst.svg?branch=master :target: https://travis-ci.com/enigmampc/catalyst