Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

fix(vendor-finance): fix lender positions after migration #1752

Merged
merged 2 commits into from
Nov 18, 2022

Conversation

Clonescody
Copy link
Contributor

Description

Following the migration to the new template, one part of the integration was failing.
A vendor pool consist of :

  • 2 tokens
  • One lender who only lends out === 1 token in the ContractPosition
  • Borrowers who deposit + borrow === 2 tokens in the ContractPosition

The "lent out" and "borrowed" token is the same, and has to be present with two different status SUPPLIED and BORROWED.

For example a wETH/USDC pool where you can borrow USDC against wETH

If the user querying is the lender ( pool creator/deployer ), the returned balances array is

[
  "0", => wETH deposited
  "0", => USDC borrowed
  lentOutBalance => USDC lent out
]

If he is a borrower

[
  depositedBalance, => wETH deposited
  borrowedBalance, => USDC borrowed
  "0" => USDC lent out
]

Checklist

  • I have followed the Contributing Guidelines
  • (optional) As a contributor, my Ethereum address/ENS is: clonescody.eth
  • (optional) As a contributor, my Twitter handle is: Clonescody

How to test?

AppId vendor-finance

Lender : http://localhost:5001/apps/vendor-finance/balances?addresses%5B%5D=0x38BDa44E85610BB5d737A6ab5CCd09f173b5ecAF&network=arbitrum

Borrower : http://localhost:5001/apps/vendor-finance/balances?addresses%5B%5D=0xcba1a275e2d858ecffaf7a87f606f74b719a8a93&network=arbitrum

@Clonescody Clonescody changed the title fix(vendor-finance); fix lender positions after migration fix(vendor-finance): fix lender positions after migration Nov 18, 2022
Copy link
Contributor

@immasandwich immasandwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for fixing this! Sorry about the regression.

@immasandwich immasandwich merged commit ef42f6e into Zapper-fi:main Nov 18, 2022
@Clonescody Clonescody deleted the fix/vendor-template-migration branch January 21, 2024 09:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants