Divergence Protocol
  • OVERVIEW
    • Divergence Protocol
    • Protocol Basics
      • Digital Options
      • Triangular Swaps
      • Convertible Liquidity
      • Options Specs
      • Fees
      • Glossary
      • References
  • User Guide
    • 📈Long Options
      • 🔥Open Longs
      • 🌊Close Longs
      • 👨‍🌾Exercise Options
    • 📉Short Options
      • 💧Open Shorts
      • 🔚Finalize Shorts
      • 📥Close Shorts
      • ⏰Expiry Withdrawal
    • 🍸Dive Bar
  • Technical Reference
    • Smart Contract Architecture
      • Deployment addresses
    • Core
      • Arena
      • Battle
      • Oracle
      • Utils
      • SToken
      • Interface
      • Libraries
        • DiverSqrtPriceMath
        • Position
        • Tick
        • TickMath
        • TradeMath
      • Params
      • Types
    • Periphery
      • Manager
      • Base
      • Interface
      • Quoter
      • Libraries
      • Params
      • Types
    • Audit Reports
  • DIVER Token
    • 🌝Tokenomics
      • Token Distribution
    • 🎃DIVΞR NFT Collections
  • Legal
    • Terms of Service
    • Risk Disclosure
  • MISC. INFO
    • 🔗Official Links
    • 🙌Media Kit
    • 🚢Ditanic Test Coins
Powered by GitBook
On this page
  • BattleInitializer
  • createAndInitializeBattle
  • LiquidityManagement
  • mintCallback
  • _addLiquidity
  • PeripheryPayments
  • pay

Was this helpful?

  1. Technical Reference
  2. Periphery

Base

Facilitators of core and periphery contracts.

BattleInitializer

createAndInitializeBattle

function createAndInitializeBattle(CreateAndInitBattleParams memory params)  external  override  returns  (address battle)  

Params:

Name

Type

Description

params

CreateAndInitBattleParams

Returns:

Name

Type

Description

battle

address

The address of the created battle contract

LiquidityManagement

mintCallback

Called to msg.sender after minting liquidity to a position

function mintCallback(uint256 amountOwed,  bytes  calldata data)  external  override  

Params:

Name

Type

Description

amountOwed

uint256

The amount of tokens owed for the minted liquidity

data

bytes

Any data passed through by the caller

_addLiquidity

Add liquidity to an initialized pool

function _addLiquidity(AddLiqParams memory params) internal returns (uint128 liquidityAmount, address battleAddr)

Params:

Name

Type

Description

AddLiqParams

params

Returns:

Name

Type

Description

liquidityAmount

uint128

The amount of liquidity to add

battleAddr

address

The address to which an AMM pool is created

PeripheryPayments

pay

Handles the payment of tokens or ETH from one address to another

function pay(address tokenAddr,  address payer,  address recipient,  uint256 value)  internal  

Params:

Name

Type

Description

tokenAddr

address

The address of the token to pay

payer

address

The account that should pay the tokens

recipient

address

The account that should receive the tokens

value

uint256

The amount to pay

PreviousManagerNextInterface

Last updated 1 year ago

Was this helpful?

Parameters for creating and initializing a pool. See

Params required for adding liquidity. See

Params
Params