Product Types and Specification
Product types
The AFP introduces a new suite of derivatives products that are not limited to spot underlyings. This means that products can be created on any verifiable timeseries, opening up the possibility for a completely new suite of financial products. Examples of such products are near infinite, as if a timeseries can be reliable reported, then a product can be created for it on the AFP. However, product creation is only the beginning as it is in then in the best interest of the Product Builder to create deep liquidity in their products, as they share in the clearing volume of deployed products.
In the current version of the AFP, all products are Dated Futures, meaning they have an expiry time and a final settlement price that the product will clear at once the Minimum Tradeout Interval
elapses. This implies that the only value that is required to be reported on-chain by an oracle, is the final settlement price.
Subsequent versions of the AFP will allow for additional types of products to be created such as perpetuals, and more.
Product Specification for Dated Futures
A Product Builder must pay careful attention to how a new product is specified, as once a product is registered in the AFP, its specification is immutable.
To submit a product registration to the AFP the following function on the ProductRegistry.sol
contract must be called:
function register(Product calldata product) external
Where the structure of the specification for a product that needs to be submitted is:
Product
Structure
struct Product {
ProductMetadata metadata;
OracleSpecification oracleSpec;
string priceQuotation;
address collateralAsset;
uint startTime;
uint earliestFSPSubmissionTime;
uint unitValue;
uint16 initialMarginRequirement;
uint16 maintenanceMarginRequirement;
uint64 offerPriceBuffer;
uint64 auctionBounty;
uint32 tradeoutInterval;
uint8 tickSize;
string extendedMetadata;
}
- metadata - the metadata associated with the product
- oracleSpec - the oracle specification for the product
- priceQuotation - the symbol of the price quotation
- collateralAsset - the address of the ERC20 collateral asset
- startTime - the start time of the product when it transitions to a
LIVE
state - earliestFSPSubmissionTime - the earliest time to submit the final settlement price
- unitValue - the point value of the product which defines
- initialMarginRequirement - the initial margin requirement for the product
- maintenanceMarginRequirement - the maintenance margin requirement for the product
- offerPriceBuffer - the buffer for the offer price
- auctionBounty - the bounty for a liquidation auction initiator
- tradeoutInterval - the interval for tradeout
- tickSize - the maximum precision of the price quotation
- extendedMetadata - CID of product extended metadata using the IPLD dag-json codec
ProductMetadata
Structure
struct ProductMetadata {
address builder;
string symbol;
string description;
}
- builder - the address of the product creator
- symbol - the symbol for this product
- description - the description of the product
OracleSpecification
Structure
struct OracleSpecification {
address oracleAddress;
uint8 fsvDecimals;
int fspAlpha;
int fspBeta;
bytes fsvCalldata;
}
- oracleAddress - the address of the oracle contract
- fsvDecimals - the precision of the price quotation from oracleAddress.resolve
- fspAlpha - the alpha value for the oracle, used in price calculations fsp = alpha * oraclePrice + beta
- fspBeta - the beta value for the oracle, used in price calculations fsp = alpha * oraclePrice + beta
- fsvCalldata - the calldata to be used for final settlement price (FSP) calculation
Example Product Specification
The example specification below relates to a US Initial Jobless Claims product.
{
"metadata": {
"builder": "0x4081e70aeb2dC6A8ECeBe067225a09dE1AfFCa3b",
"symbol": "CLAIMS27W25",
"description": "US Initial Jobless Claims"
},
"oracleSpec": {
"oracleAddress": "0xF3FA1f6fe52604EFf85B438B01B8b984AA200651",
"precision": 0,
"alpha": "1000000000000000",
"beta": "0",
"fspCalldata": "0x"
},
"priceQuotation": "USDCx",
"collateralAsset": "0xB855D5e83363A4494e09f0Bb3152A70d3f161940",
"startTime": "1751633100",
"earliestFSPSubmissionTime": "1752151500",
"unitValue": "1000000",
"initialMarginRequirement": 1500,
"maintenanceMarginRequirement": 1000,
"offerPriceBuffer": "150",
"auctionBounty": "50",
"tradeoutInterval": 3600,
"tickSize": 1,
"extendedMetadata": "bafyreicyvc7lwzr4u26zz4tlfcjaq4rt72c3hhltxulh4fz3xaaozohg4m",
"collateralAssetDecimals": 6,
}