Rango Docs
API SwaggerWidget PlaygroundAppWebsite
  • 👋Welcome to Rango
  • 🏠Introduction
  • 💁How It Works
  • ✅Integrations
  • ⚖️Rango vs. Competitors
  • 🔐Security
  • 🛣️Roadmap
  • 🦎Tokenomics
  • 💰Airdrop
  • ❓FAQ
  • 🐞Bug Bounty
  • API Integration
    • 🔡Terminology
    • 🚄API Key & Rate Limits
    • 🤝Choosing the Right API
    • 🦄Basic API - Single Step
      • 🛝API Flow
      • ⚙️API Reference
        • Get Blockchains & Tokens
        • Get Quote
        • Create Transaction (Swap)
        • Check Transaction Status
        • Check Approve Transaction Status
        • Get Address Assets & Balances
        • Get Token Balance
        • Report Transaction Failure
        • Get Direct Tokens
        • Get Custom Token
        • Message Passing
      • 🎓Tutorial
        • 🍰SDK Example
      • 💰Monetization
      • 🎹Sample Transactions
      • ✅Integration Checklist
    • 🦎Main API - Multi Step
      • 🛝API Flow
      • ⚙️API Reference
        • Get Blockchains & Tokens
        • Get Best Route
        • Get All Possible Routes
        • Confirm Route
        • Create Transaction
        • Check Transaction Status
        • Check Approve Transaction Status
        • Report Transaction Failure
        • Get Custom Token
        • Get Address Token Balance
      • 🎓Tutorial
        • 🍰SDK Example
      • 💰Monetization
      • 🎹Sample Transactions
  • ℹ️API Troubleshooting
  • Technical Docs
    • 🍔Swap Aggregation
    • 💰Monetization
    • ⛽Fee Structure
    • ⛽Network Fees and Gas Estimates
    • ⌛Stuck Transactions
  • Widget Integration
    • 🧩Overview
    • 🎇Quick Start
    • ⚙️Customization
    • 💰Monetization
    • 🛣️React Router
    • 🎵Events
    • 💳External Wallets
  • Smart Contracts
    • 👩‍💼Architecture
    • 🔎Audit Reports
    • 🏗️Deployment Addresses
    • 📩Message Passing
  • Ask for Integration
    • 🙋‍♂️DEXs & DEX Aggregators
    • 📱Rango Mobile SDK
  • Useful Links
    • Twitter
    • Discord Server
    • TG Announcements
    • TG Group
  • Terms of Use
  • Privacy policy
Powered by GitBook
On this page
  • How Rango affiliate system works?
  • How to set affiliate parameters?

Was this helpful?

  1. API Integration
  2. Basic API - Single Step

Monetization

How to take fees from the users using Rango Basic API?

PreviousSDK ExampleNextSample Transactions

Last updated 9 months ago

Was this helpful?

How Rango affiliate system works?

How to set affiliate parameters?

  • The Single-step API provides two endpoints for getting a quote and creating transactions, and endpoints.

  • In the quote endpoint, you should include the referrerFee field, which represents the fee amount you want to charge the user as a percentage (1.12 means 1.12 percent). Note that the maximum amount fee you could charge the user is 3 percent. It is required to calculated quote fee correctly for the user. The default fee is 10 bps or 0.1 percent.

  • In the swap endpoint, you should pass both referrerAddress and referrerFee fields. The referrerFee is the same as the field in quote endpoint, and the referrerAddress is the wallet address which you wish to receive your collected fees. For the referrerAddress, you can use EVM, Starknet, or Osmosis wallet addresses depending on the route. While we also support fee charging on the Solana blockchain, this feature is not yet available for all dApps due to its complexity and is not ready for public use.

Here is a sample code for setting affiliate fee parameters in method:

const quote = await rango.quote({
    from: {"blockchain": "BSC", "symbol": "BNB", "address": null},
    to: {"blockchain": "AVAX_CCHAIN", "symbol": "USDT.E", "address": "0xc7198437980c041c805a1edcba50c1ce5db95118"},
    amount: "100000000000000000", // 0.1 BSC.BNB
    slippage: "1.0",
    referrerFee: "0.1" // charge users 0.1% fee for the input token 
})
curl --request GET \
     --url 'https://api.rango.exchange/basic/quote?from=BSC.BNB&to=AVAX_CCHAIN.USDT.E--0xc7198437980c041c805a1edcba50c1ce5db95118&amount=100000000000000000&slippage=3&referrerFee=0.1&apiKey=c6381a79-2817-4602-83bf-6a641a409e32'  

Here is a sample code for setting affiliate fee parameters in method:

const swap = await rango.swap({
    from: {"blockchain": "BSC", "symbol": "BNB", "address": null},
    to: {"blockchain": "AVAX_CCHAIN", "symbol": "USDT.E", "address": "0xc7198437980c041c805a1edcba50c1ce5db95118"},
    amount: "100000000000000000" // 0.1 BSC.BNB
    slippage: "1.0",
    fromAddress: "0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
    toAddress: "0xeb2629a2734e272bcc07bda959863f316f4bd4cf",
    disableEstimate: true,
    referrerFee: "0.1",
    referredAddress: "0x7g44bb1763eebead07cf8815a62fcd7b30311fb1"
})
curl --request GET \
     --url 'https://api.rango.exchange/basic/swap?from=BSC.BNB&to=AVAX_CCHAIN.USDT.E--0xc7198437980c041c805a1edcba50c1ce5db95118&amount=100000000000000000&slippage=3&fromAddress=0x9F8cCdaFCc39F3c7D6EBf637c9151673CBc36b88&toAddress=0x9F8cCdaFCc39F3c7D6EBf637c9151673CBc36b88&referrerFee=0.1&referrerAddress=0x7g44bb1763eebead07cf8815a62fcd7b30311fb1&apiKey=c6381a79-2817-4602-83bf-6a641a409e32' 
🦄
💰
💰Monetization
quote
swap
quote
swap