@@ -16,13 +16,10 @@ import (
1616)
1717
1818var (
19- entityPool , eP2 entity.Pool
20- _ = json .Unmarshal ([]byte (`{"address":"0xc4ce391d82d164c166df9c8336ddf84206b2f812","exchange":"balancer-v3-stable","type":"balancer-v3-stable","timestamp":1751293016,"reserves":["687804073931103275644","1783969556654743519024"],"tokens":[{"address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"},{"address":"0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0"}],"extra":"{\"hook\":{},\"fee\":\"20000000000000\",\"aggrFee\":\"500000000000000000\",\"balsE18\":[\"694069210892948295209\",\"2124492373418339554414\"],\"decs\":[\"1\",\"1\"],\"rates\":[\"1009108897721464489\",\"1190879275654308905\"],\"buffs\":[{\"dRate\":[\"976255\",\"976255817341\",\"976255817341645373\",\"976255817341645373456045\",\"976255817341645373456045753577\"],\"rRate\":[\"1024321\",\"1024321681096\",\"1024321681096877127\",\"1024321681096877127977750\",\"1024321681096877127977750950000\"]},{\"dRate\":[\"996629\",\"996629442697\",\"996629442697471179\",\"996629442697471179789157\",\"996629442697471179789157582365\"],\"rRate\":[\"1003381\",\"1003381956380\",\"1003381956380303285\",\"1003381956380303285385258\",\"1003381956380303285385258382000\"]}],\"surge\":{},\"ampParam\":\"5000000\"}","staticExtra":"{\"buffs\":[\"0x0fe906e030a44ef24ca8c7dc7b7c53a6c4f00ce9\",\"0x775f661b0bd1739349b9a2a3ef60be277c5d2d29\"]}","blockNumber":22817774}` ),
19+ entityPool entity.Pool
20+ _ = json .Unmarshal ([]byte (`{"address":"0xc4ce391d82d164c166df9c8336ddf84206b2f812","exchange":"balancer-v3-stable","type":"balancer-v3-stable","timestamp":1751293016,"reserves":["687804073931103275644","1783969556654743519024"],"tokens":[{"address":"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"},{"address":"0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0"}],"extra":"{\"hook\":{},\"fee\":\"20000000000000\",\"aggrFee\":\"500000000000000000\",\"balsE18\":[\"694069210892948295209\",\"2124492373418339554414\"],\"decs\":[\"1\",\"1\"],\"rates\":[\"1009108897721464489\",\"1190879275654308905\"],\"buffs\":[{\"dRate\":[\"976255\",\"976255817341\",\"976255817341645373\",\"976255817341645373456045\",\"976255817341645373456045753577\"],\"rRate\":[\"1024321\",\"1024321681096\",\"1024321681096877127\",\"1024321681096877127977750\",\"1024321681096877127977750950000\"]},{\"dRate\":[\"996629\",\"996629442697\",\"996629442697471179\",\"996629442697471179789157\",\"996629442697471179789157582365\"],\"rRate\":[\"1003381\",\"1003381956380\",\"1003381956380303285\",\"1003381956380303285385258\",\"1003381956380303285385258382000\"]}],\"surge\":{},\"ampParam\":\"5000000\"}","staticExtra":"{\"buffs\":[\"0x0fe906e030a44ef24ca8c7dc7b7c53a6c4f00ce9\",\"0x775f661b0bd1739349b9a2a3ef60be277c5d2d29\"]}","blockNumber":22817774}` ),
2121 & entityPool )
22- _ = json .Unmarshal ([]byte (`{"address":"0x79f96e2160c9069bd819161276320d8c8beab0ea","exchange":"balancer-v3-stable","type":"balancer-v3-stable","timestamp":1759834811,"reserves":["145112515681572525","157550194","487789","133457591"],"tokens":[{"address":"0x4200000000000000000000000000000000000006","symbol":"WETH","decimals":18,"swappable":true},{"address":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","symbol":"USDC","decimals":6,"swappable":true},{"address":"0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf","symbol":"cbBTC","decimals":8,"swappable":true},{"address":"0xfde4c96c8593536e31f229ea8f37b2ada2699bb2","symbol":"USDT","decimals":6,"swappable":true},{"address":"0xc768c589647798a6ee01a91fde98ef2ed046dbd6","symbol":"waBasUSDC","decimals":6,"swappable":true}],"extra":"{\"hook\":{\"dynFee\":true},\"fee\":\"8000000000000\",\"aggrFee\":\"500000000000000000\",\"balsE18\":[\"681593916124730114424\",\"174733118599984050167\",\"606843756465924360000\",\"133457591000000000000\"],\"decs\":[\"1\",\"1000000000000\",\"10000000000\",\"1000000000000\"],\"rates\":[\"4697002963000000000000\",\"1109063176399414971\",\"124407019524000000000000\",\"1000000000000000000\"],\"buffs\":[null,{\"dRate\":[\"901661\",\"901661890214\",\"901661890214866120\",\"901661890214866120568244\",\"901661890214866120568244980649\"],\"rRate\":[\"1109063\",\"1109063176399\",\"1109063176399414971\",\"1109063176399414971194981\",\"1109063176399414971194981471000\"]},null,null],\"surge\":{\"max\":\"100000000000000000\",\"thres\":\"300000000000000000\"},\"ampParam\":\"5000000\"}","staticExtra":"{\"hook\":\"0xdb8d758bcb971e482b2c45f7f8a7740283a1bd3a\",\"hookT\":\"STABLE_SURGE\",\"buffs\":[\"\",\"0xc768c589647798a6ee01a91fde98ef2ed046dbd6\",\"\",\"\"]}","blockNumber":36522732}` ),
23- & eP2 )
2422 poolSim = lo .Must (NewPoolSimulator (pool.FactoryParams {EntityPool : entityPool }))
25- pS2 = lo .Must (NewPoolSimulator (pool.FactoryParams {EntityPool : eP2 }))
2623)
2724
2825func TestCalcAmountOut (t * testing.T ) {
@@ -111,31 +108,8 @@ func TestCalcAmountOut(t *testing.T) {
111108 })
112109}
113110
114- func TestCalcAmountOutSurge (t * testing.T ) {
115- t .Parallel ()
116- testutil .TestCalcAmountOut (t , pS2 , map [int ]map [int ]map [string ]string {
117- 1 : {
118- 2 : {
119- "100000000" : "80420" , // "80420",
120- "200000000" : "153185" , // "160812",
121- "400000000" : "300714" , // "321540",
122- "800000000" : "487638" , // "487638",
123- },
124- },
125- 2 : {
126- 1 : {
127- "40000" : "46378456" , // "47031432",
128- "80000" : "92208588" , // "93112601",
129- "160000" : "172329018" , // "172333931",
130- "320000" : "174614087" , // "174614090",
131- },
132- },
133- })
134- }
135-
136111func TestCalcAmountIn (t * testing.T ) {
137112 testutil .TestCalcAmountIn (t , poolSim , 8 )
138- testutil .TestCalcAmountIn (t , pS2 , 4 )
139113}
140114
141115func TestCanSwapTo (t * testing.T ) {
0 commit comments