Skip to content

Protocol

sam bacha edited this page Jul 25, 2024 · 3 revisions

Captive Insurance

Captive insurance is a form of self-insurance where an entity creates a wholly-owned subsidiary to provide insurance for itself. This subsidiary, known as a "captive insurer," underwrites the risk of its parent company. Captive insurance allows the parent company to retain premiums and control the risk management process.

Due to the underlying nature of the risk, typical insurance/re-insurance carriers will not provide coverage for this type of risk.

Funding

  • The parent entity provides capital to the captive insurer.
  • The captive insurer collects premiums from the parent entity.

Coverage

  • The captive insurer provides coverage for the parent entity's risks.
  • Claims are processed and paid by the captive insurer.

Note

This is for v1 of the XGA Auction, v2 Will support multiple relays/sequencers and have an extended re-insurance mechanism.

Underwriting Stakers

Depositing into the FoldCaptiveStaking contract enables you to underwrite the risk of missing out on blocks due to service outages of the Manifold Finance Relay. This provides a financial safety net for validators connected to the Manifold Finance Relay.

Automated Compounding of Accrued Fees: The contract automates the compounding of deposits' accrued fees. This incentivizes a maximum number of compounds at optimal times with regards to gas costs, enhancing the efficiency of capital utilization.

Rewards for Staking: In addition to swap fees from liquidity provision on Uniswap V3, LPs (Liquidity Providers) are rewarded for staking their FOLD tokens in the contract. This serves as an additional incentive for liquidity providers to stake their tokens.

Protocol Overview: Validators connected to the Manifold relay can only connect to this relay for the XGA Auction. If the relay experiences an outage, Manifold covers the cost of lost opportunities for validators.

Risk Underwriting Stakers in the FOLDstaking.sol contract underwrite the risk of missing out on blocks, functioning as a form of captive insurance. The contract tracks the duration of each deposit and rewards depositors individually.

Staking Mechanism

Staking $FOLD tokens transfers LP deposit ownership to the FOLDstaking contract. The contract owners can claim $FOLD balances permanently for insurance claims through the claimInsurance function.

Important

Fees earned are retained into a indemnity fund that first pays out. In the event that the losses exceed the assets in the fund, it is only then that a claim can be made against the Vault.

Primary Incentives

By underwriting the service risk of the Manifold Finance Relay and XGA Auction Platform, stakers earn yield in $ETH. $FOLD is not the reward token paid to stakers.

Secondary Incentives:

LPs receive rewards for staking, which includes swap fees and automated compounding of accrued fees. This incentivizes optimal compounding times concerning gas costs.

Deposit Structure

Multiple V3 positions can be deposited. The reward amount is determined by the duration and share of the total liquidity deposited in the vault, paid from the contract's WETH balance.

Withdrawal Process:

Withdrawals, after initiation, are pro-rated over 14 days if they exceed a certain percentage of the pool's total liquidity.

Materials and Methods: To understand attracting stable liquidity, existing works like have been surveyed. Their

Reward Calculation

Rewards are calculated without considering the entire stake duration, instead looping through each week. Claiming rewards or removing liquidity resets the deposit's timestamp, reducing total rewards.

The reward calculation formula is as follows:

(position stake / total staked) x (stake duration / average stake duration)

Note

The Average stake duration is factored in, following the "sunshine & rainbow" design doc from Pangolin Exchange's SAR Mechanism.

Depositor Autonomy

Depositors can choose the price range (ticks) for their UNIv3 NFT by creating it externally and calling the deposit function with DepositParams. A vote affects deposits of stakers with no personal preference, using a time-weighted median for the price range.

Fee Handling

Uniswap automatically handles fee collection and redepositing, enhancing LP earnings. Bunni's compound function increases the value of share tokens, while FOLDstaking.sol rewards are based on deposit duration and total size across all price ranges.

Comparison with Bunni

Bunni pays rewards pro rata to the contribution per price range, while FOLDstaking.sol pays rewards based on deposit duration and total size relative to the pool's total liquidity across all price ranges.

We thank @ZeframLou for his tireless work on improving mechanism design in the industry.

High level overview

sequenceDiagram
    participant User
    participant Contract as FoldCaptiveStaking Contract
    participant Uniswap as Uniswap V3

    Note over User,Uniswap: Process for Managing FOLD Token Liquidity

    User->>Contract: Deposit FOLD Tokens

    activate Contract
    Contract->>Uniswap: Provide Liquidity
    Uniswap-->>Contract: Swap Fees + Rewards
    deactivate Contract

    loop Automated Compounding
        Contract->>Contract: Compound Accrued Fees
    end

    User->>Contract: Request Withdrawal
    activate Contract
    Note over Contract: 14 Day Period
    Contract-->>User: Return FOLD Tokens + Rewards
    deactivate Contract
Loading

Claims Process

Currently, claimInsurance does not have the logic necessary to 'validate' a claim. This is because the management of captive insurance claims is handled by us, which is why it is called Captive Insurance.

Until the L2 Construct is implemented for v2 supporting multiple relays, this is fine. However, we should outline and document how exactly a claim is substantiated. Typically, the insured party must provide notice to their insurance carrier for potential claims. Therefore, it is up to the underlying LST/Validator/Node Operator to initiate this process, it is not up to us to initialize the process for paying out a claim.

sequenceDiagram
    participant User as LP (Liquidity Provider)
    participant Contract as FoldCaptiveStaking Contract
    participant Insurance as Insurance Claim Function

    User->>Contract: Stake FOLD Tokens
    Note over User,Contract: Tokens are staked for liquidity and rewards

    Contract->>Contract: Automate Compounding
    Note over Contract: Accrued fees are compounded

    User->>Insurance: Initiate Claim
    Note over Insurance: Due to service outage or other covered event

    Insurance->>Contract: Verify Claim
    Note over Contract: Check if claim is valid based on contract rules

    Contract->>User: Calculate Claim Amount
    Note over User: Based on staked amount and contract terms

    Contract->>User: Pay Claim from Deposits
    Note over User: WETH balance or equivalent is used

    User->>Contract: Close Claim
    Note over Contract,User: Claim is marked as resolved
Loading