Monetization Guide
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 theFeeCollect
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
-
Become a Partner - reach out to us to discuss your needs - Partnership
-
Set up your integration with the
ProjectId
to ensure the fees are collected to the correct account:
- How to add Project Identifier to a Widget Integration
- How to add Project Identifier to an SDK Integration
- How to add Project Identifier to an API Integration
- Contact Swing team to set up Partner Fees. Provide the following information:
ProjectId
- Partner fee percentage (0% - 10%)
- Wallet address
Note: Once registered, you cannot change your wallet address. We recommend registering and collecting fees with a multi-sig wallet or hardware wallet to improve the safety of your funds.
Once the Contract is set up and your integration passes the ProjectId
, Swing will start collecting Partner Fee from your integration’s transaction volume.
Check Fee Percentage
You can query Fee Configuration Contracts (see addresses below) to check the fee percentage setup for your provided wallet address.
- Go to the contract address
- Go to Contract > Read Contract
- In
getPartnerShare
, input your registered wallet address in thepartnerAddress
field - 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
):
Get Collected Fees Balance
The fees are collected on every chain and for every token individually. You can query our Fee Collect contracts to get collected token balances for your registered wallet address:
- Select a contract you want to query (see a list of all FeeCollector contracts below)
- Go to Contract > Read Contract
- In
getTokenBalance
, input your registered wallet address and the token addresses you want to get balances for.
Note: collected fees balance UI is coming to the Swing Platform soon.
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:
- Select a contract you want to withdraw from (see a list of all FeeCollector contracts below)
- Go to Contract > Write Contract
- Connect with your registered wallet
- In
withdrawPartnerFees
, inputtokenAddresses
you want to withdraw along with the registered wallet address as a receiver address.
Note: withdrawal UI is coming to the Swing Platform soon.
Fee Collect Contract Addresses (v2)
- Ethereum: 0x28b9089b5f2724c1898e7dbb04a96c8c177fe46d
- Binance Smart Chain: 0xdB01e95b391D7491ecb9Fe9BaE13ade37e6C9C14
- Polygon: 0x1fbA0c2a76243dB5e39e766525bF1524A5D11A33
- Arbitrum: 0x329c8D34c09090B64deDC6aA348a1612378eEa82
- Avalanche: 0xBF5F0867fF2038D4cA15C0c72308e12D74e518AA
- Optimism: 0x87A77781EE90fb5083481f1deB59B0d0E6b40AD0
- Fantom: 0xE37e0bc0c5d01d79eeABf1b386D7A431Ee6cbfcA
- Moonbeam: 0x5e8AC2DC9f31Bbab954877C771935eb88aa47A2B
- zkSync Era: 0xa08B0dABe98F8DC7529642d403FD99506e17fE7e
- Linea: 0xAd2183C963AB7E5CA2771E0f9fB5faE0BCb68E87
- Base: 0xF8622C14Fed88811900E226217ffB07C167cc799
- Goerli: 0xb40F607897d65AD1C4F443a8407D834fF1396Dbd
Fee Configuration Contracts
- Ethereum: 0x90a021ae7C545F9CA4e83e7a6Dc51D460E40A995
- Binance Smart Chain: 0xbea41d3dF7c5e6b3176AeB1b62cF55a4d591485d
- Polygon: 0xdAf461DEd915785abb3FeB14aF4c798B24356222
- Arbitrum: 0x42df81c742CAe6F6D91E136b1AA5C7e14CB394FB
- Avalanche: 0x88A541E94391704Cb24Bf4289189f64e09eB9736
- Optimism: 0x866E04F66eA5FeDB778ca4B108B729EBe00dc7B6
- Fantom: 0x34e3dA127fAfe020465E36Fd79BF8baF6E0ee05d
- Moonbeam: 0xD073b9740D17850A804341d08ad657749fb178e0
- zkSync Era: 0xb40F607897d65AD1C4F443a8407D834fF1396Dbd
- Linea: 0x76bBA71424aaDAA4137FBc6C514c650DB7EC8244
- Base: 0xA39342ed140d01E06097f6d10d892C3AbF413D2f
- Goerli: 0x459b4f536db312bea471625325b7b4b0a705b9e3
Fee Collect Contract Addresses (v1 - deprecated)
- Ethereum: 0x7ACe1D4BB90d19826A88875BA0F60bd783beF312
- Binance Smart Chain: 0xC1f07654B7e1DED2AB92f9a47b95bcAFA8b06c40
- Polygon: 0x29836d3C83661f3D2fd35996d38ccA9A43DBf698
- Arbitrum: 0x5e8AC2DC9f31Bbab954877C771935eb88aa47A2B
- Avalanche: 0xC2142383A16C9b78eeb66D051CB87CE389697E35
- Optimism: 0x90880881Bbce94503c0fC974c9B3E1D8E3692fb9
- Fantom: 0x68212DD62ca7E3949268834A956b0b9665F7F93A