Developers

    Longbowlend for builders

    Earn 50% of the performance fee on volume you route through Longbowlend. You attribute volume with one field (builderCode) on the calls you already make. This page is the whole integration.

    1. Get a code

    One signature. No gas, no transaction, no custody.

    register.js
    // get the message to sign
    const { message } = await fetch(
    `https://longbowlend.fun/api/builders/message?action=register&address=${wallet}`
    ).then((r) => r.json());
     
    // sign it
    const signature = await provider.request({
    method: "personal_sign",
    params: [message, wallet],
    });
     
    // register — you get a permanent code back
    const { code, link } = await fetch("https://longbowlend.fun/api/builders/register", {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ address: wallet, message, signature, name: "Your app" }),
    }).then((r) => r.json());

    One code per wallet, permanent. Change your payout address later with the same signature flow against action=payout.

    2. Attribute volume

    Add builderCode to the plan or build call for the surface you use. Nothing else about your flow changes. Volume is matched to your code when the transaction settles.

    Earn: deposit into the vault

    deposit.js
    const res = await fetch("https://longbowlend.fun/api/v2/vaults", {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ user: wallet, amount, builderCode: code }),
    });
    const tx = await res.json(); // { to, value, data, requiresApproval }
    await signer.sendTransaction({ to: tx.to, value: tx.value, data: tx.data });

    Borrow: against Stock Tokens, crypto and RWAs

    borrow.js
    const plan = await fetch(
    `https://longbowlend.fun/api/borrow-plan?market=SPY&user=${wallet}&builderCode=${code}`
    ).then((r) => r.json());
    // build and sign the borrow bundle from `plan`

    Leverage: one-click long

    leverage.js
    const plan = await fetch("https://longbowlend.fun/api/multiply-plan", {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ user: wallet, market: "NVDA", collateralAmount, targetLeverage: 3, builderCode: code }),
    }).then((r) => r.json());

    NFT loans: record the loan once it lands

    nft.js
    await fetch("https://longbowlend.fun/api/nft/loans/record", {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ txHash, builderCode: code }),
    });

    Agents (MCP)

    The Longbowlend MCP server takes an optional builderCode on its volume tools (build_supply_tx, build_borrow_tx, build_multiply_tx). Pass your code and the routed volume is attributed to you.

    Deep link

    Send users to https://longbowlend.fun?builder=YOUR_CODE, on any page. The code is kept in their browser for 30 days, the last valid code wins, and every borrow and deposit they make on the site carries it as builderCode. An explicit builderCode on an API call always overrides the link.

    3. Charge your own fee

    The revenue share is Longbowlend's performance fee, split with you. Separately, you may charge your own fee inside your own flow. Longbowlend neither sets it nor takes any part of it. This is Morpho's borrow-origination pattern.

    Borrow the gross amount, send the user the net they asked for, and route the difference to yourself. It all happens in one transaction.

    origination-fee.js
    // Charge your own origination fee by borrowing the GROSS and splitting it.
    // The user asked for 1,000 USDG and you want 2%.
    const net = 1_000_000_000n; // 1,000 USDG, 6dp — what the user receives
    const fee = (net * 200n) / 10_000n; // 200 bps -> 20 USDG, yours
    const gross = net + fee; // 1,020 USDG — the debt Morpho records
     
    // Borrow the gross on the user's behalf, then route the two amounts.
    // Requires a smart account, or a router the user has authorised:
    // morpho.setAuthorization(yourRouter, true)
    morpho.borrow(marketParams, gross, 0, user, yourRouter);
    usdg.transfer(user, net);
    usdg.transfer(yourFeeRecipient, fee);

    Three things follow from borrowing the gross, and the first two are your user's money. The debt recorded on Morpho is net + fee, so interest accrues on the larger figure. Show the net received, the gross owed and the resulting LTV before they sign. The borrow must route through a smart account or a router the user has authorised with setAuthorization, since the split happens mid-transaction. And the fee belongs to your integration, not to the market: anyone can reach the same market directly and pay nothing.

    Morpho documents the pattern in full under Monetize your borrow product.

    4. Read your numbers

    GEThttps://longbowlend.fun/api/builders/stats/{code}volume, earnings, rank, payout history
    GEThttps://longbowlend.fun/api/builders/leaderboardthis month's top builders
    GEThttps://longbowlend.fun/api/builders/programprogram totals

    Rules

    • 50% of the performance fee on your attributed volume.
    • Your own registered wallet's volume never counts.
    • $100 of attributed volume before your first payout.
    • Paid monthly in USDG, after review. Accrued earnings are always honored.

    Attributing a deposit

    Append your builder code to the end of the calldata of any deposit into Core, Frontier or the ETH vault. Trailing calldata is ignored by the EVM, so this changes nothing about how the deposit executes, and because the tag rides the transaction the user signs, it works unchanged through Bundler3 and through Route zaps. Deposits without a code, and deposits from contracts you have not registered, are not attributed.

    longbow.ts
    import { encodeFunctionData, concatHex } from 'viem'
     
    // Your Longbowlend builder code, from POST /api/builders/register
    const LONGBOW_CODE = 'ABC1234'
     
    // ERC-8021 attribution suffix: [codes ascii][len][schema][marker]
    export function longbowSuffix(code = LONGBOW_CODE) {
    const ascii = Buffer.from(code, 'utf8').toString('hex')
    const len = code.length.toString(16).padStart(2, '0')
    const marker = '8021'.repeat(8)
    return `0x${ascii}${len}01${marker}`
    }
     
    // Tag any deposit. `concatHex` keeps the original calldata as an exact prefix.
    const data = concatHex([
    encodeFunctionData({
    abi: vaultAbi,
    functionName: 'deposit',
    args: [assets, receiver],
    }),
    longbowSuffix(),
    ])
     
    await walletClient.sendTransaction({ to: LONGBOW_CORE, data })

    Suffix marker: 0x8021…8021 (16 bytes). The marker is required: a tag without it is ignored.

    Builder code registry

    Builder codes appear in transaction calldata, so they are already public. This list is published so anyone can check which builder a code belongs to.

    CodeBuilderRegistered
    3E7Y4MAE2E TestAug 26, 2026
    MYJYJCCQA TestAug 26, 2026
    62FHSK2—Aug 26, 2026
    4BDQ9M5—Sep 7, 2026
    KGQHF77sec-testSep 11, 2026
    8WRACG0—Sep 11, 2026
    5YRTYZ2revalidationSep 11, 2026
    EG3T69W—Sep 16, 2026
    PSCV17A—Sep 18, 2026
    AG3Z3PN—Sep 24, 2026
    PNXF10T—Sep 24, 2026
    F6DGD06—Sep 30, 2026
    F48RR32—Oct 8, 2026
    54X9XAN—Oct 11, 2026
    MREYMNY—Oct 11, 2026
    MM3R7GJ—Oct 21, 2026
    PPCDVWD—Oct 22, 2026
    3KC3KYC—Oct 22, 2026
    EPR2Y0B—Oct 22, 2026
    1Y98C85—Oct 22, 2026
    6AAC2ST—Oct 23, 2026
    QPQ3MZ3—Oct 24, 2026
    YNV8SWD—Oct 24, 2026
    HS0P50J—Oct 24, 2026
    EQJDA3N—Oct 24, 2026
    810A906—Oct 24, 2026
    EQ73GCY—Oct 24, 2026
    B6X93FJ—Oct 24, 2026
    7EQHMBE—Oct 25, 2026
    004CARP—Oct 25, 2026
    4FF3XQ5i11600 PoCOct 26, 2026
    C6K0ZB7—Oct 26, 2026
    7TMY5XG—Oct 26, 2026
    2HP9820img src=x onerror=window.__X731Oct 26, 2026
    7F3TZBG—Oct 26, 2026
    AM8HKW7i18465ctlOct 26, 2026
    J4DFHMNi18465ctl-cleanrow-controlOct 26, 2026
    YBWYNFVi18465sq'--Oct 26, 2026
    4C9WAMZi18465dq"--Oct 26, 2026
    Q2ZN64Hi18465esc\'--Oct 26, 2026
    SYX9QDEi18465') OR ('1'='1Oct 26, 2026
    XK7ZCYEi18465%Oct 26, 2026
    YTSVAJG%i18465Oct 26, 2026
    PAXY5YDi18465_%_Oct 26, 2026
    WAMV5HGi18465100%\_Oct 26, 2026
    Y9R656Ti18465{"k":"v"}Oct 26, 2026
    WYWYAZ6i18465["a",1,null]Oct 26, 2026
    F16F0G4i18465\u0041\u0027Oct 26, 2026
    EHE8RYXi18465\ud83d\ude00Oct 26, 2026
    06P9RYAi18465line1\nline2\ttabOct 26, 2026
    QRB5TJDi18465\x00\x01Oct 26, 2026
    JQC3H7Ti18465created,id descOct 26, 2026
    06SQGHCi18465+created;--Oct 26, 2026
    Y5QJ3G3i18465`id`Oct 26, 2026
    1MKQY4Bi18465;SELECT 1--Oct 26, 2026
    F28STT5—Oct 27, 2026
    FZNZQP4img src=x onerror=alert(24064)Oct 27, 2026
    GRDRE4W—Oct 27, 2026
    JJ6MKHE—Oct 27, 2026
    E7R61BCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOct 27, 2026
    E8GSGHK_b_i_c_Oct 27, 2026
    N2YVG2Wreplay-testOct 27, 2026
    C5JDHGG[t](h)\|_e_Oct 27, 2026
    2SWK9ZBbB/biI/iuU/uOct 27, 2026
    2ZD147Ba href="http://evil.tld"X/aOct 27, 2026
    VBMJXJHAB=====FAKE:Oct 27, 2026
    FVJ0CPNABC[31mROct 27, 2026
    WZJX1CSx' OR '1'='1Oct 27, 2026
    Y3J0GTCx';SELECT pg_sleep(3)--Oct 27, 2026
    KRZCYPJx' AND CAST(x AS INT)--Oct 27, 2026
    HR8YM20x"-- commentOct 27, 2026
    518TPD3A‮B⁄COct 27, 2026
    AS9BZ7J𝐀́́Oct 27, 2026
    HAARZHZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZOct 27, 2026
    NBQ3K4Mi24209bOct 27, 2026
    72JECJVP1P2Oct 27, 2026
    60KS1MBP1P2Oct 27, 2026
    0RDQ95WP1P2Oct 27, 2026
    SD579ZSP1P2Oct 27, 2026
    5QSQHM7P1P2Oct 27, 2026
    ZYAADNMP1P2Oct 27, 2026
    1AYMVQN—Oct 27, 2026
    2GR2EJ7—Oct 27, 2026
    N7W29S5—Oct 27, 2026
    DRPYSVS—Oct 27, 2026
    1P0JBHB—Oct 27, 2026
    GNJANXJ—Oct 27, 2026
    WFS36Q5i24540-verifyOct 27, 2026
    Q2B5F8C—Oct 27, 2026
    BMBNPQC—Oct 27, 2026
    R9B4J2R—Oct 27, 2026
    A194ZV10x8cb8AA35228c96C1C4E956E69AbAEBOct 27, 2026
    GNTB354—Oct 27, 2026
    C4J7M0K—Oct 27, 2026
    QRHSVJQr0-ctrlB2Oct 27, 2026
    F6TGXSE—Oct 27, 2026
    31G50HH—Oct 27, 2026
    6HXWF5V—Oct 27, 2026
    5487V7W—Oct 27, 2026
    HCH8RN4—Oct 27, 2026
    V4DYP7S—Oct 27, 2026
    MVS6WAWi25944-nmBOct 27, 2026
    81PZFF5i25944-N6-n1Oct 27, 2026
    3RVGCW6i25944-N8-n1Oct 27, 2026
    VQ925F6i25944-10-n9Oct 27, 2026
    ARGK5TJi25944-ir-AOct 27, 2026
    AG58FC8—Oct 27, 2026
    ZFB6R36i25944-F2-n4Oct 27, 2026
    SKZNRQZ—Oct 27, 2026
    SP57TQR—Oct 27, 2026
    MC2G5PF—Oct 27, 2026
    D32ENYS—Oct 27, 2026
    WMFJ216—Oct 27, 2026
    XPZJ4M9—Oct 27, 2026
    DAXMTAT—Oct 27, 2026
    YKHZE91—Oct 27, 2026
    0Z8JSYQ—Oct 27, 2026
    ZGK6BZN—Oct 27, 2026
    FKVA3W0—Oct 27, 2026
    5V3KB84—Oct 27, 2026
    KYDYYSY—Oct 27, 2026
    TG264P2—Oct 28, 2026
    FSKZ82P—Oct 28, 2026
    526GQ06—Oct 28, 2026
    S8Y24VR—Oct 28, 2026
    PH3W8M6—Oct 28, 2026
    AN5FVSZ—Oct 28, 2026
    E1MCH1JProbeOct 28, 2026
    8VGJR0YtOct 29, 2026
    BVY046SHookrOct 29, 2026
    W3DBV7K—Oct 30, 2026
    YRTW6K4—Oct 30, 2026
    S49N93Sm1421testOct 30, 2026
    GC3R1BXxOct 30, 2026
    SFW3RDZHello WorldOct 30, 2026
    W8QCGCGscriptalert(1)/scriptOct 30, 2026
    A4SRN2Wimg src=x onerror=alert(1)Oct 30, 2026
    Y991KKXa'b"cOct 30, 2026
    QEHK1K5test & moreOct 30, 2026
    9H8KNN4https://evil.com/xOct 30, 2026
    83B3KJNonerror=alert(1)Oct 30, 2026
    RRRW54Pjavascript:alert(1)Oct 30, 2026
    SHW3A7Xsvg/onload=alert(1)Oct 30, 2026
    SVN446Pabc/bdOct 30, 2026
    0A47236quotes " and ' singleOct 30, 2026
    PFCPF88backtick ` testOct 30, 2026
    VMXFP3EABC DEFGHIJKLMNOPQRSTUVWXYZ 1234Oct 30, 2026
    DKM9VEY—Oct 30, 2026
    SGGCDVW—Oct 30, 2026
    W9HE2S9MyNameOct 30, 2026
    KGN9MMW—Oct 30, 2026
    7RHGTTN—Oct 30, 2026
    8BWAPE3MyNameOct 30, 2026
    KGWEKCJ—Oct 30, 2026
    MC9ACTM—Oct 30, 2026
    Y6D4EAY—Oct 30, 2026
    H1TB31Ba_b_cOct 30, 2026
    8181M1E—Oct 30, 2026
    CZ7A0A5—Oct 30, 2026
    N7V3YVS—Oct 30, 2026
    8PR8PZV—Oct 30, 2026
    EVNNJA8AliceOct 30, 2026
    YSSYRZK—Oct 30, 2026
    HGK84JN—Oct 30, 2026
    E6SB610img src=x onerror=alert(documenOct 30, 2026
    T02EZ30svg onload=alert(1)Oct 30, 2026
    4CQDVQVscriptalert(1)/scriptOct 30, 2026
    WAKBM45img src=x onerror=alert(1)Oct 30, 2026
    0C3W2N6—Oct 30, 2026
    C17QAB0i55638sq' OR '1'='1Oct 31, 2026
    D2FV13Xi55638-t';SELECT pg_sleep(8)--Oct 31, 2026
    KV50DHCi55638-u' UNION SELECT NULL,NULLOct 31, 2026
    KXW46B1i55638-b' AND '1'='2Oct 31, 2026
    K9TXPW3i55638-dq"-- commentOct 31, 2026
    ZMJW17Ei55638-backtick`xOct 31, 2026
    PASF19Ei55638-flagOct 31, 2026
    8K9HNJCi55638n{$ne:null}Oct 31, 2026
    KCCRB7Ai55638w{$where:'1==1'}Oct 31, 2026
    CP9QSP6i55638sq' OR '1'='1Oct 31, 2026
    QKQW8HVi55638-t';SELECT pg_sleep(8)--Oct 31, 2026
    J40M7T2i55638-u' UNION SELECT NULL,NULLOct 31, 2026
    5ABQFAAi55638-b' AND '1'='2Oct 31, 2026
    GZX23DZi55638-dq"-- commentOct 31, 2026
    NW7X6M7i55638-backtick`xOct 31, 2026
    DXFG36Ai55638-flagOct 31, 2026
    EK05ANDi55638n{$ne:null}Oct 31, 2026
    JNV2884i55638w{$where:'1==1'}Oct 31, 2026
    3AZVM4Ni55638x'Oct 31, 2026
    XGHV0EFi55638x'--Oct 31, 2026
    CNR4CDJi55638a''bOct 31, 2026
    CD5MDFXi55638x' OR 1=1;#Oct 31, 2026
    2Z7KFG3i55638x';DELETE FROM builders;--Oct 31, 2026
    CATEWHG—Oct 31, 2026
    RXTX9PP—Nov 3, 2026
    ZX3Y4PM—Nov 4, 2026
    TR3ANWX—Nov 10, 2026
    QA28N6T—Nov 10, 2026
    Z68EKTE—Nov 14, 2026
    PMTTZ1Z—Nov 23, 2026
    1976GQBi197752Nov 28, 2026
    06VP3S6other-nameNov 28, 2026
    SKCVRQ5i197752Nov 28, 2026
    JHTEYGHi197752Nov 28, 2026
    MJ75T07i197752Nov 28, 2026
    3HWN8Z2i197752Nov 28, 2026
    EWFD9N7i197752Nov 28, 2026
    7QMCXWRxNov 28, 2026
    HS0AZK6i197752Nov 28, 2026
    622KH90i197752Nov 28, 2026
    NN10KR1replayBNov 28, 2026
    S544VNKi198034-probeNov 28, 2026
    TTVF1XXE2E-XSS-TEST-bhi/bNov 30, 2026
    SFNWFAVXSSPROBEb1/bNov 30, 2026
    AJTZS90img src=x onerror=alert(1)Nov 30, 2026
    GK331PN<img src=x onerror=alert(1)&gNov 30, 2026
    8CAJFPJ" onmouseover="alert(1)Nov 30, 2026
    WJH23QX' onmouseover='alert(1)Nov 30, 2026
    K9AC211`;alert(1)//Nov 30, 2026
    ZBAEWT7javascript:alert(1)Nov 30, 2026
    DF96RTBabcdNov 30, 2026
    RJ5TKYQimg‮src=xNov 30, 2026
    JNYQZS7abNov 30, 2026
    1D27R93&<script>Nov 30, 2026
    J8P7PWK'"`&/\Nov 30, 2026
    WZYXQXP/spanimg src=x onerror=alert(Nov 30, 2026
    W4XWFHYhttpswebhooksite624576c7c1444a7dNov 30, 2026
    KCS634Y${7*7}Nov 30, 2026
    RKENH33—Nov 30, 2026
    90DHWMYreplayDec 2, 2026
    6DSA6RAalpha-selfDec 4, 2026
    E11DKCE—Dec 4, 2026
    V2XB12Nc-legitDec 4, 2026
    NBX62T2—Dec 4, 2026
    Y18FQDNe-nameDec 4, 2026
    Y89KK87—Dec 4, 2026
    A20X70A—Dec 5, 2026

    Was this page helpful?

    Longbowlend — Longbowlend Technical Documentation — Builders

    Longbowlend (https://longbowlend.fun/docs/builders) is an independent, non-custodial onchain credit marketplace engineered to connect stablecoin liquidity providers with borrowers holding tokenized equities, real-world assets (RWAs), digital currencies, and verified NFT collections. Rather than pooling heterogeneous assets into a single shared balance sheet, Longbowlend isolates every collateral market behind explicit risk bounds, dedicated oracle adapters, and capped debt exposure.

    Isolated Market Architecture & Oracle Verification

    Within Longbowlend, each lending pool specifies its own liquidation Loan-to-Value (LLTV) ratio, interest-rate curve, and maximum supply cap prior to activation. Price discovery combines redundant decentralized oracle feeds and time-weighted average pricing safeguards to resist short-term manipulation. Lenders allocating USDG or WETH into curated vaults gain continuous visibility into where liquidity is deployed, how utilization evolves, and what collateral backs every outstanding dollar of debt.

    Capital Efficiency for Tokenized Equities & RWAs

    Traditional money markets rarely support tokenized stock tokens or specialized real-world assets alongside native crypto liquidity. Longbowlend bridges this gap by offering dedicated isolated credit lines, single-transaction equity leverage routing, zero-fee flash liquidity for automated arbitrage or refinancing, and deterministic smart-contract escrow for collection-backed NFT credit.

    Frequently Asked Questions

    How does Longbowlend isolate collateral risk for Longbowlend Technical Documentation — Builders?

    Longbowlend structures every collateral asset inside a ring-fenced credit pool with an independent price oracle, loan-to-liquidation threshold (LLTV), and supply cap. Volatility or stress in one asset market cannot spill over into unrelated vaults or borrower positions.

    Does Longbowlend hold custodial control over user funds?

    No. Longbowlend operates strictly through non-upgradeable, non-custodial smart contracts. Depositors and borrowers interact directly with deterministic onchain pools where balances, utilization rates, and withdrawal mechanics remain publicly verifiable.

    How are USDG yield rates and borrower fees determined?

    Vault yields on Longbowlend reflect real borrowing demand across underlying isolated markets. Utilization curves dynamically balance lender APY and borrow cost while maintaining transparent liquidity reserves for withdrawals.