Coder Social home page Coder Social logo

crfmsr / jup.ag.referral.platform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from teamraccoons/referral

0.0 0.0 0.0 363 KB

The only crypto DERE (decentralized REFFERELS ) in the crypto space!

Home Page: https://referral.jup.ag/

JavaScript 1.59% Rust 8.45% TypeScript 89.30% CSS 0.66%

jup.ag.referral.platform's Introduction

Referral Program

This Referral program is what Jupiter uses to power our referral system across all Jupiter programs. Anyone can also use this Referral program.

Easy to Integrate

How does it work?

In the Jupiter Swap program, anyone can append a referral token account that matches the output mint and set a percentage to receive a swap fee. Part of the swap fee goes to Jupiter, and part of the swap fee goes to the referral.

The referral token account is created using the Referral program. Hence, not all token accounts can be used. On the Jupiter Swap program, it has a simple check on it:

#[account(
    mut,
    token::authority = project_public_key, // The `Project` account, PDA of ["project", base]
)]
referral_token_account: Account<'info, TokenAccount>

So, only the referral token account with the project authority can be used as the referral_token_account.

Protocol

For a protocol that wants to use this Referral program, you must create a Project by calling initialize_project with your chosen base key, admin, and project name. The base key is the key identifier of your project.

You can set a default_share_bps on the percentage you want to share with your referrer.

Referrer

For referrers who want to get referral fees for protocols that integrate with the Referral program, they will have to first create their own Referral account by calling initialize_referral_account with the correct project account, the referral_account, and their own partner account. The partner account is the admin of this referral account.

Then, for each token mint they wish to receive the referral fee from, they must call initialize_referral_token_account to create the token account. That token account will be the referral_token_account that they use above.

Dashboard

You can also check out the web dashboard here if you want to interact with the contract via browser: https://referral.jup.ag/.

jup.ag.referral.platform's People

Contributors

hjchan avatar siong1987 avatar arrowana avatar zhengyutay 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.