# AffiliateRouter

The PananaSwap AffiliateRouter enables **partner-aware swap execution** by routing trades through a dedicated smart contract that applies protocol fees and attribution logic.

It is designed for integrations where **referral tracking, revenue sharing, or partner attribution** is required.

***

### What Is AffiliateRouter

AffiliateRouter is a specialized routing contract that:

* Executes swaps on behalf of integrators
* Applies protocol and VIP-based fees deterministically
* Attributes execution to a specific affiliate or partner context

It extends standard swap execution without introducing custodial risk.

***

### When to Use AffiliateRouter

AffiliateRouter is suitable for:

* Partner integrations and embedded swap interfaces
* Referral-based traffic attribution
* White-labeled or co-branded swap experiences
* Custom frontends that require fee attribution

For standard end-user swaps without attribution needs, the default swap flow is sufficient.

***

### How AffiliateRouter Works

At a high level, AffiliateRouter:

1. Receives swap parameters from the integrator
2. Executes the swap using on-chain liquidity
3. Applies protocol fees and VIP logic
4. Records affiliate attribution at execution
5. Settles output tokens directly to the user

All execution remains on-chain and non-custodial.

***

### Non-Custodial by Design

AffiliateRouter does **not**:

* Hold user funds
* Maintain balances
* Require deposits

Users sign transactions directly from their wallets, and all assets flow through smart contracts transparently.

***

### Fee and VIP Compatibility

AffiliateRouter respects the same fee framework as standard swaps:

* VIP fee tiers are applied automatically per wallet
* Affiliate attribution does not override VIP benefits
* Fee enforcement is deterministic and rule-based

This ensures consistent behavior across all execution paths.

***

### Attribution and Transparency

Affiliate attribution:

* Is recorded at execution time
* Does not affect routing or pricing logic
* Is publicly verifiable through on-chain data

Attribution exists solely for analytics and partner accounting purposes.

***

### Network Deployments

AffiliateRouter contracts are deployed per supported network.

* Ethereum Mainnet
* Arbitrum
* Base

Integrators must reference the correct contract address for each network.

***

### Integration Considerations

When integrating AffiliateRouter, developers should consider:

* Network-specific gas dynamics
* Slippage and execution risk
* Correct handling of reverted transactions
* Clear disclosure to end users

PananaSwap does not guarantee outcomes for third-party integrations.

***

### Security Considerations

AffiliateRouter follows the same security principles as core contracts:

* Public and verifiable logic
* No privileged execution paths
* No per-user overrides

Integrators are responsible for securing their own frontend and infrastructure.

***

### Limitations

AffiliateRouter does not:

* Provide off-chain accounting
* Guarantee referral payouts
* Override protocol-level rules

All behavior follows documented smart contract logic.

***

### Documentation and Updates

AffiliateRouter behavior may evolve over time.

Material changes, if any, will be documented prior to deployment.

Integrators are encouraged to monitor official documentation for updates.
