Comment on page
Liquidity Mining Pool
There are three liquidity pool contracts for APY.Finance. Each contract handles a specific currency and issues its own APT token to represent a user’s stake in the pool. There is a contract for DAI, USDC, and USDT. These contracts are orchestrated by the APY manager to act as a single pool.
The liquidity pool contracts use a proxy pattern for upgradeability. Transactions are sent to the proxy contract address, but the functions they call are from the implementation contract.
Each pool contract is also an ERC-20 token with 18 decimals and the symbol “APT”. The contract is called
APYPoolToken
.All of the following examples will use web3.js and the DAI liquidity pool contract.
The transaction sender must first approve the pool proxy contract to transfer their deposit tokens:
await daiToken.methods.approve(daiPoolToken.address, daiBalance);
Then the sender must call the
addLiquidity
function on the pool contract with the amount of tokens they wish to deposit:await daiPoolToken.methods.addLiquidity(daiBalance);
The transaction sender must first approve the pool proxy contract to transfer their APT tokens:
await daiAptToken.methods.approve(
daiPoolToken.address,
daiAptBalance
);
APT represents a share of the pool. The total supply of APT represents the total amount of stablecoin deposited in the pool contract.
Then the sender must call the
redeem
function on the pool contract with the amount of APT the wish to redeem:await daiPoolToken.redeem(daiAptBalance);
Redeeming the entire balance of APT will withdraw the sender’s entire deposit.
Contract | Address |
DAI Liquidity | 0x75CE0E501e2E6776FcAAa514f394a88a772A8970 |
USDC Liquidity | 0xe18b0365D5D09F394f84eE56ed29DD2d8D6Fba5f |
USDT Liquidity | 0xeA9c5a2717D5Ab75afaAC340151e73a7e37d99A7 |
Contract | Address |
DAI Liquidity | 0xf587EC50e2E6518F7f016d5A78561109Ab96FEa1 |
USDC Liquidity | 0xA138299A1BB17e90F2edCc2d567358C4BEeCa092 |
USDT Liquidity | 0x80073EeF3C57Ba05dC25E5cD5b78C5f9fb18e4D8 |
Last modified 3yr ago