Questions tagged [curve]
The curve tag has no summary.
15 questions
3 votes
0 answers
66 views
How the the G₂ extension curve was computed for EIP‒197?
The G1 curve is simply the normal altbn128 which means Y2=X3+3 having order q=21888242871839275222246405745257275088548364400416034343698204186575808495617 But the specification create an other curve ...
2 votes
1 answer
66 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 ...
2 votes
0 answers
72 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
544 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
1k 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
72 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
110 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
1 answer
70 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
933 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
44 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
129 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
334 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
4 votes
3 answers
819 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
217 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
533 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/...