Referrals
How it works
- Your users swapThrough your platform, with your address and fee on each quote.
- The router takes the feeOut of what the swap buys. Half of it above the 0.05% base is yours.
- You claimYour share builds up in the router, per asset, until you claim it.
What a swap pays
100 Stable A into Stable B, both $1 · before pool fees and price impact| Fee | Total fee | Referrer keeps | Router keeps | User keeps |
|---|---|---|---|---|
| 0.05% | 0.05 | nothing | 0.05 | 99.95 |
| 0.25% | 0.25 | 0.10 | 0.15 | 99.75 |
| 0.5% | 0.50 | 0.225 | 0.275 | 99.50 |
| 1% | 1.00 | 0.475 | 0.525 | 99.00 |
| Holds | Total fee | Referrer keeps | Router keeps | User keeps |
|---|---|---|---|---|
| None | 1.00 | 0.475 | 0.525 | 99.00 |
| ¼ | 0.763 | 0.356 | 0.406 | 99.238 |
| ½ | 0.525 | 0.238 | 0.288 | 99.475 |
| ¾ | 0.288 | 0.119 | 0.169 | 99.713 |
| Full | 0.05 | nothing | 0.05 | 99.95 |
Details
The rules
- Your feeSet per quote. At the 0.05% base you earn nothing.
- 0.05% to 1%
- Your shareOf the fee above the base. The router keeps the rest.
- Half
- Paid inThe asset each swap buys, until you claim it.
- Output asset
- Applies toNot liquidity, or swaps with several inputs or outputs.
- One in, one out
Setup costs
Deposits come back on close- Open an assetEach asset you earn in. +0.0097 ALGO if no one has opened it.
- 0.0225 ALGOdeposit + 0.002 ALGO fee
- Set a discountOptional. Once; changing it later is fee only. Refunded if you remove it.
- 0.0225 ALGOdeposit + 0.002 ALGO fee
- ClaimPer asset, whenever you choose.
- 0.002 ALGOfee
- Close an assetPays out what's waiting and refunds its deposit.
- 0.003 ALGOfee
Holder discount
Optional- Holding noneOf your discount token.
- Full fee
- Holding your full amountOr more: the most it can discount.
- 0.05% base
- In betweenEvery unit steps the fee down evenly. Your share and the router's shrink alike.
- Evenly
- WhenFrom the user's wallet as the swap executes. Not opted in pays the full fee.
- At execution
Assets to earn in
Until an asset is open, your share of it goes to the router; the swap still completes.
ALGO
USDC
2 assets · 0 open · 2 missing
- 1
ALGOMissing - 2
USDCMissing
Holder discount
OptionalOffer a discount to holders of a tokenUsers who hold your token pay a lower fee, down to the router's 0.05% base at the full holding you set. The discount comes out of the fee above the base, so it lowers your earnings and the router's equally.
Summary
Connect the wallet you'll be paid to.
- Assets to open
- 2
- Wallet requests
- 1
- Deposits
- 0.045 ALGO
- Network fees
- 0.004 ALGO
- At most
- 0.0684 ALGO
Deposits come back when you close an asset. “At most” is if no one has opened them before.
Each wallet request signs many assets at once. The first that fails or is cancelled stops the run.
Four steps
- Open assetsUnder Set up, with the wallet you'll be paid to: each asset you want to earn in. A discount is optional.
- Add two fields to each quotereferrer: your address. fee_ppm: your fee, 500 (0.05%) to 10,000 (1%).
- Build as usualPOST /execute with the quote_id. Nothing else changes: the referral rides on the quote.
- ClaimUnder Earnings, whenever you like.
Docs and SDKs
A referred quote
POST https://hogswap-v3.liquihog.dev/quote
{
"mode": "SWAP",
"asset_in": 31566704,
"asset_out": 0,
"amount_in": 100000000,
"slippage_bps": 50,
"referrer": "<your address>",
"fee_ppm": 5000
}{
"quote_id": "…",
"expected_out": "…",
"referrer": "<your address>",
"referrer_fee_amount": "…",
"referrer_share_ppm": 2250
}Your share is in the output asset's base units. Referrals apply to swaps with one asset in and one out. With a holder discount, the quote still shows the full fee: the discount is applied when the swap executes, so a holder gets at least the quoted amount. Rate limit: 30 calls per 10 s per IP, shared with quotes and builds.