Mintevent is emitted any time liquidity tokens are created via the
mintfunction. In other words, when a user adds liquidity to a pair, then they will receive LP tokens, therefore the
Mintevent will be emitted.
Burnevent is emitted any time liquidity tokens are burned via the
burnfunction. In other words, when a user removes liquidity from a pair, their LP tokens will be burned, therefore the
Burnevent will be emitted.
Swapevent is emitted any time the
swapfunction is used. Under the hood, all trades on uTrade V2 are swaps. Therefore, any time somebody trades on the pair, the uTrade contract for that pair will emit a
Syncevent is emitted anytime a function occurs that may change the reserves of a token pair. In other words, anytime the amount of the two tokens within a liquidity pool may change. Therefore, whenever a
syncfunction is called, the
Syncevent will be emitted.
MINIMUM_LIQUIDITYfunction will always return 1000. The function itself refers to the burning of initial LP tokens that occurs once when a pool is created. This burn of a tiny amount allows for cleaner LP token numbers therefore avoiding LP tokens being represented as very small decimals value. This allows the tick size to be more precise and prevents rounding errors.
factoryfunction will return the current factory address for uTrade V2.
token0function will return the contract address of the first token that makes up the liquidity pair. In other words, if the liquidity pool is made up of USDT.t / WBTT, it will return the contract address of USDT.t.
token1function will return the contract address of the first token that makes up the liquidity pair. In other words, if the liquidity pool is made up of USDT.t / WBTT, it will return the contract address of WBTT.
getReservesfunction returns the reserves of the two tokens that make up the liquidity pool as reserve0 and reserve1. These two values can be helpful in determining the current price of each asset. The function also returns a timestamp with the block number.
price0CumulativeLastfunction is for Oracle usage on uTrade V2. The value of token0 is captured at the end of each block, and can be called using this function to feed into an Oracle to determine a more time-weighted 'average' price.
price1CumulativeLastfunction is for Oracle usage on uTrade V2. The value of token1 is captured at the end of each block, and can be called using this function to feed into an Oracle to determine a more time-weighted 'average' price.
kLastfunction returns the value of reserve0 * reserve1, after any event that may have triggered a change in the liquidity. For example, the execution of a swap function or a mint function.
mintfunction creates the LP tokens that represent a user's tokens in a liquidity pool. For example, if a user provides 1,000,000 BTT and 10 USDT.t liquidity to a pool, the Unifi Pair Smart Contract will mint an amount of uBTTUSDT.t tokens. Will emit the
burnfunction destroys the LP tokens that represent a user's token in a liquidity pool. For example, if a user removes 1,000,000 BTT and 10 USDT.t liquidity to a pool, the Unifi Pair Smart Contract will burn an amount of uBTTUSDT.t tokens. Will emit the
claimUPfunction claims any UP earned from providing liquidity if any exists, and sends the UP to the address provided.
swapfunction exchanges one token for another. Under the hood, all trades on uTrade V2 use this function. The calldata must be 0 during a normal swap, but must contain data if executing a flash loan. Emits the
skimfunction operates as a safeguard if the amount of tokens causes a data error due to too large of a number in the reserves pools. In this unusual circumstance, this will trigger failures in trades. The
skimfunction can be called to return the overflowed tokens to the caller.
syncfunction operates as a safeguard in certain events where the token balance changes outside of normal trading. An example would be an algorithmic stablecoin re-balancing, therefore lowering or raising the amount of the algorithmic stablecoin in the pool. The
syncfunction may be called to reset the price ratio to the new reserves. Emits the