Making composability with the Zeta DEX a breeze, FuZe provides CPI interfaces and sample implementations for on-chain program integration.

Related tags

Cryptography fuze
Overview

Zeta FuZe 🧬

Discord Chat License

Zeta FuZe

FuZe is Zeta's cross-program integration ecosystem.

This repository contains the Zeta Cross Program Invocation (CPI) interface as well as a number of helpful examples and reference implementations on how to compose (fuse) with the Zeta DEX.

Networks

Key Value
Devnet Live
Mainnet Coming soon...

Cross Program Invocations

Instructions

The instructions currently supported are as follows:

  • initialize_margin_account - create and initialize a user's margin account
  • deposit - deposit USDC collateral into the margin account
  • withdraw - withdraw USDC collateral from the margin account
  • place_order - place an order of (price, size, side) on the relevant market
  • cancel_order - cancel a specified order

Accounts

The accounts and relevant data that is currently supported (non-exhaustive):

  • ZetaGroup - contains information relating to all derivatives market for an underlying
    • Underlying
    • Serum Market
    • Strike
    • Kind (Call, Put, Future)
    • Expiry
  • Greeks
    • Mark Price
    • Delta
    • Vega
    • IV
  • MarginAccount
    • Balance
    • Positions
  • Oracle
    • Price

Programs

zeta-cpi

Basic usage examples outlined in a dummy proxy program that simply calls the main zeta program instructions. Also includes account layouts and outlines how to read all relevant on-chain data from the Zeta program. This should give all the boilerplate needed to execute core program functionality both on the Rust program and Typescript client (via tests/zeta_cpi.ts).

examples/vault-put-sell (WIP)

Work in progress

Reference implementation for a put selling vault that uses the Zeta DEX under the hood.

Feature Requests

  • Zeta program interface
  • Core CPI instruction examples
  • Examples on how to read and deserialize Zeta account data
  • Typescript client examples
  • Proper tests (current tests don't really check and validate state)
  • Put selling vault sample
  • Multi-leg product vault e.g. straddles
Comments
  • Add seeds as an optional param for zeta_client

    Add seeds as an optional param for zeta_client

    • Adds seeds as an optional param for zeta_client functions, to allow cross-program invocations where a PDA is the authority.
    • Removed msg!("Margin account balance: {:?}", margin_account.balance); print statement which was causing a reference to packed field is unaligned error
    • Fix compilation error caused by cancel_all_market_orders not being defined in ZetaInterface
    opened by iurage 1
  • Change redeemable token exchange logic

    Change redeemable token exchange logic

    Deposit and withdraw exchanges rates should be inverses of one another. I.e need to change it such that deposits are not 1:1 (otherwise users are getting zTokens that are worth <$1 if the vault is at a loss).

    opened by 0xtristan 1
  • Put Selling Vault Example + Program Upgrade

    Put Selling Vault Example + Program Upgrade

    Put selling vault implementation. Also includes program and SDK upgrades for cpi_client program.

    At a high level works conceptually like so: https://www.notion.so/sierraresearch/Put-Selling-Vault-ce9f2cef68984776bc3e5290c6af7860

    enhancement 
    opened by 0xtristan 1
  • Add spread accounts

    Add spread accounts

    This PR adds spread accounts to Fuze and also fixes up some bits and pieces to make sure everything works as expected 😊 All 10 integration tests pass locally

    opened by filipzeta 0
  • Change zeta-cpi program id

    Change zeta-cpi program id

    Anchor performs a check on the program ownership when loading accounts defined in zeta_account.rs. This fixes an incorrect program ownership issue by defining the program_id on zeta-cpi matching the main program id on devnet and mainnet.

    opened by iurage 0
  • Add cancelAllMarketOrders

    Add cancelAllMarketOrders

    This PR adds a new instruction cancelAllMarketOrders() that will cancel all orders on a single market index in one go using Serum's cpi::prune(). The only other difference between cancelAllMarketOrders() and cancelOrder() is that here we don't provide a side + order ID.

    zeta-options PR: https://github.com/zetamarkets/zeta-options/pull/472 SDK PR: https://github.com/zetamarkets/sdk/pull/157

    opened by filipzeta 0
  • Long Vol Vault

    Long Vol Vault

    Long Vol Vault

    Bounty Description

    Build and deploy a vault which buys at-the-money straddles or out-of-the-money strangles options on Zeta with interest it has gained from farming in a borrow/lend protocol.

    Requirements

    Submissions will be reviewed on an on-going basis. Please include the following in your submission:

    • Github repo (the cleaner the better!)
    • Demo of the vault (where possible)

    Criteria

    We will look at:

    • Quality of the github repo
    • Implementation of the vault

    Deadline

    • All submissions will be reviewed by the Zeta team on an on-going basis.

    Resources

    opened by epsilonsized 3
  • Leveraged Put Selling Vault

    Leveraged Put Selling Vault

    Leveraged Put Selling Vault

    Bounty Description

    Use Zeta's unique undercollateralization to build and deploy a leveraged put selling vault which manages liquidation risk. Allows for higher yields and smart risk management.

    Requirements

    Submissions will be reviewed on an on-going basis. Please include the following in your submission:

    • Github repo (the cleaner the better!)
    • Demo of the vault (where possible)

    Criteria

    We will look at:

    • Quality of the github repo
    • Implementation of the vault

    Deadline

    • All submissions will be reviewed by the Zeta team on an on-going basis.
    opened by epsilonsized 1
  • Stop Loss + Stop Limit Orders

    Stop Loss + Stop Limit Orders

    Stop Loss + Stop Limit Orders

    Bounty Description

    Add a decentralized stop loss and stop limit program, allowing anybody to trustlessly trigger stop loss or stop limit orders once set by a user.

    Requirements

    Submissions will be reviewed on an on-going basis. Please include the following in your submission:

    • Github repo (the cleaner the better!)
    • Demo of the program running successfully (where possible)

    Criteria

    We will look at:

    • Quality of the github repo
    • Implementation of the program

    Deadline

    • All submissions will be reviewed by the Zeta team on an on-going basis.

    Resources

    opened by epsilonsized 0
  • Spread Trading Program

    Spread Trading Program

    Spread Trading Program

    Bounty Description

    Create atomic spread trading instructions on Zeta, which allow different spreads to be traded. These will initially look like multiple FOK orders across multiple legs on Zeta to simulate a taker fill.

    Requirements

    Submissions will be reviewed on an on-going basis. Please include the following in your submission:

    • Github repo (the cleaner the better!)
    • Demo of the program running successfully (where possible)

    Criteria

    We will look at:

    • Quality of the github repo
    • Implementation of the trading program

    Deadline

    • All submissions will be reviewed by the Zeta team on an on-going basis.

    Resources

    opened by epsilonsized 0
Owner
Zeta
Zeta
Sample lightning node command-line app built on top of Ldk Node (similar to ldk-sample).

ldk-node-sample Sample lightning node command-line app built on top of Ldk Node (similar to ldk-sample ). Installation git clone https://github.com/op

optout 3 Nov 21, 2023
LayerCake: An insured-in-transit cross-network composability protocol

LayerCake: An insured-in-transit cross-network composability protocol The key features of LayerCake are: Instant transfers as opposed to the delayed t

Flare Labs 5 Jul 27, 2023
multi-market crank for serum-dex

A performance and cost optimized serum-dex crank that allows combining multiple market cranking instructions into a single transaction, while concurrently generating the crank instructions allowing for increased throughput.

SolFarm 33 Nov 23, 2022
Making Token Exchange program with Solana(Rust), Web3, and Vue

Escrow program for Solana blockchain Tech stack Program (Smart Contract) Rust crates: solana-program, spl-token Solana CLI for test validator UI Types

Hoon Wee 3 May 10, 2022
The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime.

Solana Program Library The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime. These programs a

null 6 Jun 12, 2022
NFT mixing program on solana chain

Mixture_machine Core logic of composing NFT Compose of NFT As you invoke compose_nft function with 2 or more child NFTs, child NFTs are locked in to M

Jay Soh 7 Dec 12, 2022
Gum Program Library, a collection of on chain programs maintained by Gum

Gum, at its core, is a decentralized social media protocol on Solana. It unbundles traditional social media into Social Legos similar to how Defi unbu

Gum 4 Feb 22, 2023
Interfaces for Relations and SNARKs for these relations

SNARK and Relation Traits The arkworks ecosystem consists of Rust libraries for designing and working with zero knowledge succinct non-interactive arg

arkworks 648 Dec 26, 2022
NFT & Marketplace Contracts with royalties and fungible token support. Sample React app included.

NFT Market Reference Implementation A PoC backbone for NFT Marketplaces on NEAR Protocol. Reference Changelog Changelog Progress: basic purchase of NF

NEAR App Examples 156 Apr 28, 2022
Pure-Rust traits and utilities for constant-time cryptographic implementations.

subtle Pure-Rust traits and utilities for constant-time cryptographic implementations. It consists of a Choice type, and a collection of traits using

dalek cryptography 196 Dec 13, 2022
the official Rust and C implementations of the BLAKE3 cryptographic hash function

BLAKE3 is a cryptographic hash function that is: Much faster than MD5, SHA-1, SHA-2, SHA-3, and BLAKE2. Secure, unlike MD5 and SHA-1. And secure again

BLAKE3 team 3.7k Jan 6, 2023
Pure Rust implementations of the key-committing (and context-committing) AEADs

kc-aeads Pure Rust implementations of the key-committing (and context-committing) AEADs defined in Bellare and Hoang '22. Crash course on the paper: T

Michael Rosenberg 2 Aug 10, 2022
Cryptography-oriented big integer library with constant-time, stack-allocated (no_std-friendly) implementations of modern formulas

RustCrypto: Cryptographic Big Integers Pure Rust implementation of a big integer library which has been designed from the ground-up for use in cryptog

Rust Crypto 88 Dec 31, 2022
Elliptic-curves - Collection of pure Rust elliptic curve implementations (e.g. P-256, P-384, secp256k1)

RustCrypto: Elliptic Curves General purpose Elliptic Curve Cryptography (ECC) support, including types and traits for representing various elliptic cu

Rust Crypto 386 Dec 27, 2022
OpenZKP - pure Rust implementations of Zero-Knowledge Proof systems.

OpenZKP OpenZKP - pure Rust implementations of Zero-Knowledge Proof systems. Overview Project current implements ?? the Stark protocol (see its readme

0x 529 Jan 5, 2023
A bridge between different serde implementations.

serde-bridge   Bridge between serde types Quick Start use anyhow::Result; use serde_bridge::{from_value, into_value, FromValue, IntoValue, Value}; fn

Xuanwo 14 Nov 24, 2022
A Boring(SSL)-compatible API abstraction for Rust cryptographic implementations.

A Boring(SSL)-compatible API abstraction for Rust cryptographic implementations. What is Superboring? Superboring hides the complexity, diversity and

Frank Denis 7 Dec 29, 2023
A preview of the integration between Bitcoin and the Internet Computer.

Bitcoin Integration Developer Preview Overview The integration between the Internet Computer and Bitcoin will enable developers to build canisters tha

DFINITY 39 Sep 21, 2022