Orally Price Feed Integration Guide
Overview
The Orally Price Feed system provides real-time price data from 9 centralized exchanges, secured through ICP canister's trusted execution environment and verified on-chain through ECDSA signatures. This guide explains the integration process and operation flow.
Initial Setup
Generate API Key
Follow the API key generation process
Store the key securely for subsequent requests
Integration Process
Regular Price Monitoring
Your liquidation bot should monitor prices using the following flow:
Regular Price Checks
Endpoint:
get_xrc_data
orget_xrc_data_batch
Cost: $0.001 per request
Include:
API key
Cache TTL (default 600 seconds)
Target token pair ID
Response: Current price feed without proof
Price Update Verification
When price changes require on-chain updates:
Request Signed Data
Endpoint:
get_xrc_data_with_proof
Cost: $0.04 per request
Returns: Price data with ECDSA signature from ICP canister
On-Chain Verification
Submit signed data to Partisia chain
Smart contract verifies:
ECDSA signature authenticity
Signer authorization
Data integrity
After verification, data is decoded and available for use
Technical Details
Proof Generation
ICP canister aggregates price data from exchanges
Data is encoded into a standardized format
Canister generates ECDSA signature using its DKG key
Returns packed data: {price_data, metadata, signature}
Verification Process
Smart contract unpacks the provided data
Verifies ECDSA signature against authorized signer list
Decodes price data for use in smart contract operations
Cost Structure
Regular price checks: $0.001 per request
Recommended for continuous monitoring
Use cache_ttl to optimize costs
Signed data requests: $0.04 per request
Only needed when updating on-chain values
Includes proof generation and ICP canister operations
Best Practices
Optimize Batch Requests
Use
get_xrc_data_batch
instead of multiple single requests:Group related price feed queries into a single batch request
Example: Query all tokens in a lending pool in one call
Reduces total API calls and associated costs
Improves overall response time
Cache TTL Optimization
Regular Price Monitoring:
Use longer cache_ttl (e.g., 600-1800 seconds) for stable pairs
Shorter cache_ttl (60-300 seconds) for volatile pairs
Proof Generation:
Use the same cache_ttl as for monitoring requests when requesting proofs
Ensures fresh data for on-chain updates
Balance between data freshness and cost efficiency
Regular monitoring flow
Last updated