Questions tagged [curve]
The curve tag has no usage guidance.
15
questions
2
votes
1
answer
19
views
How does Curve Finance `_checkpoint` works? Especially the for loop
The code is converted to solidity but why it was implemented this way.
function _checkpoint(
uint _tokenId,
LockedBalance memory old_locked,
LockedBalance memory new_locked
...
0
votes
0
answers
43
views
Fail to swap USDT to WETH in curve pool
I want to swap my USDT to WETH in curve pool: [USDT, wBTC, WETH].
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.8.10;
import "forge-std/Test.sol";
contract ContractTest is Test ...
2
votes
0
answers
48
views
Calling Curve smart contracts with eth_call gives unexpected results
I came across a strange response of eth_call. I made a request to Curve pool smart contract calling get_dy(int128,int128,uint256) function:
curl your endpoint -X POST -H "Content-Type: ...
4
votes
1
answer
198
views
How can I use BLS12-381 curve operations:EIP-2537, Whether it's on a public or private chain
Recently I have been doing an experiment to sign smart contracts with bls12-381, but I can't find any tutorial or code for this, Is there any way to do that? please tell me if you know about it.
1
vote
1
answer
779
views
EvmError: Revert Foundry
Can anyone help me with a foundry test?
I don't know the functions when called from the test are working but for some reason, it's not when I'm importing the contract from the src the test reverting.
...
1
vote
0
answers
60
views
Get number of tokens in a curve pool
Is it possible to determine the number of tokens used in a Curve pool from a contract? Curve pools typically have a constant N_COINS in the contract, but since it's not public, it can't be read. Are ...
1
vote
0
answers
79
views
How can we get the result of swap in curve.fi like `getAmountsOut` for uniswapV2
I'm trying to get the price for the swap WETH->DAI by calling get_dy but there is no direct pool in curve. I went to the UI & put in this swap & got this. tricypto: WETH -> USDT -> ...
1
vote
0
answers
21
views
Implementing vote escrow with multiple positions and non-linear decay
I want to do vote escrow. I know that Curve is the most popular implementation. My problem with it is I want to allow multiple positions and a non-linear decay.
I'd like to not write from scratch. ...
0
votes
1
answer
187
views
add liquidity to a curve pool
I am working on adding liquidity to a curve pool in Foundry in order to test the curve pool oracle in my project, however, I'm getting some difficulty in adding liquidity to a curve pool. I believe ...
1
vote
0
answers
24
views
How does Curve's economic model sustain itself despite such low trading fees?
I've been providing LP on Curve's stETH/ETH pool for some time now, but I'm finding the trading fee rewards to be somewhat disappointing. This led me to wonder about the long-term sustainability of ...
2
votes
1
answer
100
views
What happens on curves VotingEscrow contract after 5 years?
I am studying the Voting Escrow contract and im looking to incorporate it in a project im building.
In the _checkpoint function , there is this for loop:
t_i: uint256 = (last_checkpoint / WEEK) * ...
0
votes
1
answer
265
views
How to express a negative power in Solidity?
Trying to express y=2^x where x is a negative number. As Solidity does not support negative powers, is there another way to express this?
Thanks for any tips!
We are trying to create a decay formula
3
votes
2
answers
591
views
Curve Voting Escrow Explanations
Curve Voting Escrow has gradually become the de facto approach for DeFi projects of gaining, decaying and consuming voting power through the functions on their smart contract. The original contract ...
1
vote
0
answers
195
views
Is there a github repo for swapping tokens on curve.fi in solidity?
I'm trying to create a contract that will programatically exchange tokens on curve.fi but since their whole app is written in vyper I have no idea how.
Is there some kind of resource like a github ...
2
votes
2
answers
408
views
Curve AMM - How is fee calculated when adding liquidity?
When adding liquidity to Curve AMM, fees are calculated by the following code
_fee: uint256 = self.fee * N_COINS / (4 * (N_COINS - 1))
https://github.com/curvefi/curve-contract/blob/...