IPoolInternal

Git Source

Inherits: IPosition, IPricing

Errors

Pool__AboveQuoteSize

error Pool__AboveQuoteSize(UD60x18 size, UD60x18 quoteSize);

Pool__AboveMaxSlippage

error Pool__AboveMaxSlippage(uint256 value, uint256 minimum, uint256 maximum);

Pool__ActionNotAuthorized

error Pool__ActionNotAuthorized(address user, address sender, IUserSettings.Action action);

Pool__CostExceedsPayout

error Pool__CostExceedsPayout(UD60x18 cost, UD60x18 payout);

Pool__CostNotAuthorized

error Pool__CostNotAuthorized(UD60x18 costInWrappedNative, UD60x18 authorizedCostInWrappedNative);

Pool__DifferenceOfSizeAndContractDeltaTooLarge

error Pool__DifferenceOfSizeAndContractDeltaTooLarge(UD60x18 diff, UD60x18 size);

Pool__FlashLoanCallbackFailed

error Pool__FlashLoanCallbackFailed();

Pool__FlashLoanNotRepayed

error Pool__FlashLoanNotRepayed();

Pool__InsufficientAskLiquidity

error Pool__InsufficientAskLiquidity();

Pool__InsufficientBidLiquidity

error Pool__InsufficientBidLiquidity();

Pool__InsufficientFunds

error Pool__InsufficientFunds();

Pool__InsufficientLiquidity

error Pool__InsufficientLiquidity();

Pool__InvalidAssetUpdate

error Pool__InvalidAssetUpdate(SD59x18 deltaLongs, SD59x18 deltaShorts);

Pool__InvalidBelowPrice

error Pool__InvalidBelowPrice(UD60x18 price, UD60x18 priceBelow);

Pool__InvalidMonth

error Pool__InvalidMonth(uint256 month);

Pool__InvalidPositionState

error Pool__InvalidPositionState(uint256 balance, uint256 lastDeposit);

Pool__InvalidQuoteOBSignature

error Pool__InvalidQuoteOBSignature();

Pool__InvalidQuoteOBTaker

error Pool__InvalidQuoteOBTaker();

Pool__InvalidRange

error Pool__InvalidRange(UD60x18 lower, UD60x18 upper);

Pool__InvalidReconciliation

error Pool__InvalidReconciliation(uint256 crossings);

Pool__InvalidSize

error Pool__InvalidSize(UD60x18 lower, UD60x18 upper, UD60x18 depositSize);

Pool__InvalidTickPrice

error Pool__InvalidTickPrice();

Pool__InvalidTickUpdate

error Pool__InvalidTickUpdate();

Pool__InvalidTransfer

error Pool__InvalidTransfer();

Pool__NotEnoughTokens

error Pool__NotEnoughTokens(UD60x18 balance, UD60x18 size);

Pool__NotPoolToken

error Pool__NotPoolToken(address token);

Pool__NotWrappedNativeTokenPool

error Pool__NotWrappedNativeTokenPool();

Pool__OperatorNotAuthorized

error Pool__OperatorNotAuthorized(address sender);

Pool__OptionExpired

error Pool__OptionExpired();

Pool__OptionNotExpired

error Pool__OptionNotExpired();

Pool__OutOfBoundsPrice

error Pool__OutOfBoundsPrice(UD60x18 price);

Pool__PositionDoesNotExist

error Pool__PositionDoesNotExist(address owner, uint256 tokenId);

Pool__PositionCantHoldLongAndShort

error Pool__PositionCantHoldLongAndShort(UD60x18 longs, UD60x18 shorts);

Pool__QuoteOBCancelled

error Pool__QuoteOBCancelled();

Pool__QuoteOBExpired

error Pool__QuoteOBExpired();

Pool__QuoteOBOverfilled

error Pool__QuoteOBOverfilled(UD60x18 filledAmount, UD60x18 size, UD60x18 quoteOBSize);

Pool__SettlementFailed

error Pool__SettlementFailed();

Pool__SettlementPriceAlreadyCached

error Pool__SettlementPriceAlreadyCached();

Pool__TickDeltaNotZero

error Pool__TickDeltaNotZero(SD59x18 tickDelta);

Pool__TickNotFound

error Pool__TickNotFound(UD60x18 price);

Pool__TickOutOfRange

error Pool__TickOutOfRange(UD60x18 price);

Pool__TickWidthInvalid

error Pool__TickWidthInvalid(UD60x18 price);

Pool__WithdrawalDelayNotElapsed

error Pool__WithdrawalDelayNotElapsed(uint256 unlockTime);

Pool__ZeroSize

error Pool__ZeroSize();

Structs

Tick

struct Tick {
    SD49x28 delta;
    UD50x28 externalFeeRate;
    SD49x28 longDelta;
    SD49x28 shortDelta;
    uint256 counter;
}

TickWithRates

struct TickWithRates {
    Tick tick;
    UD60x18 price;
    UD50x28 longRate;
    UD50x28 shortRate;
}

QuoteOB

struct QuoteOB {
    address provider;
    address taker;
    UD60x18 price;
    UD60x18 size;
    bool isBuy;
    uint256 deadline;
    uint256 salt;
}

TradeArgsInternal

struct TradeArgsInternal {
    address user;
    address referrer;
    UD60x18 size;
    bool isBuy;
    uint256 premiumLimit;
}

ReferralVarsInternal

struct ReferralVarsInternal {
    UD60x18 totalRebate;
    UD60x18 primaryRebate;
    UD60x18 secondaryRebate;
}

TradeVarsInternal

struct TradeVarsInternal {
    UD60x18 maxSize;
    UD60x18 tradeSize;
    UD50x28 oldMarketPrice;
    UD60x18 totalPremium;
    UD60x18 totalTakerFees;
    UD60x18 totalProtocolFees;
    UD50x28 longDelta;
    UD50x28 shortDelta;
    ReferralVarsInternal referral;
    UD60x18 totalMintBurn;
    UD60x18 offset;
    UD60x18 premiumWithFees;
}

DepositArgsInternal

struct DepositArgsInternal {
    UD60x18 belowLower;
    UD60x18 belowUpper;
    UD60x18 size;
    UD60x18 minMarketPrice;
    UD60x18 maxMarketPrice;
}

WithdrawVarsInternal

struct WithdrawVarsInternal {
    bytes32 pKeyHash;
    uint256 tokenId;
    UD60x18 initialSize;
    UD50x28 liquidityPerTick;
    bool isFullWithdrawal;
    SD49x28 tickDelta;
}

Signature

struct Signature {
    uint8 v;
    bytes32 r;
    bytes32 s;
}

FillQuoteOBArgsInternal

struct FillQuoteOBArgsInternal {
    address user;
    address referrer;
    UD60x18 size;
    Signature signature;
}

PremiumAndFeeInternal

struct PremiumAndFeeInternal {
    UD60x18 totalReferralRebate;
    UD60x18 premium;
    UD60x18 protocolFee;
    UD60x18 premiumTaker;
    ReferralVarsInternal referral;
}

QuoteAMMVarsInternal

struct QuoteAMMVarsInternal {
    UD60x18 liquidity;
    UD60x18 maxSize;
    UD60x18 totalPremium;
    UD60x18 totalTakerFee;
}

SettlePositionVarsInternal

struct SettlePositionVarsInternal {
    bytes32 pKeyHash;
    uint256 tokenId;
    UD60x18 size;
    UD60x18 claimableFees;
    UD60x18 payoff;
    UD60x18 collateral;
}

Enums

InvalidQuoteOBError

enum InvalidQuoteOBError {
    None,
    QuoteOBExpired,
    QuoteOBCancelled,
    QuoteOBOverfilled,
    OutOfBoundsPrice,
    InvalidQuoteOBTaker,
    InvalidQuoteOBSignature,
    InvalidAssetUpdate,
    InsufficientCollateralAllowance,
    InsufficientCollateralBalance,
    InsufficientLongBalance,
    InsufficientShortBalance
}