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:
Maintain perpetual futures price alignment with the underlying asset
Balance long and short positions in the market
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
Continuous Adjustment: Funding rates evolve smoothly rather than jumping at fixed intervals
Market Memory: The system maintains memory of previous imbalances
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:
Immediate price impact: Premium for long skew, discount for short skew
Ongoing funding payments: Continuous funding rate velocity adjustments
Risk management: Creates soft limits on maximum exposure without restrictive OI limits
Funding Rate Arbitrage Guide
Basic Arbitrage Strategy
Identify Opportunity
Monitor funding rates across exchanges
Look for significant rate differentials
Check liquidity on both venues
Position Setup
Short on the high funding rate venue (Polynomial)
Long on the low funding rate venue
Maintain equal position sizes for delta neutrality
Capital Requirements
Required Margin = Position Size × Max(Margin_Rate_A, Margin_Rate_B) Buffer Margin = Required Margin × 0.3 (recommended 30% buffer)
Advanced Implementation
Entry Execution
Use limit orders to minimize slippage
Enter positions when funding rate differential exceeds transaction costs
Consider gas costs on both venues
Position Monitoring
Track funding payments
Monitor price deviation between venues
Watch for changes in funding rates
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:
Capital Efficiency
Single margin pool for all positions
Reduced total margin requirements
Better leverage utilization
Risk Management
Portfolio-wide liquidation pricing
Unified collateral management
Simplified position tracking
Risk Management
Key Risks
Exchange Risk
Counterparty risk
Platform downtime
Oracle failures
Market Risks
Price deviation between venues
Sudden funding rate changes
Liquidity gaps
Operational Risks
Network congestion
Smart contract risk
Implementation errors
Risk Mitigation Strategies
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
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:
Smoother rate transitions
More predictable arbitrage opportunities
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:
Understanding of the continuous funding mechanism
Proper risk management
Efficient execution
Constant monitoring
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 to1
for latest price updates and2
for price snapshotsstalenessTolerance
: Maximum time in seconds (max 60 for most actions)priceIds
: List of price IDs that the keeper is responsible forupdateData
: 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
PerpsMarketProxy
: 0xD052Fa8b2af8Ed81C764D5d81cCf2725B2148688PythERC7412Wrapper
: 0x4a2755b2F675218b55364E1f5928A59ea9c4616dTrustedMulticallForwarder
: 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e
Getting Started
Prerequisites
ETH on Polynomial Chain for gas fees
Understanding of Pyth oracle system
Basic knowledge of smart contract interactions
Setup Steps
Get ETH: Use refuel.exchange to get ETH on Polynomial Chain
Monitor Events: Set up event monitoring for
OrderCommitted
eventsPrice Updates: Implement Pyth price update fetching
Order Settlement: Implement order settlement logic
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
Configure Webhook URL: Set up your webhook endpoint
Select Events: Choose which events to receive
Test Integration: Test webhook delivery
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
Read Terms: Review affiliate program terms and conditions
Understand Requirements: Understand program requirements
Check Eligibility: Verify you meet eligibility criteria
Review Commission Structure: Understand commission rates
Step 2: Apply for Affiliate Status
Contact Team: Reach out to the Polynomial team
Provide Information: Share your background and experience
Explain Strategy: Describe your referral strategy
Wait for Approval: Wait for application approval
Step 3: Get Your Referral Links
Receive Links: Get your unique referral links
Test Links: Test links to ensure they work
Customize Links: Customize links for different campaigns
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
Paid Advertising
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
Compliance and Legal
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
Spam Marketing: Don't spam users with referral links
Misleading Claims: Don't make misleading claims about the platform
Poor User Experience: Don't provide poor user experience
Non-compliance: Don't violate program terms or regulations
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
Related Topics
Understanding Funding Velocity - Deep dive into funding mechanics
Cross-Margin Trading - Learn about cross-margin benefits
Debt Mechanism - Understand risk management
API Documentation - Access trading APIs for automation
Contract Addresses - Get contract addresses
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?