Mean Finance
Search…
Available Reserves
Once you have a pair's address, you can check how much is available for borrowing. You can do it by calling the pair's availableToBorrow.
1
pragma solidity 0.8.6;
2
3
import '@mean-finance/dca-v1/contracts/interfaces/IDCAPair.sol';
4
5
contract MyContract {
6
7
IDCAPair public immutable pair;
8
9
constructor(IDCAPair _pair) {
10
pair = _pair;
11
}
12
13
/// @notice Returns the how much is available for borrowing in a given pair
14
/// @return _amountToBorrowTokenA How much is available for borrowing in token A
15
/// @return _amountToBorrowTokenB How much is available for borrowing in token B
16
function availableToBorrow() external view returns (uint256 _amountToBorrowTokenA, uint256 _amountToBorrowTokenB) {
17
(_amountToBorrowTokenA, _amountToBorrowTokenB) = pair.availableToBorrow();
18
}
19
}
Copied!
Last modified 2mo ago
Copy link