Pair
The pair smart contract is abstract and inherited by lendgine. They are separated for readability.
Code
Events
Mint
Emitted when liquidity is minted in the pair.
Burn
Emitted when liquidity is burned in the pair.
Swap
Emitted when a swap occurs in the pair.
Errors
InvariantError
Occurs when an account takes an action and the resulting pair balances don't satisfy the invariant.
InsufficientOutputError
Occurs when the output of an actions is 0.
Read-only functions
reserve0
Returns the balance of the token0 reserves held in the automated market maker.
reserve1
Returns the balance of the token1 reserves held in the automated market maker.
totalLiquidity
Returns the total amount of liquidity currently held in the automated market maker.
invariant
Implements the capped power invariant and returns true if the invariant is satisfied by the parameters.
State-changing functions
swap
Swaps tokens. Sends the amounts out to the to
address. A callback is called and data
is passed back.
mint
Mints liquidity. A calback is called and data is passed back.
burn
Burns liquidity.
Last updated