Advanced Features Guide

This comprehensive guide covers advanced topics for experienced users, including funding arbitrage, keeper bots, API integration, and affiliate programs.

Table of Contents


Funding Rate Arbitrage

Polynomial uses an innovative funding rate mechanism that differs from traditional perpetual exchanges. The system employs a continuous funding rate velocity model combined with dynamic market pricing to create efficient markets and arbitrage opportunities.

Introduction

Funding rates in Polynomial serve three primary purposes:

  1. Maintain perpetual futures price alignment with the underlying asset

  2. Balance long and short positions in the market

  3. Create arbitrage opportunities that help maintain market efficiency

Funding Rate Mechanism

How Funding Works

Unlike traditional exchanges that calculate funding at fixed intervals, Polynomial implements a continuous funding rate model where:

  • Funding is calculated and applied continuously

  • Rates adjust based on market skew

  • Payments flow directly between longs and shorts

The basic funding formula is:

Funding Payment = Position Size × Funding Rate × Time Elapsed

Where:

  • Position Size is in USD

  • Funding Rate is an annualized percentage

  • Time Elapsed is measured in years (e.g., 1 hour = 1/8760)

Funding Rate Velocity Model

Polynomial uses a velocity-based approach to funding rate adjustments:

dr/dt = c × skew

Where:
- dr/dt is the funding rate velocity
- c is the velocity coefficient
- skew = (long_positions - short_positions) / skew_scale

This creates smoother funding rate transitions and more predictable arbitrage opportunities.

Key Properties

  1. Continuous Adjustment: Funding rates evolve smoothly rather than jumping at fixed intervals

  2. Market Memory: The system maintains memory of previous imbalances

  3. Path Independence: Total funding is determined by net market imbalance

Market Price Adjustment

Market prices on Polynomial adjust dynamically with skew using a premium/discount mechanism:

Market Price = Oracle Price × (1 + premium)
premium = skew / skewScale

Where:
- skew = (long_positions - short_positions) / skew_scale
- skewScale is a configurable parameter that modulates market liquidity

This creates two levels of incentives:

  1. Immediate price impact: Premium for long skew, discount for short skew

  2. Ongoing funding payments: Continuous funding rate velocity adjustments

  3. Risk management: Creates soft limits on maximum exposure without restrictive OI limits

Funding Rate Arbitrage Guide

Basic Arbitrage Strategy

  1. Identify Opportunity

    • Monitor funding rates across exchanges

    • Look for significant rate differentials

    • Check liquidity on both venues

  2. Position Setup

    • Short on the high funding rate venue (Polynomial)

    • Long on the low funding rate venue

    • Maintain equal position sizes for delta neutrality

  3. Capital Requirements

    Required Margin = Position Size × Max(Margin_Rate_A, Margin_Rate_B)
    Buffer Margin = Required Margin × 0.3 (recommended 30% buffer)

Advanced Implementation

  1. Entry Execution

    • Use limit orders to minimize slippage

    • Enter positions when funding rate differential exceeds transaction costs

    • Consider gas costs on both venues

  2. Position Monitoring

    • Track funding payments

    • Monitor price deviation between venues

    • Watch for changes in funding rates

  3. Exit Conditions

    • Funding rate convergence

    • Achievement of profit target

    • Risk threshold breach

Cross-Margin Advantage

Polynomial's cross-margin system provides several benefits for arbitrage:

  1. Capital Efficiency

    • Single margin pool for all positions

    • Reduced total margin requirements

    • Better leverage utilization

  2. Risk Management

    • Portfolio-wide liquidation pricing

    • Unified collateral management

    • Simplified position tracking

Risk Management

Key Risks

  1. Exchange Risk

    • Counterparty risk

    • Platform downtime

    • Oracle failures

  2. Market Risks

    • Price deviation between venues

    • Sudden funding rate changes

    • Liquidity gaps

  3. Operational Risks

    • Network congestion

    • Smart contract risk

    • Implementation errors

Risk Mitigation Strategies

  1. Position Sizing

    Max Position Size = Account Value × Risk Factor / Max Expected Loss
    Where:
    - Risk Factor = 0.02 (2% risk per trade recommended)
    - Max Expected Loss includes potential funding and slippage
  2. Margin Management

    • Maintain minimum 25% buffer above liquidation

    • Scale positions based on funding rate volatility

    • Consider correlation between venues

Examples and Calculations

Example 1: Basic Funding Arbitrage

Given:

  • Polynomial funding rate: +200% APR

  • Other venue funding rate: +10% APR

  • Position size: $100,000

Calculations:

Daily funding differential = $100,000 × (200% - 10%) / 365
                         = $100,000 × 1.90 / 365
                         = $520.55 per day

Example 2: Position Sizing with Risk Management

Given:

  • Account value: $100,000

  • Risk factor: 2%

  • Expected worst-case loss: 5%

Max Position Size = $100,000 × 0.02 / 0.05
                  = $40,000

Example 3: Required Margin Calculation

Given:

  • Position size: $40,000

  • Margin rate A: 5%

  • Margin rate B: 10%

  • Buffer: 30%

Required Margin = $40,000 × Max(5%, 10%)
                = $40,000 × 0.10
                = $4,000

Total Required = $4,000 × 1.30 (including buffer)
               = $5,200

Advanced Topics

Funding Rate Velocity Implications

The velocity model creates unique properties:

  1. Smoother rate transitions

  2. More predictable arbitrage opportunities

  3. Better market stability

The funding rate velocity can be used to predict future funding rates:

Future_Rate = Current_Rate + (dr/dt × Time)

Where:
dr/dt = c × skew as defined earlier

Market Impact Analysis

When executing large arbitrage positions, consider the market impact:

Expected_Slippage = k × Position_Size / Market_Depth

Total_Cost = Slippage + Gas_Fees + Exchange_Fees

Only execute when:

Expected_Funding_Profit > Total_Cost × Safety_Margin

Conclusion

Successful funding rate arbitrage on Polynomial requires:

  1. Understanding of the continuous funding mechanism

  2. Proper risk management

  3. Efficient execution

  4. Constant monitoring

  5. Adaptation to market conditions

For the latest parameters and updates, refer to the contracts.


Keeper Bots

Perps markets rely on keepers to fetch offchain price data to fill orders and liquidate accounts. Polynomial Perps use a delayed order mechanism to fill orders.

Overview

How It Works

  • Minimum delay: Set to one block (2 seconds)

  • Keeper rewards: Gas cost + $0.1 tip per order

  • Liquidation rewards: Around $5 per liquidation

  • Order execution: Keepers receive gas cost and tip for their work

Getting ETH on Polynomial Chain

You can use https://refuel.exchange to get ETH on Polynomial chain.

Multicall

Keepers are expected to batch their actions using TrustedMulticallForwarder contract:

struct Call3Value {
    address target;
    bool requireSuccess;
    uint256 value;
    bytes callData;
}

function aggregate3Value(Call3Value[] calldata calls) public returns (bytes[] memory returnData);

Price Updates

Both Order Settlement and Liquidation keepers are responsible for updating oracle price data from Pyth.

API Endpoints

  • Latest price update: /v2/updates/price/latest

  • Specific time price: /v2/updates/price/{time}

Encoding Schema

bytes signedOffchainData = abi.encode(uint8 updateType, uint64 stalenessTolerance, bytes32[] priceIds, bytes[] updateData)
  • updateType: Set to 1 for latest price updates and 2 for price snapshots

  • stalenessTolerance: Maximum time in seconds (max 60 for most actions)

  • priceIds: List of price IDs that the keeper is responsible for

  • updateData: List of price update data

Pushing Price Data

function fulfillOracleQuery(bytes memory signedOffchainData) external;

Order Settlement

Order Committed Event

event OrderCommitted(
    uint128 indexed marketId,
    uint128 indexed accountId,
    SettlementStrategy.Type orderType,
    int128 sizeDelta,
    uint256 acceptablePrice,
    uint256 commitmentTime,
    uint256 expectedPriceTime,
    uint256 settlementTime,
    uint256 expirationTime,
    bytes32 indexed trackingCode,
    address sender
);

Settling Orders

function settleOrder(uint128 accountId) external;

Liquidation

Liquidating Accounts

function liquidate(uint128 accountId) external;

Helper Methods

function canLiquidate(uint128 accountId) external view returns (bool isEligible);
function getRequiredMargins(uint128 accountId) external view returns (uint256 requiredInitialMargin, uint256 requiredMaintenanceMargin, uint256 maxLiquidationReward);
function getAvailableMargin(uint128 accountId) external view returns (int256 availableMargin);

Contract Addresses

Getting Started

Prerequisites

  • ETH on Polynomial Chain for gas fees

  • Understanding of Pyth oracle system

  • Basic knowledge of smart contract interactions

Setup Steps

  1. Get ETH: Use refuel.exchange to get ETH on Polynomial Chain

  2. Monitor Events: Set up event monitoring for OrderCommitted events

  3. Price Updates: Implement Pyth price update fetching

  4. Order Settlement: Implement order settlement logic

  5. Liquidation: Implement liquidation logic


API Integration

Trading API

The Polynomial Trading API allows you to programmatically interact with the platform for automated trading, portfolio management, and data analysis.

Authentication

  • API Keys: Generate API keys from your account settings

  • Rate Limits: Understand and respect rate limits

  • Security: Keep API keys secure and never share them

Endpoints

  • Market Data: Real-time market data and historical prices

  • Account Management: Account information and balances

  • Order Management: Place, modify, and cancel orders

  • Position Management: View and manage positions

WebSocket Support

  • Real-time Data: Live market data streams

  • Order Updates: Real-time order status updates

  • Position Updates: Live position and P&L updates

Webhook Integration

Webhooks allow you to receive real-time notifications about trading events and market conditions.

Supported Events

  • Order Fills: Notifications when orders are filled

  • Position Changes: Updates when positions change

  • Price Alerts: Custom price level notifications

  • Account Events: Account-related notifications

Setup Process

  1. Configure Webhook URL: Set up your webhook endpoint

  2. Select Events: Choose which events to receive

  3. Test Integration: Test webhook delivery

  4. Monitor Performance: Monitor webhook reliability

SDK Integration

JavaScript/TypeScript SDK

import { PolynomialSDK } from '@polynomial/sdk';

const sdk = new PolynomialSDK({
  apiKey: 'your-api-key',
  network: 'mainnet'
});

// Get market data
const marketData = await sdk.getMarketData('BTC-PERP');

// Place order
const order = await sdk.placeOrder({
  market: 'BTC-PERP',
  side: 'buy',
  size: 1000,
  price: 50000
});

Python SDK

from polynomial_sdk import PolynomialClient

client = PolynomialClient(api_key='your-api-key')

# Get account info
account = client.get_account()

# Place order
order = client.place_order(
    market='BTC-PERP',
    side='buy',
    size=1000,
    price=50000
)

Best Practices

API Usage

  • Rate Limiting: Respect rate limits to avoid throttling

  • Error Handling: Implement proper error handling

  • Retry Logic: Use exponential backoff for failed requests

  • Monitoring: Monitor API usage and performance

Security

  • API Key Management: Rotate API keys regularly

  • HTTPS Only: Always use HTTPS for API calls

  • Input Validation: Validate all inputs before sending

  • Access Control: Limit API key permissions


Affiliate Program

This guide will walk you through joining Polynomial's affiliate program to earn rewards by referring users to the platform.

Prerequisites

  • Understanding of affiliate programs

  • Ability to refer quality users

  • Compliance with program terms

  • Marketing and promotion capabilities

What is the Affiliate Program?

The Polynomial affiliate program allows you to earn rewards by referring users to the platform. Affiliates earn a percentage of trading fees generated by their referrals.

How It Works

  • Referral Links: Get unique referral links

  • User Registration: Users sign up through your links

  • Trading Activity: Earn from their trading activity

  • Ongoing Rewards: Earn as long as they remain active

Benefits

  • Passive Income: Earn ongoing rewards from referrals

  • High Rewards: Competitive commission rates

  • Quality Users: Focus on referring quality users

  • Long-term Value: Build sustainable income streams

Joining the Affiliate Program

Step 1: Review Program Terms

  1. Read Terms: Review affiliate program terms and conditions

  2. Understand Requirements: Understand program requirements

  3. Check Eligibility: Verify you meet eligibility criteria

  4. Review Commission Structure: Understand commission rates

Step 2: Apply for Affiliate Status

  1. Contact Team: Reach out to the Polynomial team

  2. Provide Information: Share your background and experience

  3. Explain Strategy: Describe your referral strategy

  4. Wait for Approval: Wait for application approval

  1. Receive Links: Get your unique referral links

  2. Test Links: Test links to ensure they work

  3. Customize Links: Customize links for different campaigns

  4. Track Performance: Set up tracking for your links

Affiliate Marketing Strategies

Content Marketing

  • Educational Content: Create educational content about Polynomial

  • Tutorial Videos: Make tutorial videos about using the platform

  • Blog Posts: Write blog posts about DeFi and trading

  • Social Media: Share content on social media platforms

Community Building

  • Discord Communities: Build Discord communities around trading

  • Telegram Groups: Create Telegram groups for discussions

  • YouTube Channels: Start YouTube channels about crypto trading

  • Podcasts: Host podcasts about DeFi and trading

Influencer Marketing

  • Crypto Influencers: Partner with crypto influencers

  • Trading Educators: Collaborate with trading educators

  • DeFi Experts: Work with DeFi experts

  • Content Creators: Partner with content creators

  • Social Media Ads: Run ads on social media platforms

  • Google Ads: Use Google Ads for targeted campaigns

  • Crypto Publications: Advertise in crypto publications

  • Influencer Partnerships: Pay influencers for promotion

Best Practices

Quality Over Quantity

  • Focus on Quality: Focus on referring quality users

  • User Education: Educate users about the platform

  • Ongoing Support: Provide ongoing support to referrals

  • Long-term Relationships: Build long-term relationships

Compliance and Ethics

  • Follow Guidelines: Follow affiliate program guidelines

  • Honest Marketing: Use honest and transparent marketing

  • Disclose Relationships: Disclose affiliate relationships

  • Respect Users: Respect users and their decisions

Performance Optimization

  • Track Metrics: Track key performance metrics

  • A/B Testing: Test different marketing approaches

  • Optimize Campaigns: Continuously optimize campaigns

  • Scale Success: Scale successful strategies

Tracking and Analytics

Key Metrics

  • Referral Count: Number of users referred

  • Conversion Rate: Percentage of referrals who become active

  • Trading Volume: Trading volume generated by referrals

  • Commission Earned: Total commission earned

Analytics Tools

  • Affiliate Dashboard: Use affiliate dashboard for tracking

  • Custom Analytics: Set up custom analytics

  • UTM Tracking: Use UTM parameters for tracking

  • Conversion Tracking: Track conversion funnels

Commission Structure

Commission Rates

  • Trading Fees: Percentage of trading fees generated

  • Tiered Structure: Higher rates for higher volumes

  • Minimum Thresholds: Minimum thresholds for payouts

  • Payment Schedule: Regular payment schedule

Payment Terms

  • Payment Schedule: Monthly or weekly payments

  • Minimum Payout: Minimum amount for payout

  • Payment Methods: Available payment methods

  • Tax Reporting: Tax reporting requirements

Regulatory Compliance

  • Local Laws: Comply with local laws and regulations

  • Disclosure Requirements: Meet disclosure requirements

  • Tax Obligations: Fulfill tax obligations

  • Terms of Service: Follow platform terms of service

Marketing Compliance

  • Truthful Advertising: Use truthful and accurate advertising

  • Disclosure: Disclose affiliate relationships

  • No Misleading Claims: Avoid misleading claims

  • Respect Users: Respect users and their privacy

Building Your Affiliate Business

Long-term Strategy

  • Brand Building: Build your personal brand

  • Content Creation: Create valuable content

  • Community Building: Build engaged communities

  • Relationship Building: Build relationships with users

Scaling Your Business

  • Team Building: Build a team to help with marketing

  • Automation: Automate marketing processes

  • Partnerships: Form strategic partnerships

  • Diversification: Diversify your marketing channels

Common Mistakes to Avoid

  1. Spam Marketing: Don't spam users with referral links

  2. Misleading Claims: Don't make misleading claims about the platform

  3. Poor User Experience: Don't provide poor user experience

  4. Non-compliance: Don't violate program terms or regulations

  5. Short-term Thinking: Don't focus only on short-term gains

Troubleshooting

Common Issues

Low Conversion Rates

  • Improve your marketing content

  • Better target your audience

  • Provide better user education

  • Optimize your referral process

Low Commission Earnings

  • Focus on quality referrals

  • Help users become more active

  • Provide ongoing support

  • Build long-term relationships

Compliance Issues

  • Review program terms

  • Ensure compliance with regulations

  • Update marketing materials

  • Seek legal advice if needed

Getting Help

  • Discord: Join Polynomial Discord for affiliate discussions

  • Support: Contact affiliate support team

  • Community: Connect with other affiliates

  • Resources: Use available marketing resources


This comprehensive advanced guide covers sophisticated strategies and tools for experienced users. Master the fundamentals before attempting these advanced techniques.

Last updated

Was this helpful?