No funded issue found.
Check out the Issue Explorer
Be the OSS Funding you wish to see in the world.
Looking to fund some work? You can submit a new Funded Issue here .
Time left
Opened
Issue Type
Workers Auto Approve
Project Type
Time Commitment
Experience Level
Permissions
Accepted
Reserved For
Fulcrum-Compound-MakerDAO InstaDapp bridge (revised)
bzxnetwork
Defi, bZx, InstaDapp, Compound, Maker, Fulcrum, Torque
# Prize Bounty
$1,500
# Challenge Description
Recently InstaDapp released its MakerDAO-Compound bridge, allowing users to refinance their MakerDAO loans on Compound at a lower interest rate. There is a strong demand from users of existing lending protocols to have a convenient way of porting their loan to a platform with lower interest rates. Fulcrum lending pools (iTokens) are similar to Compound in that anyone can lock collateral and borrow against them at a variable interest rate.
The objective of this bounty is to modify any necessary InstaDapp contracts or add new ones, to add support for moving loans from either MakerDAO or Compound into or out of Fulcrum. Moving a loan into Fulcrum means locking ETH collateral and borrowing against iDAI. Please develop this against a public Ethereum testnet (Kovan preferred). Ropsten is also an option, but we strongly prefer a Kovan-based implementation.
The fulcrum contracts for iDAI are here:
Kovan iDAI: 0xa1e58f3b1927743393b25f261471e1f2d3d9f0f6
Ropsten iDAI: Please ask for latest
The following describes the function for doing over-collateralized borrows against iDAI. This function expects a minimum amount of collateral be sent
to satisfy collateral requirements of the loan, for borrow amount, interest rate, and initial loan duration.
To determine appropriate values to pass to this function for a given loan, see "getDepositAmountForBorrow" and "getBorrowAmountForDeposit" functions below.
```
// borrowAmount: loan amount to borrow
// Kovan DAI: 0xc4375b7de8af5a38a93548eb8453a498222c4ff2
// leverageAmount: signals the amount of initial margin we will collect
// For the bounty use: 2000000000000000000 for 150% initial margin or 4000000000000000000 for 125% initial margin
// initialLoanDuration: The duration in seconds this loan will last (24 hours is the minimum)
// collateralTokenSent: The amount of collateral to send (specify 0 if sending Ether directly with the transaction)
// borrower: the address the loan will be assigned to (this address can be different than msg.sender)
// Collateral and interest for loan will be withdrawn from msg.sender
// collateralTokenAddress: The token to collateralize the loan in
// For sending Ether directly use "0x0000000000000000000000000000000000000000".
// Kovan WETH: 0xd0a1e359811322d97991e03f863a0c30c2cf029c)
// loanData: Pass "" for now.
// Returns: loanOrderHash
// Note: Loans are identified in the protocol with a combination of "loanOrderHash and "borrower" address
function borrowTokenFromDeposit(
uint256 borrowAmount,
uint256 leverageAmount,
uint256 initialLoanDuration,
uint256 collateralTokenSent,
address borrower,
address collateralTokenAddress,
bytes memory loanData)
public
payable
returns (bytes32 loanOrderHash);
function getDepositAmountForBorrow(
uint256 borrowAmount,
uint256 leverageAmount, // use 2000000000000000000 for 150% initial margin
uint256 initialLoanDuration, // duration in seconds
address collateralTokenAddress) // address(0) means ETH
public
view
returns (uint256 depositAmount);
function getBorrowAmountForDeposit(
uint256 depositAmount,
uint256 leverageAmount, // use 2000000000000000000 for 150% initial margin
uint256 initialLoanDuration, // duration in seconds
address collateralTokenAddress) // address(0) means ETH
public
view
returns (uint256 borrowAmount);
```
For topping up collateral, extending the loan, or closing the loan, you need to call the bZx protocol directly using the
loanOrderHash and borrower address for the loan. The following functions can be used.
Kovan bZx address: 0x9009e85a687b55b5d6C314363C228803fAd32d01
```
// loanOrderHash: Unique hash identifying a loan made by a lender
// borrower: Address of borrower (must == msg.sender)
// payer: Address of wallet paying back the loan (must == msg.sender)
// depositTokenAddress: The address of the collateral token
// depositAmount: The amount of additional collateral to deposit
function depositCollateralForBorrower(
bytes32 loanOrderHash,
address borrower,
address payer,
address depositTokenAddress,
uint256 depositAmount)
public
returns (bool);
// loanOrderHash: Unique hash identifying a loan made by a lender
// borrower: Address of borrower (must == msg.sender)
// payer: Address of wallet paying back the loan (must == msg.sender)
// receiver: Address of wallet receiving the locked collateral
// depositAmount: Amount of additional interest token to deposit to extend the loan
// useCollateral == If True, spend "depositAmount" of collateral to buy additional loan time. If false, deposit "depositAmount".
function extendLoanByInterest(
bytes32 loanOrderHash,
address borrower,
address payer,
uint256 depositAmount,
bool useCollateral)
public
returns (uint256 secondsExtended);
// loanOrderHash: Unique hash identifying a loan made by a lender
// borrower: Address of borrower (must == msg.sender)
// payer: Address of wallet paying back the loan (must == msg.sender)
// receiver: Address of wallet receiving the locked collateral
// closeAmount: Amount of the principal to close
function paybackLoanAndClose(
bytes32 loanOrderHash,
address borrower,
address payer,
address receiver,
uint256 closeAmount)
public
returns (
uint256 actualCloseAmount,
uint256 collateralCloseAmount,
address collateralTokenAddress
);
```
The current InstaDapp Maker-Compound bridge contract is here: https://github.com/InstaDApp/contract-v2/blob/master/contracts/bridges/MakerCompound.sol
# Submission Requirements
The bridge must be fully functional. This submission should culminate in a pull request to the InstaDapp Github repo. It is not required to create a front-end or user interface for the bridge, but if that helps demonstrate the viability of the entry, please do what you must. Please reference the Maker/Compound bridge UI (https://instadapp.io/bridge/) for guidance. The Maker/Compound/Fulcrum bridge will be here once integrated. The InstaDapp team will design the UI.
# Submission Deadline
No deadline. The first entry meeting above requirements wins.
# Judging Criteria
The implementation must be fully functioning. We may consult the InstaDapp team to decide the final winner. The first successful implementation that gets integrated by InstaDapp wins the bounty.
# Winner Announcement Date
TBD
Setup your profile
Tell us a little about you:
Skills
No results found for [[search]] .
Type to search skills..
Bio Required
[[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Next
Setup your profile
Our tools are based on the principles of earn (š°), learn (š), and meet (š¬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Back
Next
Save
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email:
Email
Back
Save