Quick Start
Query Cork Protocol data and simulate operations in minutes
This guide gets you from zero to reading Cork Protocol data and simulating a deposit on a local fork.
Contract Addresses
Cork Phoenix uses deterministic CREATE2 deployment — all addresses are identical across Ethereum mainnet and supported chains.
CorkPoolManager
0xccCCcCcCCccCfAE2Ee43F0E727A8c2969d74B9eC
CorkAdapter
0xCCcCcCCCcccCBaD6F772a511B337d9CCc9570407
WhitelistManager
0xcCccCcCccCC6e38a2772Eb42D2f408eeB89cb0eE
Find an Active Market
Every Cork Pool is identified by a MarketId. Fetch active markets from the API:
curl -s "https://api-phoenix.cork.tech/v1/pools/?chainId=1" | jq '.items[0] | {poolId, poolName, expiry}'This returns a MarketId you can use in the examples below. You can also browse the full list at the API interactive docs.
Query Pool State
No setup required beyond Foundry. Query any pool directly with cast:
# Set your RPC endpoint and a MarketId from the API
export RPC_URL="https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"
export MARKET_ID="0xab4988fb673606b689a98dc06bdb3799c88a1300b6811421cd710aa8f86b702a"
export POOL_MANAGER="0xccCCcCcCCccCfAE2Ee43F0E727A8c2969d74B9eC"
# Get the swap rate (1 REF = rate/1e18 CA)
cast call $POOL_MANAGER \
"swapRate(bytes32)(uint256)" $MARKET_ID \
--rpc-url $RPC_URL
# Get pool balances (collateral, reference)
cast call $POOL_MANAGER \
"assets(bytes32)(uint256,uint256)" $MARKET_ID \
--rpc-url $RPC_URL
# Get cPT and cST token addresses
cast call $POOL_MANAGER \
"shares(bytes32)(address,address)" $MARKET_ID \
--rpc-url $RPC_URLInstall dependencies:
Create query-cork.ts:
Run it:
Simulate a Deposit
Fork mainnet locally and simulate a deposit without using real tokens.
Production Integration
Solidity integrators: Add Cork as a Foundry dependency:
Then import interfaces directly:
TypeScript integrators: Use viem with the ABI snippets shown above, or install the published package:
Key Gotchas
Next Steps
CorkAdapter — slippage-protected write operations for production use
CorkPoolManager — full query and operation reference
API Reference — historical data, market discovery, and limit orders
Last updated