Fulcrum liquidity check
Monitor the liquidity and check when you can claim back your tokens
Fulcrum is a Defi platform for tokenized margin lending and trading.
Using Fulcrum, you can lend your tokens and earn interests in crypto. Although in principle your tokens can be redeemed any time you want, in practice you need to wait until there is available (non-borrowed) liquidity to claim your loan back. One of the ways you can use HAL is to monitor the liquidity and check when you can claim back your tokens
How does landing work on Fulcrum?
Lending on Fulcrum is powered by iTokens, which are global lending pools. Each asset has a single iToken equivalent (ETH as iETH, DAI has iDAI, etc.), and has an independent interest rate paid to lenders who have deposited funds into the contract. The interest earned is proportional to the amount of iToken held by each lender. iTokens are minted by transferring the underlying asset to the contract, calling mint, and receiving back an equivalent amount of the iToken (ERC20) at the current iToken price. iTokens have an on-chain API to query current "redemption value".
Using Fulcrum you can lend the following tokens, receiving the equivalent iToken:
Token | iToken | Decimals |
wETH | iETH | 18 |
SAI | iSAI | 18 |
DAI | iDAI | 18 |
USDC | iUSDC | 6 |
USDT | iUSDT | 6 |
SUSD | iSUSD | 18 |
WBTC | iWBTC | 8 |
LINK | iLINK | 18 |
ZRX | iZRX | 18 |
REP | iREP | 18 |
KNC | iKNC | 18 |
You can retrieve your original tokens when the balanceOf()
shows there is enough liquidity for that token.
Take a look at this example:
Use HAL to check available liquidity
Using HAL you can create a trigger to check if there is available liquidity to claim your loan back, no coding needed 🤘.
What do you need?
A HAL account 😈
The token address
the iToken address
Let's go!
1. Go to "Contracts triggers" page and create a new trigger
2. in the contract address field, insert the token address (ie. 0xdd974d5c2e2928dea5f71b9825b8b646686bd200
)
0xdd974d5c2e2928dea5f71b9825b8b646686bd200
)3. Select the function balanceOf, insert the iToken address (ie. 0x1cc9567ea2eb740824a45f8026ccf8e46973234d)
, then insert a value
0x1cc9567ea2eb740824a45f8026ccf8e46973234d)
, then insert a value4. Select an action (ie. send an email)
5. Name your trigger, save. Have a beer 🍺and wait 😴
ERC20 tokens usually have 18 decimal digits. So, if you want to check if the total available liquidity is bigger than 1 KNC
, you have to insert 1 000 000 000 000 000 000
.
Using the GraphQL layer
You can create a trigger programmatically using HAL's GraphQL layer. Simply use this mutation:
Last updated