For the complete documentation index, see llms.txt. This page is also available as Markdown.

Admin & Governance

Governance, access control, rate protection, and token factory contracts

These contracts handle protocol governance, access control, and infrastructure. They are primarily relevant to protocol operators rather than integrators.


DefaultCorkController

Address: 0xcCcCcCccCccbC06627F8aad7aAF13fe3a457f779

Governance contract that manages pool creation, fee configuration, pause control, and whitelist management. Only accounts with the appropriate roles can call these functions.

Pool Creation

struct PoolCreationParams {
    Market pool;
    uint256 unwindSwapFeePercentage; // 18 decimals, 1e18 = 1%
    uint256 swapFeePercentage;       // 18 decimals, 1e18 = 1%
    bool isWhitelistEnabled;
}

function createNewPool(PoolCreationParams calldata params) external

Fee Management

function updateSwapFeePercentage(MarketId id, uint256 newSwapFeePercentage) external
function updateUnwindSwapFeePercentage(MarketId id, uint256 newUnwindSwapFeePercentage) external

Fees use 18-decimal precision (1e18 = 1%). Maximum allowed fee is 5e18 (5%).

Pause Control

Per-market pause functions:

Single-market emergency pause/unpause:

All-markets pause:

Pause Queries

Whitelist Management


WhitelistManager

Address: 0xcCccCcCccCC6e38a2772Eb42D2f408eeB89cb0eE

Manages global and per-market access control. An address is considered whitelisted if it is on the global whitelist OR the specific market whitelist.

isWhitelisted is the combined check — returns true if the market's whitelist is disabled (all addresses pass) OR if the account is on the global or market-specific whitelist. Use this for pre-flight checks before deposits.


ConstraintRateAdapter

Address: 0xCCcCcCcccCccEF378949D1a61ED2283C831AF03A

Protects against oracle manipulation by constraining how much the swap rate can change per day and in total. Wraps the rate oracle and applies daily change limits and capacity caps defined in the Market struct.

  • adjustedRate — fetches the oracle rate, applies constraints, and saves the new state. Non-view: this writes constraint state on-chain. Use previewAdjustedRate for read-only access

  • previewAdjustedRate — same computation without writing state (view function)

  • constraints — returns the current constraint state for a market


SharesFactory

Address: 0xcCCCccCCCcCc1782617fe14A386AC910a20D4324

Deploys paired Cork Principal Token (cPT) and Cork Swap Token (cST) contracts when a new pool is created.


PoolShare Tokens (cPT / cST)

Each Cork Pool issues two ERC20 tokens. Both implement standard ERC20 with EIP-2612 Permit support.

Standard ERC20

transfer, approve, balanceOf, totalSupply, allowance, permit — standard interfaces.

Pool-Specific Queries

Convenience Functions

PoolShare tokens also expose all preview* and max* functions from CorkPoolManager as convenience wrappers, allowing you to query pool state directly from the token contract without needing to know the CorkPoolManager address.

Last updated