Getting Monetized on Swing

Monetize your Swing integration and collect fees from your transaction volume.

Our Fee Collector contract was audited on 31 May 2023, by Peckshield Audit. view audit report

How it works

All Swing partners can set up monetization to collect fees up to 10% of the transaction volume. Swing will take 15% of those collected fees towards Swing treasury as a revenue-shared model. If the integrator does not charge any fees, Swing doesn't collect any additional fees (bridge and gas fees still apply).

Partner Fees percentage will be deducted from the user's initial asset and collected in the FeeCollect sub-contract on the source chain inside Swing Contracts. You can then withdraw the funds from the wallet specified by you during our integration.

For example:

Protocol X has set up fee collection for their project, charging users a 1% fee. A user sends 100 USDC from Ethereum to Arbitrum

  • partner fee of 1 USDC is deducted from the sending token amount and collected in the FeeCollect contract on Ethereum.
  • 0.85 USDC is allocated to Protocol X's registered wallet
  • 0.15 USDC is allocation to Swing's wallet

See a list of monetization-supported bridges and liquididty providers

How to set up Partner Fees

FieldDescription
ProjectIdYour project's projectId
Partner fee percentage (0% - 10%)Fee percentage you want on every transaction
ChainsThe chains you want monetization enabled on
Wallet address(es)The wallet address(s) that your collected fees will be withdrawn to

We recommend registering and collecting fees with a multi-sig wallet or hardware wallet to improve the safety of your funds. Using a multi-sig wallet offers the same flexibility as using a regular EOA wallet but with greater security. Regardless of the wallet type you're using, Swing lets you:

  • Update fee sharing percentages at any time.
  • Set up different wallet addresses on different chains (multi-sig wallets now supported).
  • Update fee collection wallet addresses at any time.

The wallet address(es) you submit to Swing for your fee collection will be set up inside our FeeCollector Contract, which handles the collection of fees for all our partners.

It's important to note that if you decide to change or disable your current fee collection wallet address, the tokens collected by our FeeCollector Smart Contract for that wallet address will still be disbursed to that same address. So make sure that you always have access to your previous fee collection wallet address even after changing it.

Once the Contract is set up and your integration passes the ProjectId, Swing will start collecting Partner Fee from your integration’s transaction volume.

Squid Router Monetization

Unlike other monetizatable bridges on Swing, the squid bridge is monetized using a different method laid out by the Squid team.

Example:

  • Protocol X has set up fee collection for their project, charging users a 1% fee.
  • For every transaction that goes through Squid, Squid collects a 1% fee.
  • Fee Breakdown: Squid takes a 50% cut and the remaining 50% goes to the integrating Partner. In this case, Swing doesn't take any fees as the fee sharing setup is between Squid and the integrating Partner's wallet address.
  • Fees are collected in the bridge token. Most of the time, this will be axlUSDC as this is the primary bridging token on Squid.

Check Fee Percentage

You can query Fee Configuration Contracts (see addresses below) to check the fee percentage setup for your provided wallet address.

  1. Go to the contract address
  2. Go to Contract > Read Contract
  3. In getPartnerShare, input your registered wallet address in the partnerAddress field
  4. The returned number is in bps. Value / 10000. For example 150 = 1.5%

Check partner fees in the quote response

You can query our /quote endpoint to get the calculated partner fees based on the configured percentage. The routes.fees property will return partner fees details ("type": "partner):

{
  "fees": [
    {
      "type": "partner",
      "amount": "2500000000000000",
      "amountUSD": "0.585",
      "chainSlug": "bsc",
      "tokenSymbol": "BNB",
      "tokenAddress": "0x0000000000000000000000000000000000000000",
      "decimals": 18,
      "deductedFromSourceToken": true
    }
  ]
}

Get Collected Fees Balance

Your project's fees are collected on every chain and for every token individually.

You can track your collected fees from the Fees section of your Platform Dashboard

Project Dashboard

Withdraw Fees

You can withdraw all tokens from a chain or a specific token from a chain. Currently, withdrawal needs to be executed on-chain manually:

  1. Select a contract you want to withdraw from (see a list of all FeeCollector contracts below)
  2. Go to Contract > Write Contract
  3. Connect with your registered wallet
  4. In withdrawPartnerFees, input tokenAddresses you want to withdraw along with the registered wallet address as a receiver address.

Note: withdrawal UI is coming to the Swing Platform soon.

Setting Up Custom Fees

By default, all transactions originating from Swing Partners are unmonetized until requested by the respective Swing Partner.

Swing gives Partners the ability to manually override the default Partner fee percentage share that was set up by Swing on the Partner's behalf. This means that you can manually set different transaction fees for every transaction originating from your dApp.

All Swing partners can set up monetization to collect fees up to 10% of the transaction volume. Swing will take 15% of those collected fees towards Swing treasury as a revenue-shared model.

How it works

If you have a fee-sharing setup with Swing, the allocated share of a user's transaction amount will be returned in the response of the /quote endpoint or the result of the getQuote() function in the SDK. Refer to Check partner fees in the quote response in our monetization guide.

{
  "fees": [
    {
      "type": "partner",
      "amount": "2500000000000000",
      "amountUSD": "0.585",
      "chainSlug": "bsc",
      "tokenSymbol": "BNB",
      "tokenAddress": "0x0000000000000000000000000000000000000000",
      "decimals": 18,
      "deductedFromSourceToken": true
    }
  ]
}

Custom fees are applied by modifying the fee parameter present in the /send API endpoint and the transfer() function in the SDK.

Swing Partner fees are calculated in Basis Points (BPS) units. Every BPS unit represents a fraction of a percent. Specifically, 1 BPS is equivalent to 1/100th of a percent (0.01%).

This means that setting a custom fee of 1 BPS will result in Swing collecting a Partner fee of 0.01% on the transaction amount entered by a user. Similarly, setting a custom fee of 1000 BPS will result in Swing taking maximum fee allowed by a Partner, which is 10% on the user's transaction amount.

Here's a breakdown of how a Partner's fee will be impacted with respect to BSP:

Transaction Amount ($)BPSPercentagePartner Fee ($)
10,00010.01%$1.00
10,000100.10%$10.00
10,000500.50%$50.00
10,0001001.00%$100.00
10,0002002.00%$200.00
10,0005005.00%$500.00
10,000100010.00%$1,000.00

The maximum allowed Basis Points (BPS) is 1000, which equates to a 10% Partner fee. Conversely, the minimum value is 1 BPS, corresponding to a 0.01% Partner's fee.

This feature is most suitable for teams running loyalty programs to create benefits for returning customers.

Modifying Transaction Fees

Modifying transaction fees is only available on our API and SDK integrations.

If you have fees collection set up with Swing, you can override the default fees setup by setting the fee parameter to a BPS value in the /send endpoint on the API and the transfer() function in the SDK respectively:

const swing = new SwingSDK({
  projectId: 'replug',
  environment: 'production',
  debug: true,
});
 
await swing.init();
 
const transferParams = {
  amount: '1',
  fromChain: 'polygon',
  fromToken: 'MATIC',
  toChain: 'polygon',
  toToken: 'USDC',
  fromUserAddress: '0x018c15DA1239B84b08283799B89045CD476BBbBb',
  toUserAddress: '0x018c15DA1239B84b08283799B89045CD476BBbBb',
 
  //set the fee to your desired BPS value
  fee: '200',
};
 
const quotes = await swing.getQuote(transferParams);
 
await swing.transfer(quotes[0], transferParams);

Here in our transferParams object, we're setting the fee property to a BPS value of 200. What this means is that if our transaction amount is $10,000, a BPS value of 200 would mean that we're instructing Swing to collect a Partner fee of $200 from the user.

Fee Collection Contract Addresses

Here's a list of fee collector smart contracts that are built by Swing.

Fee Collect Contract Addresses (v2)

NetworkAddressExplorer Link
Ethereum0x28b9089b5f2724c1898e7dbb04a96c8c177fe46dEtherscan
Binance Smart Chain0xdB01e95b391D7491ecb9Fe9BaE13ade37e6C9C14BscScan
Polygon0x1fbA0c2a76243dB5e39e766525bF1524A5D11A33PolygonScan
Arbitrum0x329c8D34c09090B64deDC6aA348a1612378eEa82Arbiscan
Avalanche0xBF5F0867fF2038D4cA15C0c72308e12D74e518AAAvascan
Optimism0x87A77781EE90fb5083481f1deB59B0d0E6b40AD0Optimistic Etherscan
Fantom0xE37e0bc0c5d01d79eeABf1b386D7A431Ee6cbfcAFTMScan
Moonbeam0x5e8AC2DC9f31Bbab954877C771935eb88aa47A2BMoonscan
zkSync Era0xa08B0dABe98F8DC7529642d403FD99506e17fE7ezkSync Explorer
Linea0xAd2183C963AB7E5CA2771E0f9fB5faE0BCb68E87Lineascan
Base0xF8622C14Fed88811900E226217ffB07C167cc799Basescan
Goerli0xb40F607897d65AD1C4F443a8407D834fF1396DbdGoerli Etherscan

Fee Configuration Contracts

NetworkAddressExplorer Link
Ethereum0x90a021ae7C545F9CA4e83e7a6Dc51D460E40A995Etherscan
Binance Smart Chain0xbea41d3dF7c5e6b3176AeB1b62cF55a4d591485dBscScan
Polygon0xdAf461DEd915785abb3FeB14aF4c798B24356222PolygonScan
Arbitrum0x42df81c742CAe6F6D91E136b1AA5C7e14CB394FBArbiscan
Avalanche0x88A541E94391704Cb24Bf4289189f64e09eB9736Avascan
Optimism0x866E04F66eA5FeDB778ca4B108B729EBe00dc7B6Optimistic Etherscan
Fantom0x34e3dA127fAfe020465E36Fd79BF8baF6E0ee05dFTMScan
Moonbeam0xD073b9740D17850A804341d08ad657749fb178e0Moonscan
zkSync Era0xb40F607897d65AD1C4F443a8407D834fF1396DbdzkSync Explorer
Linea0x76bBA71424aaDAA4137FBc6C514c650DB7EC8244Lineascan
Base0xA39342ed140d01E06097f6d10d892C3AbF413D2fBasescan
Goerli0x459b4f536db312bea471625325b7b4b0a705b9e3Goerli Etherscan

Fee Collect Contract Addresses (v1 - deprecated)

NetworkAddressExplorer Link
Ethereum0x7ACe1D4BB90d19826A88875BA0F60bd783beF312Etherscan
Binance Smart Chain0xC1f07654B7e1DED2AB92f9a47b95bcAFA8b06c40BscScan
Polygon0x29836d3C83661f3D2fd35996d38ccA9A43DBf698PolygonScan
Arbitrum0x5e8AC2DC9f31Bbab954877C771935eb88aa47A2BArbiscan
Avalanche0xC2142383A16C9b78eeb66D051CB87CE389697E35Avascan
Optimism0x90880881Bbce94503c0fC974c9B3E1D8E3692fb9Optimistic Etherscan
Fantom0x68212DD62ca7E3949268834A956b0b9665F7F93AFTMScan

Squid Fee Collector Contract Address

Below are fee collector smart contracts built by Squid for Partner fee collection.

Contract NameAddress
SquidFeeCollectorProxy0x19cd4f3820e7bbed45762a30bfa37dfc6c9c145b

You can learn more about monetization on the Squid bridge here.