AlcorDocs

Referral / Custom Market Fee

Earn an extra fee on Alcor Swap trades routed through your link, widget or interface.

Any account can register as a "market" on the swap.alcor contract with its own fee. When a swap names that market, the contract charges the market fee on top of the pool fee and sends it to the market account.

1. Register your market

Call the regmarket action of swap.alcor, signed by the market account itself:

  • marketName: the account that receives the fee.
  • marketFee: the fee in millionths (parts of 10^6).
1000  = 0.1%
500   = 0.05%
10000 = 1% (maximum)

Calling regmarket again with the same account changes its fee.

The market fee is charged in every pool the swap passes through, in that pool's input token, and is sent to the market account in the same transaction.

2. Send swaps through your market

A swap names the market as the last field of its transfer memo. There are two ways to get it there.

Swap widget

Embed the Swap Widget and add your market as the market query parameter:

<iframe src="https://wax.alcor.exchange/swap-widget?market=<marketName>" width="445" height="600"></iframe>

Use the domain of your chain: wax.alcor.exchange, proton.alcor.exchange, eos.alcor.exchange or telos.alcor.exchange.

Your own interface

Build the swap transfer yourself and put the market account at the end of the memo. The transfer goes to swap.alcor:

<swapexactin|swapexactout>#<Pool IDs>#<Recipient>#<Output Token>#<Deadline>#<marketName>

// fees.alcor is the market account that receives the fee
swapexactin#401,1212#alcordexfund#5.3645 USDT@usdt.alcor#0#fees.alcor

The route and memo for a swap can be requested from the API: see Swap API.

The swap page at alcor.exchange does not read a market parameter, so a plain link to it does not earn a market fee.

On this page