Skip to content

Earn with Glide

Get paid for building dapps on other protocols

If you're building dapps that faciliate transactions on protocols not owned by you, you can configure Glide to pay you a commission for each transaction. Using this approach, you can get paid for building amazing dapps on other protocols.

Setup

Before you start, make sure you have a working integration with Glide without commission. If you haven't done that yet, follow the Pay with Glide guide.

Steps

1. Provide commission payout address

During the Glide sign up process, you can provide a commission payout address where you would like to receive the commission.

Reach out to [email protected] to provide the commission payout address.

2. Add commission Glide transaction

Many Glide methods support a commissionUSD field that can be used to specify the commission amount in USD.

For example, you can add a commission to the payWithGlide method like this:

import { payWithGlide, chains } from "@paywithglide/glide-js";
import { config } from "./config";
 
const transactionHash = await payWithGlide(config, {
  chainId: chains.base.id,
  account: "0xc6FfEB1298Eb33Da430d14e5Eb789256ec344625",
 
  abi: fabricABI,
  address: "0x1169c6769c4F4B3cA1944AF0F26B36582fd5279d",
  functionName: "mintFor",
  args: ["0xc6FfEB1298Eb33Da430d14e5Eb789256ec344625", 999999907200n],
  value: 999999907200n,
 
  commissionUSD: 2.50, 
 
  switchChainAsync: async (chainId) => {
    // switch current chain to chainId on the user's wallet
  },
  sendTransactionAsync: async (tx) => {
    // send tx to the chain using the user's wallet
  },
  signTypedDataAsync: async (data) => {
    // sign typed data using the user's wallet
    // return the signature
  },
});

This will automatically add a commission of USD 2.50 to the payment transaction.

Similarly, you can add a commission to the listPaymentOptions, createSession, and estimatePaymentAmount methods.

3. Payout

Commission will be paid out to the provided address daily.