Coder Social home page Coder Social logo

drifting_bird's Introduction

Disclaimer

Important:

This software is provided for testing and educational purposes only. Utilizing this software as provided may result in financial loss. The creator(s) of this software bear no responsibility for any financial or other damages incurred.

This repo also only included Rust smart contract code and doesn't come with client, operators may need to chew some glass.

This also needed to be replace for the program's onchain address: Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS

Introduction

In light of the growing interest in Ethena, I've decided to open-source a trading bot I developed in the third quarter of 2023. This bot is designed to utilize price differences and funding differences in different markets, specifically through a strategy involving SOL-PERP and SOL-SPOT transactions across two platforms: Drift and Phoenix.

Strategy Overview

The bot operates on two main principles:

  1. Long Position Arbitrage: It sells PERP contracts on Drift and buys SPOT on Phoenix when the opposite price discrepancy occurs, ensuring profitability after fees. This transaction is only executed under the condition that the trade remains profitable after accounting for all applicable fees. Furthermore, this strategy is activated only during positive funding periods, which means you are compensated for maintaining a SHORT PERP position on Drift.

  2. Short Position Arbitrage: It buys PERP contracts on Drift and sells SPOT on Phoenix whenever the price of PERP on Drift is lower than the SPOT price on Phoenix. This transaction is only executed under the condition that the trade remains profitable after accounting for all applicable fees. Furthermore, this strategy is activated only during negative funding periods, which means you are compensated for maintaining a LONG PERP position on Drift.

Requirements for Effective Operation

  • Fee Tier: Operator should qualify for the best fee tier on Drift, which involves depositing into the Drift insurance fund.
  • Price Differences and Funding: To enhance the likelihood of order fulfillment, operator should be willing to accept minor price differences to enter positions that attract funding payments. (Initial negative position PNL).

Version Compatibility

This bot was designed based on specific versions of the Drift and Phoenix platforms available in Q3 2023. Given the rapid evolution of these platforms, the bot may require updates to remain functional. Operator are advised to upgrade the software versions of Drift and Phoenix to their latest to ensure compatibility.

This bot should be able to be build with Anchor 0.26.0, Solana 1.17.0.

Lastly, if you are slabbing on a stable coin to make an Ethena-like project, my only ask is include me in the angel round.

drifting_bird's People

Contributors

chenwainuo avatar

Stargazers

 avatar

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.