PowerMaker
  • PowerMaker Document Hub
  • Disclaimer
  • Resources
  • Quick Start
    • FAQ
    • Providing Liquidity
    • Tutorial: Perform a Trade
    • Tutorial: Providing Liquidity
    • Tutorial: Create a Market
  • Concepts
    • Power Perpetuals
      • PPT - Power Perpetual Token
    • Example Use Cases
      • Hedging Uniswap V3
  • Protocol
    • Overview
    • Capped Power Invariant
    • Understanding Returns
    • Security
    • Protocol Participants
    • Smart Contracts
      • Factory
      • Pair
      • ImmutableState
      • JumpRate
      • Lendgine
      • LendgineRouter
      • LiquidityManager
    • Deployed Contracts
  • Discord
  • Twitter
  • Github
Powered by GitBook
On this page
  • Code
  • Events
  • Mint
  • Burn
  • Errors
  • LivelinessError
  • ValidationError
  • AmountError
  • Read-only functions
  • factory
  • uniswapV2Factory
  • uniswapV3Factory
  • weth
  • State-changing functions
  • mint
  • burn
  1. Protocol
  2. Smart Contracts

LendgineRouter

PreviousLendgineNextLiquidityManager

Last updated 1 year ago

Code

Events

Mint

event Mint(address indexed from, address indexed lendgine, uint256 collateral, uint256 shares, address indexed to);

Emitted when a power perpetual token (PPT) is minted using this router.

Burn

event Burn(address indexed from, address indexed lendgine, uint256 collateral, uint256 shares, address indexed to);

Emitted when a PPT is burned using this router.

Errors

LivelinessError

error LivelinessError();

Occurs when a transaction is processed later than the deadline specified.

ValidationError

error ValidationError();

Occurs when a callback invocation is not valid because it is not called by a lendgine deployed by the PowerMaker factory.

AmountError

error AmountError();

Occurs when output amounts aren't sufficient according to the specified minimums.

Read-only functions

factory

function factory() external view returns (address);

Returns the address of the PowerMaker factory this router is connected to.

uniswapV2Factory

function uniswapV2Factory() external view returns (address);

Returns the address of the UniswapV2 factory this router is connected to.

uniswapV3Factory

function uniswapV3Factory() external view returns (address);

Returns the address of the UniswapV3 factory this router is connected to.

weth

function weth() external view returns (address);

Returns the address of the Wrapped Ether contract.

State-changing functions

mint

function mint(MintParams calldata params) external payable returns(uint256 shares);

Mints power perpetual tokens (PPT) with safety checks and obtains maximum leverage by swapping on an external market.

burn

function burn(BurnParams calldata params) external payable returns (uint256 amount);

Burns PPT with safety checks. Mints the required liquidity that is to be paid back and then unlocks the remaining collateral.

LendgineRouter.sol