Referral Program

A program to reward developers who leverage Haystack.

Overview

Haystack has exposed APIs (and SDKs that wrap the API calls) for fetching swap quotes and executing these quotes. To incentivize usage of these APIs, Haystack offers a referral program, where developers can earn 25% of the commissions generated by traffic through API calls.

Users of the mobile Haystack app (https://hay.app/arrow-up-right) may already be familiar with this because sharing a referral in the mobile app is handled using the same process. Referred users specify the referrer's address when swapping and the 25% referrer fee is automatically passed on.

How to participate?

The interface for fetching a Haystack quote includes a referrer address field. If this field is set, 25% of Haystack commissions will be sent to an escrow account that can only be accessed by the given referrer address. An escrow account is used in order to handle opt-ins of assets that the given referrer address has not opted into.

Haystack has exposed a simple API that returns the escrow account address for any referrer address input:

https://hayrouter.txnlab.dev/api/treasuryAddress?address=<referrer_address>

Herearrow-up-right is an example.

To sign up for the referral program, please head over to https://deflex-referrer.txnlab.devarrow-up-right to link your referrer address to your personal escrow account.

Automatic Swapping of Commissions

The Haystack Order Router charges fees in the output asset of a swap (e.g., if a user swaps from ALGO to goBTC, the fee is charged in goBTC). Accumulating commissions in different assets may be undesirable for some referrers (a token that's valuable today may be worthless by the time the referrer claims the commissions).

Therefore, we offer a system where we convert commissions to a pre-defined asset (e.g., ALGO, USDC, etc). This is, unfortunately, not possible at the moment in a trustless way. Therefore, this system is disabled by default and only if a referrer approves with a special transaction, a dedicated account is given access to a referrer's escrow account. Referrers can grant and revoke permission at any time on https://deflex-referrer.txnlab.devarrow-up-right

A referrer can define what asset the other assets are swapped to. For example, a referrer can define that her commissions are automatically converted to USDC. If automatic swapping is enabled, Deflex will convert your commissions daily to your selected asset and deposit it again in your escrow account.

All swaps made using this service are swapped with a 1% convenience fee.

Redeeming Commissions from Escrow

You can claim your commissions at any time on https://deflex-referrer.txnlab.devarrow-up-right

Last updated