You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to calculate how much of the specified token user needs to borrow from our pools to open desired position.
For example, user comes with 1 ETH with a price of 1000 USD (Obtained through Pragma oracle). They want to leverage it to x5 amount through our STRK pool(let be 1 STRK 2 USDC).
In that case, we need to give him 4 more ETH. We calculate required amount in USD, in our case user will need 2000 * 10**18 STRK(4000 USD * 10**8 / 2 USD * 10**8).
Add a get_borrow_amount(self, initial_token, debt_token, amount, multiplier) internal function.
Calculate USD equivalent amount of initial_token.
Calculate how much in USD user needs to borrow from us.
Calculate amount of debt token.
Write tests for internal contract state and docstring
The text was updated successfully, but these errors were encountered:
Hi, gm gm, my name is wisdom and i am a smart contract developer. may i handle this task. i will deliver in less than 48hrs
i like pineapple
telegram handle: Enyinnaya wisdom
hi, @djeck1432 . Its Anushka here and I like Pineapple. I'm an experienced DApp developer. I also have recently won at Agentic ethereum where my work also involved writing and testing smart contracts. I would love to give this issue a go.
telegram : any0138
ETA: 7 hours
I will implement the get_borrow_amount internal function to calculate the required debt token amount based on USD value, ensuring accurate leverage computation. I will also write tests and documentation.
You need to calculate how much of the specified token user needs to borrow from our pools to open desired position.
For example, user comes with 1 ETH with a price of 1000 USD (Obtained through Pragma oracle). They want to leverage it to x5 amount through our STRK pool(let be 1 STRK 2 USDC).
In that case, we need to give him 4 more ETH. We calculate required amount in USD, in our case user will need
2000 * 10**18 STRK
(4000 USD * 10**8 / 2 USD * 10**8
).get_borrow_amount(self, initial_token, debt_token, amount, multiplier)
internal function.USD
equivalent amount ofinitial_token
.The text was updated successfully, but these errors were encountered: