CompliFi
Search…
Permanent Liquidity Pools

Contracts

x5 Leverage Token:

BTCx5-USDC 0xa51110FF610eC9523dacf13F2bB03e05aFCBc624
ETHx5-USDC 0xc5ba71C09cB87eea42AD6047b0786F299e61B9f4
MATICx5-USDC 0xFD4ddD7891E42c3fb2546EDeb1AD6e3461b65bc9
LINKx5-USDC 0x59616AeAB216dD0F1216d32365cAaA86c84664FB
AAVEx5-USDC 0x003364f2af300e8BEbf108B90b03aB21b983deAA
COMPx5-USDC 0x8716637bc05dBAFE19B9C47Fb238095C297405b7
UNIx5-USDC 0xc35A2E2E83391193fD48aCE12F8cC5AC09297Ff5

Covered Call Option:

CallMATIC 0x1fD5Bf3B301539CD34Bd8777540F1b321404Cab7
CallWETH 0x0a9E306327A031e976ab44CF7CC6959Cc1D42d72
CallLINK 0x0970680203b951206CcC58A50602382760Ad3422
CallUNI 0x0d2c9286c01B50B3A66417aD00Ac82Ae0aE9C5ab
CallCOMP 0x5E5d0b44E6e236AAb33DcCa9E03ed450BdB3aE0c
CallAAVE 0xA5629F1B865f00Ac3361b34920eB7BA5db464ac5
Call_WBTC 0xE82c4E2ce680B98fC732283d9b42F1994e2f5c7b

Utility contracts:

DesignatedPoolRegistry 0x900f8fd2904dc4033e0181E7196dE111A9BC1876
PermanentLiquidityPoolView 0xdcef2e1B1b182435d9bdA48E4063a2bf37E03373
RolloverStrategy 0xEfcDCE2d41F35Dfb833D077d6ca9626d69a3C938

Querying LP Tokens Balances Correspoding to a PLP token position

Each Permanent Liquidity Pool (PLP) token serves as a wrapper for regular (fixed maturity) LP tokens, and the proportion of LP tokens to each PLP token varies over time. The script below enables a user to query the number of LP token correspoding to a PLP position.
Requires PLP address and ABI available in CompliFi github repositories; ethers js library is employed to make requests to EVM-compatible blockchain.
1
const COMPLIFI_PLP_ABI = [...]; // CompliFi PLP ABI https://github.com/CompliFi/complifi-amm/blob/master/abis/137/PermanentLiquidityPool.json
2
const COMPLIFI_POOL_ABI = [...]; // CompliFi Pool ABI https://github.com/CompliFi/complifi-amm/blob/master/abis/137/Pool.json
3
const ERC20_ABI = [...]; // Canonical ERC20 ABI
4
const PLP_ADDRESS = '0xa51110FF610eC9523dacf13F2bB03e05aFCBc624'; // BTCx5-USDC
5
const USER_ADDRESS = '...';
6
7
// initializing a plp
8
const plp = new ethers.Contract(PLP_ADDRESS, COMPLIFI_PLP_ABI)
9
10
// getting current designated pool address
11
const designatedPoolAddress = await plp.designatedPool();
12
13
// initializing the designated pool
14
const designatedPool = new ethers.Contract(poolInfo.address, COMPLIFI_POOL_ABI)
15
16
// getting plp user's balance
17
const userPlpBalance = await plp.balanceOf(USER_ADDRESS);
18
19
// getting plp token total sypply
20
const plplTotal = await plp.totalSupply();
21
22
// getting LP token balance of the plp token contract
23
const designatedPoolBalance = await designatedPool.balanceOf(PLP_ADDRESS);
24
25
// calculating lp user's balance
26
const userLpBalance = userPlpBalance * designatedPoolBalance / plplTotal;
Copied!
Last modified 3mo ago