Referral System

This section explains how referrals and attribution are tracked using the SDK.


Overview

The referral system allows tracking user acquisition and attribution. Referral codes can be attached when generating deposit addresses.


Adding Referral Codes

Pass a referral code when preparing a stake or deposit action.

import { createLombardSDK, Chain, AssetId } from '@lombard.finance/sdk';
import { config } from './lib/lombard';

const sdk = createLombardSDK(config);

const stake = sdk.chain.btc.stake({
  destChain: Chain.ETHEREUM,
  assetOut: AssetId.LBTC,
});

await stake.prepare({
  amount: '0.1',
  recipient: '0x1234567890abcdef1234567890abcdef12345678',
  referralCode: 'PARTNER123',
});

Checking Referral Status

Use the SDK's referrals client to check if an address has a referrer.

Response Type


Referral Code Rules

  • Codes are case-insensitive

  • Codes are attached at deposit address generation time

  • Once set, a referrer cannot be changed for that address

  • Codes are associated with destination addresses, not deposit addresses


Supported Actions

Referral codes can be added to:

  • sdk.chain.btc.stake — BTC to LBTC staking

  • sdk.chain.btc.deposit — BTC to BTC.b deposits

  • sdk.chain.btc.stakeAndDeploy — Stake to DeFi vault

  • sdk.chain.btc.depositAndDeploy — Deposit to DeFi vault

Last updated