├── .gitignore ├── LICENSE ├── README.md ├── abis ├── CurveRegistry.json ├── CurveTokenV1.json ├── CurveTokenV2.json ├── ERC20.json └── StableSwap.json ├── package.json ├── prettier.config.js ├── schema.graphql ├── src ├── entities │ ├── index.ts │ ├── pool.ts │ ├── system.ts │ ├── token.ts │ └── utils.ts └── mapping │ ├── registry.ts │ └── swap.ts ├── subgraph.yaml └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | /generated 3 | /build -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 ProtoFire 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Curve Subgraph 2 | ============== 3 | 4 | This subgraph provides information about the following Curve liquidity pools: 5 | 6 | 1. Compound pool 7 | 2. USDT pool 8 | 3. PAX pool, with lending on yearn.finance 9 | 4. Y Pool 10 | 5. BUSD pool 11 | 6. sUSD pool (v2) 12 | 7. renBTC pool 13 | 8. sBTC pool 14 | 9. HBTC pool 15 | 10. Tri-pool 16 | 11. GUSD metapool 17 | 12. HUSD metapool 18 | 13. USDK metapool 19 | 14. USDN metapool 20 | 15. LinkUSD metapool 21 | 16. MUSD metapool 22 | 17. RSV metapool 23 | 18. tBTC metapool 24 | 25 | 26 | Note: this subgraph doesn't provide transfer data about neither ERC20 nor LP tokens because that would imply indexing 27 | a lot of events and would cost too much indexing time; it just covers basic token description including address, name, 28 | symbol and decimal precision. 29 | 30 | 31 | # Queries 32 | 33 | ## General system summary 34 | 35 | ```graphql 36 | { 37 | systemInfo(id: "current") { 38 | # Total number of pools registered 39 | poolCount 40 | 41 | # Total number of tokens registered as LP, composing or underlying coins 42 | tokenCount 43 | } 44 | } 45 | ``` 46 | 47 | 48 | ## List all supported pools 49 | 50 | ```graphql 51 | { 52 | pools(orderBy: addedAt) { 53 | # StableSwap contract address 54 | address 55 | 56 | # Composing coins 57 | coinCount 58 | 59 | coins { 60 | address 61 | name 62 | symbol 63 | decimals 64 | } 65 | 66 | # Current balances 67 | balances 68 | 69 | # LP token information 70 | poolToken { 71 | name 72 | symbol 73 | address 74 | } 75 | 76 | # Pool parameters 77 | A 78 | fee 79 | adminFee 80 | virtualPrice 81 | 82 | # Pool's events 83 | events { 84 | # ... 85 | } 86 | } 87 | } 88 | ``` 89 | 90 | Note: pool events that are indexed include exchanges, add/remove liquidity, transfer ownership and pool parameters 91 | changelogs (A coeff, fee and admin fee changes) 92 | 93 | -------------------------------------------------------------------------------- /abis/CurveRegistry.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "anonymous": false, 4 | "inputs": [ 5 | { 6 | "indexed": true, 7 | "name": "deadline", 8 | "type": "uint256" 9 | }, 10 | { 11 | "indexed": true, 12 | "name": "admin", 13 | "type": "address" 14 | } 15 | ], 16 | "name": "CommitNewAdmin", 17 | "type": "event" 18 | }, 19 | { 20 | "anonymous": false, 21 | "inputs": [ 22 | { 23 | "indexed": true, 24 | "name": "admin", 25 | "type": "address" 26 | } 27 | ], 28 | "name": "NewAdmin", 29 | "type": "event" 30 | }, 31 | { 32 | "anonymous": false, 33 | "inputs": [ 34 | { 35 | "indexed": true, 36 | "name": "buyer", 37 | "type": "address" 38 | }, 39 | { 40 | "indexed": true, 41 | "name": "pool", 42 | "type": "address" 43 | }, 44 | { 45 | "indexed": false, 46 | "name": "token_sold", 47 | "type": "address" 48 | }, 49 | { 50 | "indexed": false, 51 | "name": "token_bought", 52 | "type": "address" 53 | }, 54 | { 55 | "indexed": false, 56 | "name": "amount_sold", 57 | "type": "uint256" 58 | }, 59 | { 60 | "indexed": false, 61 | "name": "amount_bought", 62 | "type": "uint256" 63 | } 64 | ], 65 | "name": "TokenExchange", 66 | "type": "event" 67 | }, 68 | { 69 | "anonymous": false, 70 | "inputs": [ 71 | { 72 | "indexed": true, 73 | "name": "pool", 74 | "type": "address" 75 | }, 76 | { 77 | "indexed": false, 78 | "name": "rate_method_id", 79 | "type": "bytes" 80 | } 81 | ], 82 | "name": "PoolAdded", 83 | "type": "event" 84 | }, 85 | { 86 | "anonymous": false, 87 | "inputs": [ 88 | { 89 | "indexed": true, 90 | "name": "pool", 91 | "type": "address" 92 | } 93 | ], 94 | "name": "PoolRemoved", 95 | "type": "event" 96 | }, 97 | { 98 | "constant": false, 99 | "inputs": [ 100 | { 101 | "name": "_returns_none", 102 | "type": "address[4]" 103 | } 104 | ], 105 | "outputs": [], 106 | "payable": false, 107 | "type": "constructor", 108 | "name": "constructor" 109 | }, 110 | { 111 | "constant": false, 112 | "payable": true, 113 | "type": "fallback" 114 | }, 115 | { 116 | "constant": true, 117 | "inputs": [ 118 | { 119 | "name": "_from", 120 | "type": "address" 121 | }, 122 | { 123 | "name": "_to", 124 | "type": "address" 125 | } 126 | ], 127 | "name": "find_pool_for_coins", 128 | "outputs": [ 129 | { 130 | "name": "", 131 | "type": "address" 132 | } 133 | ], 134 | "payable": false, 135 | "type": "function" 136 | }, 137 | { 138 | "constant": true, 139 | "inputs": [ 140 | { 141 | "name": "_from", 142 | "type": "address" 143 | }, 144 | { 145 | "name": "_to", 146 | "type": "address" 147 | }, 148 | { 149 | "name": "i", 150 | "type": "uint256" 151 | } 152 | ], 153 | "name": "find_pool_for_coins", 154 | "outputs": [ 155 | { 156 | "name": "", 157 | "type": "address" 158 | } 159 | ], 160 | "payable": false, 161 | "type": "function" 162 | }, 163 | { 164 | "constant": true, 165 | "gas": 45681, 166 | "inputs": [ 167 | { 168 | "name": "_pool", 169 | "type": "address" 170 | } 171 | ], 172 | "name": "get_pool_coins", 173 | "outputs": [ 174 | { 175 | "components": [ 176 | { 177 | "name": "coins", 178 | "type": "address[8]" 179 | }, 180 | { 181 | "name": "underlying_coins", 182 | "type": "address[8]" 183 | }, 184 | { 185 | "name": "decimals", 186 | "type": "uint256[8]" 187 | }, 188 | { 189 | "name": "underlying_decimals", 190 | "type": "uint256[8]" 191 | } 192 | ], 193 | "name": "", 194 | "type": "tuple" 195 | } 196 | ], 197 | "payable": false, 198 | "type": "function" 199 | }, 200 | { 201 | "constant": true, 202 | "gas": 87733, 203 | "inputs": [ 204 | { 205 | "name": "_pool", 206 | "type": "address" 207 | } 208 | ], 209 | "name": "get_pool_info", 210 | "outputs": [ 211 | { 212 | "components": [ 213 | { 214 | "name": "balances", 215 | "type": "uint256[8]" 216 | }, 217 | { 218 | "name": "underlying_balances", 219 | "type": "uint256[8]" 220 | }, 221 | { 222 | "name": "decimals", 223 | "type": "uint256[8]" 224 | }, 225 | { 226 | "name": "underlying_decimals", 227 | "type": "uint256[8]" 228 | }, 229 | { 230 | "name": "lp_token", 231 | "type": "address" 232 | }, 233 | { 234 | "name": "A", 235 | "type": "uint256" 236 | }, 237 | { 238 | "name": "fee", 239 | "type": "uint256" 240 | } 241 | ], 242 | "name": "", 243 | "type": "tuple" 244 | } 245 | ], 246 | "payable": false, 247 | "type": "function" 248 | }, 249 | { 250 | "constant": true, 251 | "gas": 44706, 252 | "inputs": [ 253 | { 254 | "name": "_pool", 255 | "type": "address" 256 | } 257 | ], 258 | "name": "get_pool_rates", 259 | "outputs": [ 260 | { 261 | "name": "", 262 | "type": "uint256[8]" 263 | } 264 | ], 265 | "payable": false, 266 | "type": "function" 267 | }, 268 | { 269 | "constant": true, 270 | "gas": 50163, 271 | "inputs": [ 272 | { 273 | "name": "_pool", 274 | "type": "address" 275 | }, 276 | { 277 | "name": "_from", 278 | "type": "address" 279 | }, 280 | { 281 | "name": "_to", 282 | "type": "address" 283 | } 284 | ], 285 | "name": "estimate_gas_used", 286 | "outputs": [ 287 | { 288 | "name": "", 289 | "type": "uint256" 290 | } 291 | ], 292 | "payable": false, 293 | "type": "function" 294 | }, 295 | { 296 | "constant": true, 297 | "gas": 45192, 298 | "inputs": [ 299 | { 300 | "name": "_pool", 301 | "type": "address" 302 | }, 303 | { 304 | "name": "_from", 305 | "type": "address" 306 | }, 307 | { 308 | "name": "_to", 309 | "type": "address" 310 | }, 311 | { 312 | "name": "_amount", 313 | "type": "uint256" 314 | } 315 | ], 316 | "name": "get_exchange_amount", 317 | "outputs": [ 318 | { 319 | "name": "", 320 | "type": "uint256" 321 | } 322 | ], 323 | "payable": false, 324 | "type": "function" 325 | }, 326 | { 327 | "constant": false, 328 | "gas": 198813, 329 | "inputs": [ 330 | { 331 | "name": "_pool", 332 | "type": "address" 333 | }, 334 | { 335 | "name": "_from", 336 | "type": "address" 337 | }, 338 | { 339 | "name": "_to", 340 | "type": "address" 341 | }, 342 | { 343 | "name": "_amount", 344 | "type": "uint256" 345 | }, 346 | { 347 | "name": "_expected", 348 | "type": "uint256" 349 | } 350 | ], 351 | "name": "exchange", 352 | "outputs": [ 353 | { 354 | "name": "", 355 | "type": "bool" 356 | } 357 | ], 358 | "payable": true, 359 | "type": "function" 360 | }, 361 | { 362 | "constant": true, 363 | "gas": 135410, 364 | "inputs": [ 365 | { 366 | "name": "_pool", 367 | "type": "address" 368 | }, 369 | { 370 | "name": "_from", 371 | "type": "address" 372 | }, 373 | { 374 | "name": "_to", 375 | "type": "address" 376 | }, 377 | { 378 | "name": "_amount", 379 | "type": "uint256" 380 | } 381 | ], 382 | "name": "get_input_amount", 383 | "outputs": [ 384 | { 385 | "name": "", 386 | "type": "uint256" 387 | } 388 | ], 389 | "payable": false, 390 | "type": "function" 391 | }, 392 | { 393 | "constant": true, 394 | "gas": 138709, 395 | "inputs": [ 396 | { 397 | "name": "_pool", 398 | "type": "address" 399 | }, 400 | { 401 | "name": "_from", 402 | "type": "address" 403 | }, 404 | { 405 | "name": "_to", 406 | "type": "address" 407 | }, 408 | { 409 | "name": "_amounts", 410 | "type": "uint256[100]" 411 | } 412 | ], 413 | "name": "get_exchange_amounts", 414 | "outputs": [ 415 | { 416 | "name": "", 417 | "type": "uint256[100]" 418 | } 419 | ], 420 | "payable": false, 421 | "type": "function" 422 | }, 423 | { 424 | "constant": false, 425 | "gas": 10290194, 426 | "inputs": [ 427 | { 428 | "name": "_pool", 429 | "type": "address" 430 | }, 431 | { 432 | "name": "_n_coins", 433 | "type": "int128" 434 | }, 435 | { 436 | "name": "_lp_token", 437 | "type": "address" 438 | }, 439 | { 440 | "name": "_calculator", 441 | "type": "address" 442 | }, 443 | { 444 | "name": "_rate_method_id", 445 | "type": "bytes32" 446 | }, 447 | { 448 | "name": "_decimals", 449 | "type": "bytes32" 450 | }, 451 | { 452 | "name": "_underlying_decimals", 453 | "type": "bytes32" 454 | } 455 | ], 456 | "name": "add_pool", 457 | "outputs": [], 458 | "payable": false, 459 | "type": "function" 460 | }, 461 | { 462 | "constant": false, 463 | "gas": 10273690, 464 | "inputs": [ 465 | { 466 | "name": "_pool", 467 | "type": "address" 468 | }, 469 | { 470 | "name": "_n_coins", 471 | "type": "int128" 472 | }, 473 | { 474 | "name": "_lp_token", 475 | "type": "address" 476 | }, 477 | { 478 | "name": "_calculator", 479 | "type": "address" 480 | }, 481 | { 482 | "name": "_rate_method_id", 483 | "type": "bytes32" 484 | }, 485 | { 486 | "name": "_decimals", 487 | "type": "bytes32" 488 | }, 489 | { 490 | "name": "_use_rates", 491 | "type": "bytes32" 492 | } 493 | ], 494 | "name": "add_pool_without_underlying", 495 | "outputs": [], 496 | "payable": false, 497 | "type": "function" 498 | }, 499 | { 500 | "constant": false, 501 | "gas": 317792223500, 502 | "inputs": [ 503 | { 504 | "name": "_pool", 505 | "type": "address" 506 | } 507 | ], 508 | "name": "remove_pool", 509 | "outputs": [], 510 | "payable": false, 511 | "type": "function" 512 | }, 513 | { 514 | "constant": false, 515 | "gas": 36818, 516 | "inputs": [ 517 | { 518 | "name": "_addr", 519 | "type": "address" 520 | }, 521 | { 522 | "name": "_is_returns_none", 523 | "type": "bool" 524 | } 525 | ], 526 | "name": "set_returns_none", 527 | "outputs": [], 528 | "payable": false, 529 | "type": "function" 530 | }, 531 | { 532 | "constant": false, 533 | "gas": 356796, 534 | "inputs": [ 535 | { 536 | "name": "_addr", 537 | "type": "address[10]" 538 | }, 539 | { 540 | "name": "_amount", 541 | "type": "uint256[10]" 542 | } 543 | ], 544 | "name": "set_coin_gas_estimates", 545 | "outputs": [], 546 | "payable": false, 547 | "type": "function" 548 | }, 549 | { 550 | "constant": false, 551 | "gas": 36911, 552 | "inputs": [ 553 | { 554 | "name": "_pool", 555 | "type": "address" 556 | }, 557 | { 558 | "name": "_estimator", 559 | "type": "address" 560 | } 561 | ], 562 | "name": "set_gas_estimate_contract", 563 | "outputs": [], 564 | "payable": false, 565 | "type": "function" 566 | }, 567 | { 568 | "constant": false, 569 | "gas": 37019, 570 | "inputs": [ 571 | { 572 | "name": "_pool", 573 | "type": "address" 574 | }, 575 | { 576 | "name": "_calculator", 577 | "type": "address" 578 | } 579 | ], 580 | "name": "set_calculator", 581 | "outputs": [], 582 | "payable": false, 583 | "type": "function" 584 | }, 585 | { 586 | "constant": true, 587 | "gas": 1953, 588 | "inputs": [ 589 | { 590 | "name": "_pool", 591 | "type": "address" 592 | } 593 | ], 594 | "name": "get_calculator", 595 | "outputs": [ 596 | { 597 | "name": "", 598 | "type": "address" 599 | } 600 | ], 601 | "payable": false, 602 | "type": "function" 603 | }, 604 | { 605 | "constant": false, 606 | "gas": 74452, 607 | "inputs": [ 608 | { 609 | "name": "_new_admin", 610 | "type": "address" 611 | } 612 | ], 613 | "name": "commit_transfer_ownership", 614 | "outputs": [], 615 | "payable": false, 616 | "type": "function" 617 | }, 618 | { 619 | "constant": false, 620 | "gas": 60590, 621 | "inputs": [], 622 | "name": "apply_transfer_ownership", 623 | "outputs": [], 624 | "payable": false, 625 | "type": "function" 626 | }, 627 | { 628 | "constant": false, 629 | "gas": 21865, 630 | "inputs": [], 631 | "name": "revert_transfer_ownership", 632 | "outputs": [], 633 | "payable": false, 634 | "type": "function" 635 | }, 636 | { 637 | "constant": false, 638 | "gas": 4854, 639 | "inputs": [ 640 | { 641 | "name": "_token", 642 | "type": "address" 643 | } 644 | ], 645 | "name": "claim_token_balance", 646 | "outputs": [], 647 | "payable": false, 648 | "type": "function" 649 | }, 650 | { 651 | "constant": false, 652 | "gas": 36726, 653 | "inputs": [], 654 | "name": "claim_eth_balance", 655 | "outputs": [], 656 | "payable": false, 657 | "type": "function" 658 | }, 659 | { 660 | "constant": true, 661 | "gas": 1901, 662 | "inputs": [], 663 | "name": "admin", 664 | "outputs": [ 665 | { 666 | "name": "", 667 | "type": "address" 668 | } 669 | ], 670 | "payable": false, 671 | "type": "function" 672 | }, 673 | { 674 | "constant": true, 675 | "gas": 2130, 676 | "inputs": [ 677 | { 678 | "name": "arg0", 679 | "type": "int128" 680 | } 681 | ], 682 | "name": "pool_list", 683 | "outputs": [ 684 | { 685 | "name": "", 686 | "type": "address" 687 | } 688 | ], 689 | "payable": false, 690 | "type": "function" 691 | }, 692 | { 693 | "constant": true, 694 | "gas": 1961, 695 | "inputs": [], 696 | "name": "pool_count", 697 | "outputs": [ 698 | { 699 | "name": "", 700 | "type": "uint256" 701 | } 702 | ], 703 | "payable": false, 704 | "type": "function" 705 | } 706 | ] -------------------------------------------------------------------------------- /abis/CurveTokenV1.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Transfer", 4 | "inputs": [ 5 | { 6 | "type": "address", 7 | "name": "_from", 8 | "indexed": true 9 | }, 10 | { 11 | "type": "address", 12 | "name": "_to", 13 | "indexed": true 14 | }, 15 | { 16 | "type": "uint256", 17 | "name": "_value", 18 | "indexed": false 19 | } 20 | ], 21 | "anonymous": false, 22 | "type": "event" 23 | }, 24 | { 25 | "name": "Approval", 26 | "inputs": [ 27 | { 28 | "type": "address", 29 | "name": "_owner", 30 | "indexed": true 31 | }, 32 | { 33 | "type": "address", 34 | "name": "_spender", 35 | "indexed": true 36 | }, 37 | { 38 | "type": "uint256", 39 | "name": "_value", 40 | "indexed": false 41 | } 42 | ], 43 | "anonymous": false, 44 | "type": "event" 45 | }, 46 | { 47 | "outputs": [], 48 | "inputs": [ 49 | { 50 | "type": "string", 51 | "name": "_name" 52 | }, 53 | { 54 | "type": "string", 55 | "name": "_symbol" 56 | }, 57 | { 58 | "type": "uint256", 59 | "name": "_decimals" 60 | }, 61 | { 62 | "type": "uint256", 63 | "name": "_supply" 64 | } 65 | ], 66 | "constant": false, 67 | "payable": false, 68 | "type": "constructor" 69 | }, 70 | { 71 | "name": "set_minter", 72 | "outputs": [], 73 | "inputs": [ 74 | { 75 | "type": "address", 76 | "name": "_minter" 77 | } 78 | ], 79 | "constant": false, 80 | "payable": false, 81 | "type": "function", 82 | "gas": 36247 83 | }, 84 | { 85 | "name": "totalSupply", 86 | "outputs": [ 87 | { 88 | "type": "uint256", 89 | "name": "out" 90 | } 91 | ], 92 | "inputs": [], 93 | "constant": true, 94 | "payable": false, 95 | "type": "function", 96 | "gas": 1181 97 | }, 98 | { 99 | "name": "allowance", 100 | "outputs": [ 101 | { 102 | "type": "uint256", 103 | "name": "out" 104 | } 105 | ], 106 | "inputs": [ 107 | { 108 | "type": "address", 109 | "name": "_owner" 110 | }, 111 | { 112 | "type": "address", 113 | "name": "_spender" 114 | } 115 | ], 116 | "constant": true, 117 | "payable": false, 118 | "type": "function", 119 | "gas": 1519 120 | }, 121 | { 122 | "name": "transfer", 123 | "outputs": [ 124 | { 125 | "type": "bool", 126 | "name": "out" 127 | } 128 | ], 129 | "inputs": [ 130 | { 131 | "type": "address", 132 | "name": "_to" 133 | }, 134 | { 135 | "type": "uint256", 136 | "name": "_value" 137 | } 138 | ], 139 | "constant": false, 140 | "payable": false, 141 | "type": "function", 142 | "gas": 74802 143 | }, 144 | { 145 | "name": "transferFrom", 146 | "outputs": [ 147 | { 148 | "type": "bool", 149 | "name": "out" 150 | } 151 | ], 152 | "inputs": [ 153 | { 154 | "type": "address", 155 | "name": "_from" 156 | }, 157 | { 158 | "type": "address", 159 | "name": "_to" 160 | }, 161 | { 162 | "type": "uint256", 163 | "name": "_value" 164 | } 165 | ], 166 | "constant": false, 167 | "payable": false, 168 | "type": "function", 169 | "gas": 111953 170 | }, 171 | { 172 | "name": "approve", 173 | "outputs": [ 174 | { 175 | "type": "bool", 176 | "name": "out" 177 | } 178 | ], 179 | "inputs": [ 180 | { 181 | "type": "address", 182 | "name": "_spender" 183 | }, 184 | { 185 | "type": "uint256", 186 | "name": "_value" 187 | } 188 | ], 189 | "constant": false, 190 | "payable": false, 191 | "type": "function", 192 | "gas": 39012 193 | }, 194 | { 195 | "name": "mint", 196 | "outputs": [], 197 | "inputs": [ 198 | { 199 | "type": "address", 200 | "name": "_to" 201 | }, 202 | { 203 | "type": "uint256", 204 | "name": "_value" 205 | } 206 | ], 207 | "constant": false, 208 | "payable": false, 209 | "type": "function", 210 | "gas": 75733 211 | }, 212 | { 213 | "name": "burn", 214 | "outputs": [], 215 | "inputs": [ 216 | { 217 | "type": "uint256", 218 | "name": "_value" 219 | } 220 | ], 221 | "constant": false, 222 | "payable": false, 223 | "type": "function", 224 | "gas": 76623 225 | }, 226 | { 227 | "name": "burnFrom", 228 | "outputs": [], 229 | "inputs": [ 230 | { 231 | "type": "address", 232 | "name": "_to" 233 | }, 234 | { 235 | "type": "uint256", 236 | "name": "_value" 237 | } 238 | ], 239 | "constant": false, 240 | "payable": false, 241 | "type": "function", 242 | "gas": 76696 243 | }, 244 | { 245 | "name": "name", 246 | "outputs": [ 247 | { 248 | "type": "string", 249 | "name": "out" 250 | } 251 | ], 252 | "inputs": [], 253 | "constant": true, 254 | "payable": false, 255 | "type": "function", 256 | "gas": 7853 257 | }, 258 | { 259 | "name": "symbol", 260 | "outputs": [ 261 | { 262 | "type": "string", 263 | "name": "out" 264 | } 265 | ], 266 | "inputs": [], 267 | "constant": true, 268 | "payable": false, 269 | "type": "function", 270 | "gas": 6906 271 | }, 272 | { 273 | "name": "decimals", 274 | "outputs": [ 275 | { 276 | "type": "uint256", 277 | "name": "out" 278 | } 279 | ], 280 | "inputs": [], 281 | "constant": true, 282 | "payable": false, 283 | "type": "function", 284 | "gas": 1511 285 | }, 286 | { 287 | "name": "balanceOf", 288 | "outputs": [ 289 | { 290 | "type": "uint256", 291 | "name": "out" 292 | } 293 | ], 294 | "inputs": [ 295 | { 296 | "type": "address", 297 | "name": "arg0" 298 | } 299 | ], 300 | "constant": true, 301 | "payable": false, 302 | "type": "function", 303 | "gas": 1695 304 | } 305 | ] 306 | -------------------------------------------------------------------------------- /abis/CurveTokenV2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Transfer", 4 | "inputs": [ 5 | { 6 | "type": "address", 7 | "name": "_from", 8 | "indexed": true 9 | }, 10 | { 11 | "type": "address", 12 | "name": "_to", 13 | "indexed": true 14 | }, 15 | { 16 | "type": "uint256", 17 | "name": "_value", 18 | "indexed": false 19 | } 20 | ], 21 | "anonymous": false, 22 | "type": "event" 23 | }, 24 | { 25 | "name": "Approval", 26 | "inputs": [ 27 | { 28 | "type": "address", 29 | "name": "_owner", 30 | "indexed": true 31 | }, 32 | { 33 | "type": "address", 34 | "name": "_spender", 35 | "indexed": true 36 | }, 37 | { 38 | "type": "uint256", 39 | "name": "_value", 40 | "indexed": false 41 | } 42 | ], 43 | "anonymous": false, 44 | "type": "event" 45 | }, 46 | { 47 | "outputs": [], 48 | "inputs": [ 49 | { 50 | "type": "string", 51 | "name": "_name" 52 | }, 53 | { 54 | "type": "string", 55 | "name": "_symbol" 56 | }, 57 | { 58 | "type": "uint256", 59 | "name": "_decimals" 60 | }, 61 | { 62 | "type": "uint256", 63 | "name": "_supply" 64 | } 65 | ], 66 | "stateMutability": "nonpayable", 67 | "type": "constructor" 68 | }, 69 | { 70 | "name": "set_minter", 71 | "outputs": [], 72 | "inputs": [ 73 | { 74 | "type": "address", 75 | "name": "_minter" 76 | } 77 | ], 78 | "stateMutability": "nonpayable", 79 | "type": "function", 80 | "gas": 36247 81 | }, 82 | { 83 | "name": "set_name", 84 | "outputs": [], 85 | "inputs": [ 86 | { 87 | "type": "string", 88 | "name": "_name" 89 | }, 90 | { 91 | "type": "string", 92 | "name": "_symbol" 93 | } 94 | ], 95 | "stateMutability": "nonpayable", 96 | "type": "function", 97 | "gas": 178069 98 | }, 99 | { 100 | "name": "totalSupply", 101 | "outputs": [ 102 | { 103 | "type": "uint256", 104 | "name": "" 105 | } 106 | ], 107 | "inputs": [], 108 | "stateMutability": "view", 109 | "type": "function", 110 | "gas": 1211 111 | }, 112 | { 113 | "name": "allowance", 114 | "outputs": [ 115 | { 116 | "type": "uint256", 117 | "name": "" 118 | } 119 | ], 120 | "inputs": [ 121 | { 122 | "type": "address", 123 | "name": "_owner" 124 | }, 125 | { 126 | "type": "address", 127 | "name": "_spender" 128 | } 129 | ], 130 | "stateMutability": "view", 131 | "type": "function", 132 | "gas": 1549 133 | }, 134 | { 135 | "name": "transfer", 136 | "outputs": [ 137 | { 138 | "type": "bool", 139 | "name": "" 140 | } 141 | ], 142 | "inputs": [ 143 | { 144 | "type": "address", 145 | "name": "_to" 146 | }, 147 | { 148 | "type": "uint256", 149 | "name": "_value" 150 | } 151 | ], 152 | "stateMutability": "nonpayable", 153 | "type": "function", 154 | "gas": 74832 155 | }, 156 | { 157 | "name": "transferFrom", 158 | "outputs": [ 159 | { 160 | "type": "bool", 161 | "name": "" 162 | } 163 | ], 164 | "inputs": [ 165 | { 166 | "type": "address", 167 | "name": "_from" 168 | }, 169 | { 170 | "type": "address", 171 | "name": "_to" 172 | }, 173 | { 174 | "type": "uint256", 175 | "name": "_value" 176 | } 177 | ], 178 | "stateMutability": "nonpayable", 179 | "type": "function", 180 | "gas": 111983 181 | }, 182 | { 183 | "name": "approve", 184 | "outputs": [ 185 | { 186 | "type": "bool", 187 | "name": "" 188 | } 189 | ], 190 | "inputs": [ 191 | { 192 | "type": "address", 193 | "name": "_spender" 194 | }, 195 | { 196 | "type": "uint256", 197 | "name": "_value" 198 | } 199 | ], 200 | "stateMutability": "nonpayable", 201 | "type": "function", 202 | "gas": 39078 203 | }, 204 | { 205 | "name": "mint", 206 | "outputs": [ 207 | { 208 | "type": "bool", 209 | "name": "" 210 | } 211 | ], 212 | "inputs": [ 213 | { 214 | "type": "address", 215 | "name": "_to" 216 | }, 217 | { 218 | "type": "uint256", 219 | "name": "_value" 220 | } 221 | ], 222 | "stateMutability": "nonpayable", 223 | "type": "function", 224 | "gas": 75808 225 | }, 226 | { 227 | "name": "burnFrom", 228 | "outputs": [ 229 | { 230 | "type": "bool", 231 | "name": "" 232 | } 233 | ], 234 | "inputs": [ 235 | { 236 | "type": "address", 237 | "name": "_to" 238 | }, 239 | { 240 | "type": "uint256", 241 | "name": "_value" 242 | } 243 | ], 244 | "stateMutability": "nonpayable", 245 | "type": "function", 246 | "gas": 75826 247 | }, 248 | { 249 | "name": "name", 250 | "outputs": [ 251 | { 252 | "type": "string", 253 | "name": "" 254 | } 255 | ], 256 | "inputs": [], 257 | "stateMutability": "view", 258 | "type": "function", 259 | "gas": 7823 260 | }, 261 | { 262 | "name": "symbol", 263 | "outputs": [ 264 | { 265 | "type": "string", 266 | "name": "" 267 | } 268 | ], 269 | "inputs": [], 270 | "stateMutability": "view", 271 | "type": "function", 272 | "gas": 6876 273 | }, 274 | { 275 | "name": "decimals", 276 | "outputs": [ 277 | { 278 | "type": "uint256", 279 | "name": "" 280 | } 281 | ], 282 | "inputs": [], 283 | "stateMutability": "view", 284 | "type": "function", 285 | "gas": 1481 286 | }, 287 | { 288 | "name": "balanceOf", 289 | "outputs": [ 290 | { 291 | "type": "uint256", 292 | "name": "" 293 | } 294 | ], 295 | "inputs": [ 296 | { 297 | "type": "address", 298 | "name": "arg0" 299 | } 300 | ], 301 | "stateMutability": "view", 302 | "type": "function", 303 | "gas": 1665 304 | } 305 | ] 306 | -------------------------------------------------------------------------------- /abis/ERC20.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "constant": true, 4 | "inputs": [], 5 | "name": "name", 6 | "outputs": [ 7 | { 8 | "name": "", 9 | "type": "string" 10 | } 11 | ], 12 | "payable": false, 13 | "stateMutability": "view", 14 | "type": "function" 15 | }, 16 | { 17 | "constant": false, 18 | "inputs": [ 19 | { 20 | "name": "_spender", 21 | "type": "address" 22 | }, 23 | { 24 | "name": "_value", 25 | "type": "uint256" 26 | } 27 | ], 28 | "name": "approve", 29 | "outputs": [ 30 | { 31 | "name": "", 32 | "type": "bool" 33 | } 34 | ], 35 | "payable": false, 36 | "stateMutability": "nonpayable", 37 | "type": "function" 38 | }, 39 | { 40 | "constant": true, 41 | "inputs": [], 42 | "name": "totalSupply", 43 | "outputs": [ 44 | { 45 | "name": "", 46 | "type": "uint256" 47 | } 48 | ], 49 | "payable": false, 50 | "stateMutability": "view", 51 | "type": "function" 52 | }, 53 | { 54 | "constant": false, 55 | "inputs": [ 56 | { 57 | "name": "_from", 58 | "type": "address" 59 | }, 60 | { 61 | "name": "_to", 62 | "type": "address" 63 | }, 64 | { 65 | "name": "_value", 66 | "type": "uint256" 67 | } 68 | ], 69 | "name": "transferFrom", 70 | "outputs": [ 71 | { 72 | "name": "", 73 | "type": "bool" 74 | } 75 | ], 76 | "payable": false, 77 | "stateMutability": "nonpayable", 78 | "type": "function" 79 | }, 80 | { 81 | "constant": true, 82 | "inputs": [], 83 | "name": "decimals", 84 | "outputs": [ 85 | { 86 | "name": "", 87 | "type": "uint8" 88 | } 89 | ], 90 | "payable": false, 91 | "stateMutability": "view", 92 | "type": "function" 93 | }, 94 | { 95 | "constant": true, 96 | "inputs": [ 97 | { 98 | "name": "_owner", 99 | "type": "address" 100 | } 101 | ], 102 | "name": "balanceOf", 103 | "outputs": [ 104 | { 105 | "name": "balance", 106 | "type": "uint256" 107 | } 108 | ], 109 | "payable": false, 110 | "stateMutability": "view", 111 | "type": "function" 112 | }, 113 | { 114 | "constant": true, 115 | "inputs": [], 116 | "name": "symbol", 117 | "outputs": [ 118 | { 119 | "name": "", 120 | "type": "string" 121 | } 122 | ], 123 | "payable": false, 124 | "stateMutability": "view", 125 | "type": "function" 126 | }, 127 | { 128 | "constant": false, 129 | "inputs": [ 130 | { 131 | "name": "_to", 132 | "type": "address" 133 | }, 134 | { 135 | "name": "_value", 136 | "type": "uint256" 137 | } 138 | ], 139 | "name": "transfer", 140 | "outputs": [ 141 | { 142 | "name": "", 143 | "type": "bool" 144 | } 145 | ], 146 | "payable": false, 147 | "stateMutability": "nonpayable", 148 | "type": "function" 149 | }, 150 | { 151 | "constant": true, 152 | "inputs": [ 153 | { 154 | "name": "_owner", 155 | "type": "address" 156 | }, 157 | { 158 | "name": "_spender", 159 | "type": "address" 160 | } 161 | ], 162 | "name": "allowance", 163 | "outputs": [ 164 | { 165 | "name": "", 166 | "type": "uint256" 167 | } 168 | ], 169 | "payable": false, 170 | "stateMutability": "view", 171 | "type": "function" 172 | }, 173 | { 174 | "payable": true, 175 | "stateMutability": "payable", 176 | "type": "fallback" 177 | }, 178 | { 179 | "anonymous": false, 180 | "inputs": [ 181 | { 182 | "indexed": true, 183 | "name": "owner", 184 | "type": "address" 185 | }, 186 | { 187 | "indexed": true, 188 | "name": "spender", 189 | "type": "address" 190 | }, 191 | { 192 | "indexed": false, 193 | "name": "value", 194 | "type": "uint256" 195 | } 196 | ], 197 | "name": "Approval", 198 | "type": "event" 199 | }, 200 | { 201 | "anonymous": false, 202 | "inputs": [ 203 | { 204 | "indexed": true, 205 | "name": "from", 206 | "type": "address" 207 | }, 208 | { 209 | "indexed": true, 210 | "name": "to", 211 | "type": "address" 212 | }, 213 | { 214 | "indexed": false, 215 | "name": "value", 216 | "type": "uint256" 217 | } 218 | ], 219 | "name": "Transfer", 220 | "type": "event" 221 | } 222 | ] 223 | -------------------------------------------------------------------------------- /abis/StableSwap.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "TokenExchange", 4 | "inputs": [ 5 | { 6 | "type": "address", 7 | "name": "buyer", 8 | "indexed": true 9 | }, 10 | { 11 | "type": "int128", 12 | "name": "sold_id", 13 | "indexed": false 14 | }, 15 | { 16 | "type": "uint256", 17 | "name": "tokens_sold", 18 | "indexed": false 19 | }, 20 | { 21 | "type": "int128", 22 | "name": "bought_id", 23 | "indexed": false 24 | }, 25 | { 26 | "type": "uint256", 27 | "name": "tokens_bought", 28 | "indexed": false 29 | } 30 | ], 31 | "anonymous": false, 32 | "type": "event" 33 | }, 34 | { 35 | "name": "TokenExchangeUnderlying", 36 | "inputs": [ 37 | { 38 | "type": "address", 39 | "name": "buyer", 40 | "indexed": true 41 | }, 42 | { 43 | "type": "int128", 44 | "name": "sold_id", 45 | "indexed": false 46 | }, 47 | { 48 | "type": "uint256", 49 | "name": "tokens_sold", 50 | "indexed": false 51 | }, 52 | { 53 | "type": "int128", 54 | "name": "bought_id", 55 | "indexed": false 56 | }, 57 | { 58 | "type": "uint256", 59 | "name": "tokens_bought", 60 | "indexed": false 61 | } 62 | ], 63 | "anonymous": false, 64 | "type": "event" 65 | }, 66 | { 67 | "name": "AddLiquidity", 68 | "inputs": [ 69 | { 70 | "type": "address", 71 | "name": "provider", 72 | "indexed": true 73 | }, 74 | { 75 | "type": "uint256[2]", 76 | "name": "token_amounts", 77 | "indexed": false 78 | }, 79 | { 80 | "type": "uint256[2]", 81 | "name": "fees", 82 | "indexed": false 83 | }, 84 | { 85 | "type": "uint256", 86 | "name": "invariant", 87 | "indexed": false 88 | }, 89 | { 90 | "type": "uint256", 91 | "name": "token_supply", 92 | "indexed": false 93 | } 94 | ], 95 | "anonymous": false, 96 | "type": "event" 97 | }, 98 | { 99 | "name": "RemoveLiquidity", 100 | "inputs": [ 101 | { 102 | "type": "address", 103 | "name": "provider", 104 | "indexed": true 105 | }, 106 | { 107 | "type": "uint256[2]", 108 | "name": "token_amounts", 109 | "indexed": false 110 | }, 111 | { 112 | "type": "uint256[2]", 113 | "name": "fees", 114 | "indexed": false 115 | }, 116 | { 117 | "type": "uint256", 118 | "name": "token_supply", 119 | "indexed": false 120 | } 121 | ], 122 | "anonymous": false, 123 | "type": "event" 124 | }, 125 | { 126 | "name": "RemoveLiquidityImbalance", 127 | "inputs": [ 128 | { 129 | "type": "address", 130 | "name": "provider", 131 | "indexed": true 132 | }, 133 | { 134 | "type": "uint256[2]", 135 | "name": "token_amounts", 136 | "indexed": false 137 | }, 138 | { 139 | "type": "uint256[2]", 140 | "name": "fees", 141 | "indexed": false 142 | }, 143 | { 144 | "type": "uint256", 145 | "name": "invariant", 146 | "indexed": false 147 | }, 148 | { 149 | "type": "uint256", 150 | "name": "token_supply", 151 | "indexed": false 152 | } 153 | ], 154 | "anonymous": false, 155 | "type": "event" 156 | }, 157 | { 158 | "name": "CommitNewAdmin", 159 | "inputs": [ 160 | { 161 | "type": "uint256", 162 | "name": "deadline", 163 | "indexed": true, 164 | "unit": "sec" 165 | }, 166 | { 167 | "type": "address", 168 | "name": "admin", 169 | "indexed": true 170 | } 171 | ], 172 | "anonymous": false, 173 | "type": "event" 174 | }, 175 | { 176 | "name": "NewAdmin", 177 | "inputs": [ 178 | { 179 | "type": "address", 180 | "name": "admin", 181 | "indexed": true 182 | } 183 | ], 184 | "anonymous": false, 185 | "type": "event" 186 | }, 187 | { 188 | "name": "CommitNewParameters", 189 | "inputs": [ 190 | { 191 | "type": "uint256", 192 | "name": "deadline", 193 | "indexed": true, 194 | "unit": "sec" 195 | }, 196 | { 197 | "type": "uint256", 198 | "name": "A", 199 | "indexed": false 200 | }, 201 | { 202 | "type": "uint256", 203 | "name": "fee", 204 | "indexed": false 205 | }, 206 | { 207 | "type": "uint256", 208 | "name": "admin_fee", 209 | "indexed": false 210 | } 211 | ], 212 | "anonymous": false, 213 | "type": "event" 214 | }, 215 | { 216 | "name": "NewParameters", 217 | "inputs": [ 218 | { 219 | "type": "uint256", 220 | "name": "A", 221 | "indexed": false 222 | }, 223 | { 224 | "type": "uint256", 225 | "name": "fee", 226 | "indexed": false 227 | }, 228 | { 229 | "type": "uint256", 230 | "name": "admin_fee", 231 | "indexed": false 232 | } 233 | ], 234 | "anonymous": false, 235 | "type": "event" 236 | }, 237 | { 238 | "name": "get_virtual_price", 239 | "outputs": [ 240 | { 241 | "type": "uint256", 242 | "name": "out" 243 | } 244 | ], 245 | "inputs": [], 246 | "constant": true, 247 | "payable": false, 248 | "type": "function", 249 | "gas": 1084167 250 | }, 251 | { 252 | "name": "calc_token_amount", 253 | "outputs": [ 254 | { 255 | "type": "uint256", 256 | "name": "out" 257 | } 258 | ], 259 | "inputs": [ 260 | { 261 | "type": "uint256[2]", 262 | "name": "amounts" 263 | }, 264 | { 265 | "type": "bool", 266 | "name": "deposit" 267 | } 268 | ], 269 | "constant": true, 270 | "payable": false, 271 | "type": "function", 272 | "gas": 4239939 273 | }, 274 | { 275 | "name": "get_dy", 276 | "outputs": [ 277 | { 278 | "type": "uint256", 279 | "name": "out" 280 | } 281 | ], 282 | "inputs": [ 283 | { 284 | "type": "int128", 285 | "name": "i" 286 | }, 287 | { 288 | "type": "int128", 289 | "name": "j" 290 | }, 291 | { 292 | "type": "uint256", 293 | "name": "dx" 294 | } 295 | ], 296 | "constant": true, 297 | "payable": false, 298 | "type": "function", 299 | "gas": 2543681 300 | }, 301 | { 302 | "name": "get_dy_underlying", 303 | "outputs": [ 304 | { 305 | "type": "uint256", 306 | "name": "out" 307 | } 308 | ], 309 | "inputs": [ 310 | { 311 | "type": "int128", 312 | "name": "i" 313 | }, 314 | { 315 | "type": "int128", 316 | "name": "j" 317 | }, 318 | { 319 | "type": "uint256", 320 | "name": "dx" 321 | } 322 | ], 323 | "constant": true, 324 | "payable": false, 325 | "type": "function", 326 | "gas": 2543506 327 | }, 328 | { 329 | "name": "coins", 330 | "outputs": [ 331 | { 332 | "type": "address", 333 | "name": "out" 334 | } 335 | ], 336 | "inputs": [ 337 | { 338 | "type": "int128", 339 | "name": "arg0" 340 | } 341 | ], 342 | "constant": true, 343 | "payable": false, 344 | "type": "function", 345 | "gas": 2190 346 | }, 347 | { 348 | "name": "underlying_coins", 349 | "outputs": [ 350 | { 351 | "type": "address", 352 | "name": "out" 353 | } 354 | ], 355 | "inputs": [ 356 | { 357 | "type": "int128", 358 | "name": "arg0" 359 | } 360 | ], 361 | "constant": true, 362 | "payable": false, 363 | "type": "function", 364 | "gas": 2220 365 | }, 366 | { 367 | "name": "balances", 368 | "outputs": [ 369 | { 370 | "type": "uint256", 371 | "name": "out" 372 | } 373 | ], 374 | "inputs": [ 375 | { 376 | "type": "int128", 377 | "name": "arg0" 378 | } 379 | ], 380 | "constant": true, 381 | "payable": false, 382 | "type": "function", 383 | "gas": 2250 384 | }, 385 | { 386 | "name": "A", 387 | "outputs": [ 388 | { 389 | "type": "uint256", 390 | "name": "out" 391 | } 392 | ], 393 | "inputs": [], 394 | "constant": true, 395 | "payable": false, 396 | "type": "function", 397 | "gas": 2081 398 | }, 399 | { 400 | "name": "fee", 401 | "outputs": [ 402 | { 403 | "type": "uint256", 404 | "name": "out" 405 | } 406 | ], 407 | "inputs": [], 408 | "constant": true, 409 | "payable": false, 410 | "type": "function", 411 | "gas": 2111 412 | }, 413 | { 414 | "name": "admin_fee", 415 | "outputs": [ 416 | { 417 | "type": "uint256", 418 | "name": "out" 419 | } 420 | ], 421 | "inputs": [], 422 | "constant": true, 423 | "payable": false, 424 | "type": "function", 425 | "gas": 2141 426 | }, 427 | { 428 | "name": "owner", 429 | "outputs": [ 430 | { 431 | "type": "address", 432 | "name": "out" 433 | } 434 | ], 435 | "inputs": [], 436 | "constant": true, 437 | "payable": false, 438 | "type": "function", 439 | "gas": 2171 440 | }, 441 | { 442 | "name": "admin_actions_deadline", 443 | "outputs": [ 444 | { 445 | "type": "uint256", 446 | "unit": "sec", 447 | "name": "out" 448 | } 449 | ], 450 | "inputs": [], 451 | "constant": true, 452 | "payable": false, 453 | "type": "function", 454 | "gas": 2201 455 | }, 456 | { 457 | "name": "transfer_ownership_deadline", 458 | "outputs": [ 459 | { 460 | "type": "uint256", 461 | "unit": "sec", 462 | "name": "out" 463 | } 464 | ], 465 | "inputs": [], 466 | "constant": true, 467 | "payable": false, 468 | "type": "function", 469 | "gas": 2231 470 | }, 471 | { 472 | "name": "future_A", 473 | "outputs": [ 474 | { 475 | "type": "uint256", 476 | "name": "out" 477 | } 478 | ], 479 | "inputs": [], 480 | "constant": true, 481 | "payable": false, 482 | "type": "function", 483 | "gas": 2261 484 | }, 485 | { 486 | "name": "future_fee", 487 | "outputs": [ 488 | { 489 | "type": "uint256", 490 | "name": "out" 491 | } 492 | ], 493 | "inputs": [], 494 | "constant": true, 495 | "payable": false, 496 | "type": "function", 497 | "gas": 2291 498 | }, 499 | { 500 | "name": "future_admin_fee", 501 | "outputs": [ 502 | { 503 | "type": "uint256", 504 | "name": "out" 505 | } 506 | ], 507 | "inputs": [], 508 | "constant": true, 509 | "payable": false, 510 | "type": "function", 511 | "gas": 2321 512 | }, 513 | { 514 | "name": "future_owner", 515 | "outputs": [ 516 | { 517 | "type": "address", 518 | "name": "out" 519 | } 520 | ], 521 | "inputs": [], 522 | "constant": true, 523 | "payable": false, 524 | "type": "function", 525 | "gas": 2351 526 | } 527 | ] 528 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "curve-subgraph", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "private": true, 6 | "scripts": { 7 | "auth": "graph auth https://api.thegraph.com/deploy/", 8 | "build": "graph build", 9 | "codegen": "graph codegen", 10 | "create-local": "graph create --node http://localhost:8020/ protofire/curve", 11 | "deploy": "graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ protofire/curve", 12 | "deploy-local": "graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 protofire/curve", 13 | "remove-local": "graph remove --node http://localhost:8020/ protofire/curve" 14 | }, 15 | "dependencies": { 16 | "@graphprotocol/graph-cli": "0.19.0", 17 | "@graphprotocol/graph-ts": "0.19.0", 18 | "@protofire/subgraph-toolkit": "0.1.1" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /prettier.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@protofire/subgraph-toolkit/prettier.config.js') 2 | -------------------------------------------------------------------------------- /schema.graphql: -------------------------------------------------------------------------------- 1 | type SystemInfo @entity { 2 | id: ID! 3 | 4 | registryOwner: Bytes 5 | 6 | exchangeCount: BigInt! 7 | poolCount: BigInt! 8 | tokenCount: BigInt! 9 | 10 | updated: BigInt! 11 | updatedAtBlock: BigInt! 12 | updatedAtTransaction: Bytes! 13 | } 14 | 15 | type Pool @entity { 16 | id: ID! 17 | 18 | " Swap contract address " 19 | address: Bytes! 20 | 21 | " Number of coins composing the pool " 22 | coinCount: Int! 23 | 24 | " Wrapped coins involved in the pool " 25 | coins: [Token!]! 26 | 27 | " Plain coins (ERC20) " 28 | underlyingCoins: [Token!]! 29 | 30 | balances: [BigInt!]! 31 | 32 | " Address of the token representing LP share " 33 | poolToken: Token 34 | 35 | " Amplification coefficient multiplied by n * (n - 1) " 36 | A: BigInt! 37 | 38 | " Fee to charge for exchanges " 39 | fee: BigDecimal! 40 | 41 | " " 42 | adminFee: BigDecimal! 43 | 44 | " Average dollar value of pool token " 45 | virtualPrice: BigDecimal! 46 | 47 | rateMethodId: Bytes 48 | 49 | " Admins address " 50 | owner: Bytes! 51 | 52 | addedAt: BigInt! 53 | addedAtBlock: BigInt! 54 | addedAtTransaction: Bytes! 55 | 56 | removedAt: BigInt 57 | removedAtBlock: BigInt 58 | removedAtTransaction: Bytes 59 | 60 | events: [PoolEvent!] @derivedFrom(field: "pool") 61 | 62 | exchanges: [Exchange!] @derivedFrom(field: "pool") 63 | } 64 | 65 | interface PoolEvent @entity { 66 | pool: Pool! 67 | 68 | block: BigInt! 69 | timestamp: BigInt! 70 | transaction: Bytes! 71 | } 72 | 73 | type FeeChangeChangelog implements PoolEvent @entity { 74 | id: ID! 75 | pool: Pool! 76 | value: BigDecimal! 77 | 78 | block: BigInt! 79 | timestamp: BigInt! 80 | transaction: Bytes! 81 | } 82 | 83 | type AdminFeeChangelog implements PoolEvent @entity { 84 | id: ID! 85 | pool: Pool! 86 | value: BigDecimal! 87 | 88 | block: BigInt! 89 | timestamp: BigInt! 90 | transaction: Bytes! 91 | } 92 | 93 | type AmplificationCoeffChangelog implements PoolEvent @entity { 94 | id: ID! 95 | pool: Pool! 96 | value: BigInt! 97 | 98 | block: BigInt! 99 | timestamp: BigInt! 100 | transaction: Bytes! 101 | } 102 | 103 | type AddLiquidityEvent implements PoolEvent @entity { 104 | id: ID! 105 | pool: Pool! 106 | provider: Bytes! 107 | tokenAmounts: [BigInt!]! 108 | fees: [BigInt!]! 109 | invariant: BigInt! 110 | tokenSupply: BigInt! 111 | 112 | block: BigInt! 113 | timestamp: BigInt! 114 | transaction: Bytes! 115 | } 116 | 117 | type RemoveLiquidityEvent implements PoolEvent @entity { 118 | id: ID! 119 | pool: Pool! 120 | provider: Bytes! 121 | tokenAmounts: [BigInt!]! 122 | fees: [BigInt!]! 123 | invariant: BigInt 124 | tokenSupply: BigInt! 125 | 126 | block: BigInt! 127 | timestamp: BigInt! 128 | transaction: Bytes! 129 | } 130 | 131 | interface Exchange { 132 | pool: Pool! 133 | 134 | buyer: Bytes! 135 | soldId: BigInt! 136 | tokensSold: BigInt! 137 | boughtId: BigInt! 138 | tokensBought: BigInt! 139 | 140 | block: BigInt! 141 | timestamp: BigInt! 142 | transaction: Bytes! 143 | } 144 | 145 | type TokenExchange implements Exchange @entity { 146 | id: ID! 147 | pool: Pool! 148 | buyer: Bytes! 149 | soldId: BigInt! 150 | tokensSold: BigInt! 151 | boughtId: BigInt! 152 | tokensBought: BigInt! 153 | 154 | block: BigInt! 155 | timestamp: BigInt! 156 | transaction: Bytes! 157 | } 158 | 159 | type UnderlyingTokenExchange implements Exchange @entity { 160 | id: ID! 161 | pool: Pool! 162 | buyer: Bytes! 163 | soldId: BigInt! 164 | tokensSold: BigInt! 165 | boughtId: BigInt! 166 | tokensBought: BigInt! 167 | 168 | block: BigInt! 169 | timestamp: BigInt! 170 | transaction: Bytes! 171 | } 172 | 173 | type TransferOwnershipEvent implements PoolEvent @entity { 174 | id: ID! 175 | pool: Pool! 176 | newAdmin: Bytes! 177 | 178 | block: BigInt! 179 | timestamp: BigInt! 180 | transaction: Bytes! 181 | } 182 | 183 | type Token @entity { 184 | id: ID! 185 | address: Bytes! 186 | decimals: BigInt! 187 | name: String 188 | symbol: String 189 | } 190 | -------------------------------------------------------------------------------- /src/entities/index.ts: -------------------------------------------------------------------------------- 1 | export { getSystemInfo } from './system' 2 | 3 | export { getOrCreatePool, getBalances } from './pool' 4 | export { getOrCreateToken } from './token' 5 | 6 | export { toFeeDecimal } from './utils' 7 | -------------------------------------------------------------------------------- /src/entities/pool.ts: -------------------------------------------------------------------------------- 1 | import { Address, BigInt, ethereum } from '@graphprotocol/graph-ts' 2 | import { decimal, integer, ZERO_ADDRESS } from '@protofire/subgraph-toolkit' 3 | 4 | import { StableSwap } from '../../generated/Curve/StableSwap' 5 | import { Pool } from '../../generated/schema' 6 | 7 | import { getOrCreateToken, getSystemInfo, toFeeDecimal } from './index' 8 | 9 | class PoolInfo { 10 | coins: Address[] 11 | underlyingCoins: Address[] 12 | balances: BigInt[] 13 | A: BigInt 14 | fee: BigInt 15 | adminFee: BigInt 16 | owner: Address 17 | virtualPrice: BigInt 18 | } 19 | 20 | export function getOrCreatePool(address: Address, block: ethereum.Block, tx: ethereum.Transaction): Pool { 21 | let pool = Pool.load(address.toHexString()) 22 | 23 | if (pool == null) { 24 | let info = getPoolInfo(address) 25 | 26 | pool = new Pool(address.toHexString()) 27 | pool.address = address 28 | pool.balances = info.balances 29 | pool.coinCount = info.coins.length 30 | pool.coins = registerTokens(info.coins, block, tx) 31 | pool.underlyingCoins = registerTokens(info.underlyingCoins, block, tx) 32 | 33 | pool.A = info.A 34 | pool.fee = toFeeDecimal(info.fee) 35 | pool.adminFee = toFeeDecimal(info.adminFee) 36 | 37 | pool.owner = info.owner 38 | 39 | pool.virtualPrice = decimal.fromBigInt(info.virtualPrice) 40 | 41 | pool.addedAt = block.timestamp 42 | pool.addedAtBlock = block.number 43 | pool.addedAtTransaction = tx.hash 44 | 45 | pool.save() 46 | 47 | let system = getSystemInfo(block, tx) 48 | system.poolCount = system.poolCount.plus(integer.ONE) 49 | system.save() 50 | } 51 | 52 | return pool as Pool 53 | } 54 | 55 | // Gets poll info from swap contract 56 | export function getPoolInfo(swap: Address): PoolInfo { 57 | let swapContract = StableSwap.bind(swap) 58 | 59 | let coins: Address[] = [] 60 | let underlyingCoins: Address[] = [] 61 | let balances: BigInt[] = [] 62 | 63 | let c: ethereum.CallResult
64 | let u: ethereum.CallResult
65 | let b: ethereum.CallResult 66 | 67 | let i = integer.ZERO 68 | 69 | do { 70 | c = swapContract.try_coins(i) 71 | u = swapContract.try_underlying_coins(i) 72 | b = swapContract.try_balances(i) 73 | 74 | if (!c.reverted && c.value.toHexString() != ZERO_ADDRESS) { 75 | coins.push(c.value) 76 | } 77 | 78 | if (!u.reverted && u.value.toHexString() != ZERO_ADDRESS) { 79 | underlyingCoins.push(u.value) 80 | } 81 | 82 | if (!b.reverted) { 83 | balances.push(b.value) 84 | } 85 | 86 | i = i.plus(integer.ONE) 87 | } while (!c.reverted && !u.reverted && !b.reverted) 88 | 89 | return { 90 | coins, 91 | underlyingCoins, 92 | balances, 93 | A: swapContract.A(), 94 | fee: swapContract.fee(), 95 | adminFee: swapContract.admin_fee(), 96 | owner: swapContract.owner(), 97 | virtualPrice: swapContract.get_virtual_price(), 98 | } 99 | } 100 | 101 | export function getBalances(swap: Address, N_COINS: i32): BigInt[] { 102 | let swapContract = StableSwap.bind(swap) 103 | let balances = new Array(N_COINS) 104 | 105 | for (let i = 0; i < N_COINS; ++i) { 106 | let index = BigInt.fromI32(i) 107 | 108 | balances[i] = swapContract.balances(index) 109 | } 110 | 111 | return balances 112 | } 113 | 114 | function registerTokens(list: Address[], block: ethereum.Block, tx: ethereum.Transaction): string[] { 115 | let result: string[] = [] 116 | 117 | for (let i = 0; i < list.length; ++i) { 118 | let current = list[i] 119 | 120 | if (current.toHexString() != ZERO_ADDRESS) { 121 | let token = getOrCreateToken(current, block, tx) 122 | 123 | result.push(token.id) 124 | } 125 | } 126 | 127 | return result 128 | } 129 | -------------------------------------------------------------------------------- /src/entities/system.ts: -------------------------------------------------------------------------------- 1 | import { ethereum } from '@graphprotocol/graph-ts' 2 | import { integer } from '@protofire/subgraph-toolkit' 3 | 4 | import { SystemInfo } from '../../generated/schema' 5 | 6 | export function getSystemInfo(block: ethereum.Block, tx: ethereum.Transaction): SystemInfo { 7 | let state = SystemInfo.load('current') 8 | 9 | if (state == null) { 10 | state = new SystemInfo('current') 11 | 12 | state.exchangeCount = integer.ZERO 13 | state.poolCount = integer.ZERO 14 | state.tokenCount = integer.ZERO 15 | } 16 | 17 | state.updated = block.timestamp 18 | state.updatedAtBlock = block.number 19 | state.updatedAtTransaction = tx.hash 20 | 21 | return state as SystemInfo 22 | } 23 | -------------------------------------------------------------------------------- /src/entities/token.ts: -------------------------------------------------------------------------------- 1 | import { Address, BigInt, ethereum } from '@graphprotocol/graph-ts' 2 | import { integer } from '@protofire/subgraph-toolkit' 3 | 4 | import { ERC20 } from '../../generated/Curve/ERC20' 5 | import { Token } from '../../generated/schema' 6 | 7 | import { getSystemInfo } from './system' 8 | 9 | export function getOrCreateToken(address: Address, block: ethereum.Block, tx: ethereum.Transaction): Token { 10 | let token = Token.load(address.toHexString()) 11 | 12 | if (token == null) { 13 | let erc20 = ERC20.bind(address) 14 | 15 | let name = erc20.try_name() 16 | let symbol = erc20.try_symbol() 17 | let decimals = erc20.try_decimals() 18 | 19 | token = new Token(address.toHexString()) 20 | token.address = address 21 | token.name = name.reverted ? null : name.value.toString() 22 | token.symbol = symbol.reverted ? null : symbol.value.toString() 23 | token.decimals = BigInt.fromI32(decimals.reverted ? 18 : decimals.value) 24 | token.save() 25 | 26 | let system = getSystemInfo(block, tx) 27 | system.tokenCount = system.tokenCount.plus(integer.ONE) 28 | system.save() 29 | } 30 | 31 | return token as Token 32 | } 33 | -------------------------------------------------------------------------------- /src/entities/utils.ts: -------------------------------------------------------------------------------- 1 | import { BigDecimal, BigInt } from '@graphprotocol/graph-ts' 2 | import { decimal } from '@protofire/subgraph-toolkit' 3 | 4 | const FEE_DECIMALS = 10 5 | 6 | export function toFeeDecimal(value: BigInt): BigDecimal { 7 | return decimal.fromBigInt(value, FEE_DECIMALS) 8 | } 9 | -------------------------------------------------------------------------------- /src/mapping/registry.ts: -------------------------------------------------------------------------------- 1 | import { integer } from '@protofire/subgraph-toolkit' 2 | 3 | import { CurveRegistry, PoolAdded, PoolRemoved, TokenExchange, NewAdmin } from '../../generated/Curve/CurveRegistry' 4 | 5 | import { Pool } from '../../generated/schema' 6 | 7 | import { getOrCreatePool, getOrCreateToken, getSystemInfo } from '../entities' 8 | 9 | export function handlePoolAdded(event: PoolAdded): void { 10 | let pool = getOrCreatePool(event.params.pool, event.block, event.transaction) 11 | 12 | let registry = CurveRegistry.bind(event.address) 13 | let poolInfo = registry.get_pool_info(event.params.pool) 14 | let lpToken = getOrCreateToken(poolInfo.lp_token, event.block, event.transaction) 15 | 16 | pool.poolToken = lpToken.id 17 | pool.rateMethodId = event.params.rate_method_id 18 | 19 | pool.addedAt = event.block.timestamp 20 | pool.addedAtBlock = event.block.number 21 | pool.addedAtTransaction = event.transaction.hash 22 | 23 | pool.save() 24 | } 25 | 26 | export function handlePoolRemoved(event: PoolRemoved): void { 27 | let pool = Pool.load(event.params.pool.toHexString()) 28 | 29 | if (pool != null) { 30 | pool.removedAt = event.block.timestamp 31 | pool.removedAtBlock = event.block.number 32 | pool.removedAtTransaction = event.transaction.hash 33 | pool.save() 34 | 35 | let system = getSystemInfo(event.block, event.transaction) 36 | system.poolCount = system.poolCount.minus(integer.ONE) 37 | system.save() 38 | } 39 | } 40 | 41 | export function handleTokenExchange(event: TokenExchange): void { 42 | let pool = Pool.load(event.params.pool.toHexString()) 43 | 44 | if (pool != null) { 45 | // TODO 46 | } 47 | } 48 | 49 | export function handleNewAdmin(event: NewAdmin): void { 50 | let system = getSystemInfo(event.block, event.transaction) 51 | system.registryOwner = event.params.admin 52 | 53 | system.save() 54 | } 55 | -------------------------------------------------------------------------------- /src/mapping/swap.ts: -------------------------------------------------------------------------------- 1 | import { integer } from '@protofire/subgraph-toolkit' 2 | 3 | import { 4 | AddLiquidity, 5 | NewAdmin, 6 | NewParameters, 7 | RemoveLiquidity, 8 | RemoveLiquidityImbalance, 9 | TokenExchange as TokenExchangeEvent, 10 | TokenExchangeUnderlying as TokenExchangeUnderlyingEvent, 11 | } from '../../generated/Curve/StableSwap' 12 | 13 | import { 14 | AddLiquidityEvent, 15 | AdminFeeChangelog, 16 | AmplificationCoeffChangelog, 17 | FeeChangeChangelog, 18 | RemoveLiquidityEvent, 19 | TokenExchange, 20 | TransferOwnershipEvent, 21 | UnderlyingTokenExchange, 22 | } from '../../generated/schema' 23 | 24 | import { getBalances, getOrCreatePool, getSystemInfo, toFeeDecimal } from '../entities' 25 | 26 | export function handleAddLiquidity(event: AddLiquidity): void { 27 | let pool = getOrCreatePool(event.address, event.block, event.transaction) 28 | pool.balances = getBalances(event.address, pool.coinCount) 29 | 30 | pool.save() 31 | 32 | // Register liquidity event 33 | let log = new AddLiquidityEvent( 34 | 'add_liquidity' + event.transaction.hash.toHexString() + '-' + event.logType.toString(), 35 | ) 36 | 37 | log.pool = pool.id 38 | log.provider = event.params.provider 39 | log.tokenAmounts = event.params.token_amounts 40 | log.fees = event.params.fees 41 | log.invariant = event.params.invariant 42 | log.tokenSupply = event.params.token_supply 43 | 44 | log.block = event.block.number 45 | log.timestamp = event.block.timestamp 46 | log.transaction = event.transaction.hash 47 | 48 | log.save() 49 | } 50 | 51 | export function handleRemoveLiquidity(event: RemoveLiquidity): void { 52 | let pool = getOrCreatePool(event.address, event.block, event.transaction) 53 | pool.balances = getBalances(event.address, pool.coinCount) 54 | 55 | pool.save() 56 | 57 | // Register liquidity event 58 | let log = new RemoveLiquidityEvent( 59 | 'remove_liquidity' + event.transaction.hash.toHexString() + '-' + event.logType.toString(), 60 | ) 61 | 62 | log.pool = pool.id 63 | log.provider = event.params.provider 64 | log.tokenAmounts = event.params.token_amounts 65 | log.fees = event.params.fees 66 | log.tokenSupply = event.params.token_supply 67 | 68 | log.block = event.block.number 69 | log.timestamp = event.block.timestamp 70 | log.transaction = event.transaction.hash 71 | 72 | log.save() 73 | } 74 | 75 | export function handleRemoveLiquidityImbalance(event: RemoveLiquidityImbalance): void { 76 | let pool = getOrCreatePool(event.address, event.block, event.transaction) 77 | pool.balances = getBalances(event.address, pool.coinCount) 78 | 79 | pool.save() 80 | 81 | // Register liquidity event 82 | let log = new RemoveLiquidityEvent( 83 | 'remove_liquidity_imbalance-' + event.transaction.hash.toHexString() + '-' + event.logType.toString(), 84 | ) 85 | 86 | log.pool = pool.id 87 | log.provider = event.params.provider 88 | log.tokenAmounts = event.params.token_amounts 89 | log.fees = event.params.fees 90 | log.invariant = event.params.invariant 91 | log.tokenSupply = event.params.token_supply 92 | 93 | log.block = event.block.number 94 | log.timestamp = event.block.timestamp 95 | log.transaction = event.transaction.hash 96 | 97 | log.save() 98 | } 99 | 100 | export function handleNewAdmin(event: NewAdmin): void { 101 | let pool = getOrCreatePool(event.address, event.block, event.transaction) 102 | pool.owner = event.params.admin 103 | 104 | pool.save() 105 | 106 | // Register changelog 107 | let log = new TransferOwnershipEvent( 108 | 'transfer-' + event.transaction.hash.toHexString() + '-' + event.logType.toString(), 109 | ) 110 | 111 | log.pool = pool.id 112 | log.newAdmin = event.params.admin 113 | 114 | log.block = event.block.number 115 | log.timestamp = event.block.timestamp 116 | log.transaction = event.transaction.hash 117 | 118 | log.save() 119 | } 120 | 121 | export function handleNewParameters(event: NewParameters): void { 122 | let pool = getOrCreatePool(event.address, event.block, event.transaction) 123 | 124 | let newFee = toFeeDecimal(event.params.fee) 125 | let newAdminFee = toFeeDecimal(event.params.admin_fee) 126 | 127 | if (pool.A != event.params.A) { 128 | pool.A = event.params.A 129 | 130 | // Register changelog 131 | let log = new AmplificationCoeffChangelog( 132 | 'A-' + event.transaction.hash.toHexString() + '-' + event.logType.toString(), 133 | ) 134 | 135 | log.pool = pool.id 136 | log.value = event.params.A 137 | 138 | log.block = event.block.number 139 | log.timestamp = event.block.timestamp 140 | log.transaction = event.transaction.hash 141 | 142 | log.save() 143 | } 144 | 145 | if (pool.fee != newFee) { 146 | pool.fee = newFee 147 | 148 | // Register changelog 149 | let log = new FeeChangeChangelog('fee-' + event.transaction.hash.toHexString() + '-' + event.logType.toString()) 150 | 151 | log.pool = pool.id 152 | log.value = newFee 153 | 154 | log.block = event.block.number 155 | log.timestamp = event.block.timestamp 156 | log.transaction = event.transaction.hash 157 | 158 | log.save() 159 | } 160 | 161 | if (pool.adminFee != newAdminFee) { 162 | pool.fee = newAdminFee 163 | 164 | // Register changelog 165 | let log = new AdminFeeChangelog( 166 | 'admin_fee-' + event.transaction.hash.toHexString() + '-' + event.logType.toString(), 167 | ) 168 | 169 | log.pool = pool.id 170 | log.value = newAdminFee 171 | 172 | log.block = event.block.number 173 | log.timestamp = event.block.timestamp 174 | log.transaction = event.transaction.hash 175 | 176 | log.save() 177 | } 178 | 179 | pool.save() 180 | } 181 | 182 | export function handleTokenExchange(event: TokenExchangeEvent): void { 183 | let pool = getOrCreatePool(event.address, event.block, event.transaction) 184 | 185 | if (pool != null) { 186 | let exchange = new TokenExchange( 187 | pool.id + '-c-' + event.params.sold_id.toString() + '-' + event.params.bought_id.toString(), 188 | ) 189 | 190 | exchange.pool = pool.id 191 | exchange.buyer = event.params.buyer 192 | exchange.soldId = event.params.sold_id 193 | exchange.tokensSold = event.params.tokens_sold 194 | exchange.boughtId = event.params.bought_id 195 | exchange.tokensBought = event.params.tokens_bought 196 | 197 | exchange.block = event.block.number 198 | exchange.timestamp = event.block.timestamp 199 | exchange.transaction = event.transaction.hash 200 | 201 | exchange.save() 202 | 203 | let system = getSystemInfo(event.block, event.transaction) 204 | system.exchangeCount = system.exchangeCount.plus(integer.ONE) 205 | system.save() 206 | } 207 | } 208 | 209 | export function handleTokenExchangeUnderlying(event: TokenExchangeUnderlyingEvent): void { 210 | let pool = getOrCreatePool(event.address, event.block, event.transaction) 211 | 212 | if (pool != null) { 213 | let exchange = new UnderlyingTokenExchange( 214 | pool.id + '-u-' + event.params.sold_id.toString() + '-' + event.params.bought_id.toString(), 215 | ) 216 | 217 | exchange.pool = pool.id 218 | exchange.buyer = event.params.buyer 219 | exchange.soldId = event.params.sold_id 220 | exchange.tokensSold = event.params.tokens_sold 221 | exchange.boughtId = event.params.bought_id 222 | exchange.tokensBought = event.params.tokens_bought 223 | 224 | exchange.block = event.block.number 225 | exchange.timestamp = event.block.timestamp 226 | exchange.transaction = event.transaction.hash 227 | 228 | exchange.save() 229 | 230 | let system = getSystemInfo(event.block, event.transaction) 231 | system.exchangeCount = system.exchangeCount.plus(integer.ONE) 232 | system.save() 233 | } 234 | } 235 | -------------------------------------------------------------------------------- /subgraph.yaml: -------------------------------------------------------------------------------- 1 | description: Exchange/DeFi savings tool for stablecoins 2 | specVersion: 0.0.2 3 | 4 | schema: 5 | file: ./schema.graphql 6 | 7 | dataSources: 8 | - name: Curve 9 | kind: ethereum/contract 10 | network: mainnet 11 | source: 12 | abi: CurveRegistry 13 | address: '0x7002b727ef8f5571cb5f9d70d13dbeeb4dfae9d1' 14 | startBlock: 10302524 15 | mapping: 16 | kind: ethereum/events 17 | apiVersion: 0.0.4 18 | language: wasm/assemblyscript 19 | file: ./src/mapping/registry.ts 20 | abis: 21 | - name: CurveRegistry 22 | file: ./abis/CurveRegistry.json 23 | - name: StableSwap 24 | file: ./abis/StableSwap.json 25 | - name: ERC20 26 | file: ./abis/ERC20.json 27 | entities: 28 | - Pool 29 | - SystemInfo 30 | - Token 31 | eventHandlers: 32 | - event: PoolAdded(indexed address,bytes) 33 | handler: handlePoolAdded 34 | - event: PoolRemoved(indexed address) 35 | handler: handlePoolRemoved 36 | - event: TokenExchange(indexed address,indexed address,address,address,uint256,uint256) 37 | handler: handleTokenExchange 38 | - event: NewAdmin(indexed address) 39 | handler: handleNewAdmin 40 | 41 | # 42 | # Pools 43 | # 44 | 45 | - name: Swap/Compound 46 | kind: ethereum/contract 47 | network: mainnet 48 | source: 49 | abi: StableSwap 50 | address: '0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56' 51 | startBlock: 9554040 52 | mapping: 53 | kind: ethereum/events 54 | apiVersion: 0.0.4 55 | language: wasm/assemblyscript 56 | file: ./src/mapping/swap.ts 57 | abis: 58 | - name: StableSwap 59 | file: ./abis/StableSwap.json 60 | - name: ERC20 61 | file: ./abis/ERC20.json 62 | entities: 63 | - AddLiquidityEvent 64 | - AdminFeeChangelog 65 | - AmplificationCoeffChangelog 66 | - Exchange 67 | - FeeChangeChangelog 68 | - Pool 69 | - RemoveLiquidityEvent 70 | - SystemInfo 71 | - TransferOwnershipEvent 72 | - Token 73 | eventHandlers: 74 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 75 | handler: handleAddLiquidity 76 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 77 | handler: handleRemoveLiquidity 78 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 79 | handler: handleRemoveLiquidityImbalance 80 | - event: NewAdmin(indexed address) 81 | handler: handleNewAdmin 82 | - event: NewParameters(uint256,uint256,uint256) 83 | handler: handleNewParameters 84 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 85 | handler: handleTokenExchange 86 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 87 | handler: handleTokenExchangeUnderlying 88 | 89 | - name: Swap/USDT 90 | kind: ethereum/contract 91 | network: mainnet 92 | source: 93 | abi: StableSwap 94 | address: '0x52ea46506b9cc5ef470c5bf89f17dc28bb35d85c' 95 | startBlock: 9456293 96 | mapping: 97 | kind: ethereum/events 98 | apiVersion: 0.0.4 99 | language: wasm/assemblyscript 100 | file: ./src/mapping/swap.ts 101 | abis: 102 | - name: StableSwap 103 | file: ./abis/StableSwap.json 104 | - name: ERC20 105 | file: ./abis/ERC20.json 106 | entities: 107 | - AddLiquidityEvent 108 | - AdminFeeChangelog 109 | - AmplificationCoeffChangelog 110 | - Exchange 111 | - FeeChangeChangelog 112 | - Pool 113 | - RemoveLiquidityEvent 114 | - SystemInfo 115 | - TransferOwnershipEvent 116 | - Token 117 | eventHandlers: 118 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 119 | handler: handleAddLiquidity 120 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 121 | handler: handleRemoveLiquidity 122 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 123 | handler: handleRemoveLiquidityImbalance 124 | - event: NewAdmin(indexed address) 125 | handler: handleNewAdmin 126 | - event: NewParameters(uint256,uint256,uint256) 127 | handler: handleNewParameters 128 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 129 | handler: handleTokenExchange 130 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 131 | handler: handleTokenExchangeUnderlying 132 | 133 | - name: Swap/PAX 134 | kind: ethereum/contract 135 | network: mainnet 136 | source: 137 | abi: StableSwap 138 | address: '0x06364f10b501e868329afbc005b3492902d6c763' 139 | startBlock: 10041041 140 | mapping: 141 | kind: ethereum/events 142 | apiVersion: 0.0.4 143 | language: wasm/assemblyscript 144 | file: ./src/mapping/swap.ts 145 | abis: 146 | - name: StableSwap 147 | file: ./abis/StableSwap.json 148 | - name: ERC20 149 | file: ./abis/ERC20.json 150 | entities: 151 | - AddLiquidityEvent 152 | - AdminFeeChangelog 153 | - AmplificationCoeffChangelog 154 | - Exchange 155 | - FeeChangeChangelog 156 | - Pool 157 | - RemoveLiquidityEvent 158 | - SystemInfo 159 | - TransferOwnershipEvent 160 | - Token 161 | eventHandlers: 162 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 163 | handler: handleAddLiquidity 164 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 165 | handler: handleRemoveLiquidity 166 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 167 | handler: handleRemoveLiquidityImbalance 168 | - event: NewAdmin(indexed address) 169 | handler: handleNewAdmin 170 | - event: NewParameters(uint256,uint256,uint256) 171 | handler: handleNewParameters 172 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 173 | handler: handleTokenExchange 174 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 175 | handler: handleTokenExchangeUnderlying 176 | 177 | - name: Swap/y 178 | kind: ethereum/contract 179 | network: mainnet 180 | source: 181 | abi: StableSwap 182 | address: '0x45f783cce6b7ff23b2ab2d70e416cdb7d6055f51' 183 | startBlock: 9476468 184 | mapping: 185 | kind: ethereum/events 186 | apiVersion: 0.0.4 187 | language: wasm/assemblyscript 188 | file: ./src/mapping/swap.ts 189 | abis: 190 | - name: StableSwap 191 | file: ./abis/StableSwap.json 192 | - name: ERC20 193 | file: ./abis/ERC20.json 194 | entities: 195 | - AddLiquidityEvent 196 | - AdminFeeChangelog 197 | - AmplificationCoeffChangelog 198 | - Exchange 199 | - FeeChangeChangelog 200 | - Pool 201 | - RemoveLiquidityEvent 202 | - SystemInfo 203 | - TransferOwnershipEvent 204 | - Token 205 | eventHandlers: 206 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 207 | handler: handleAddLiquidity 208 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 209 | handler: handleRemoveLiquidity 210 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 211 | handler: handleRemoveLiquidityImbalance 212 | - event: NewAdmin(indexed address) 213 | handler: handleNewAdmin 214 | - event: NewParameters(uint256,uint256,uint256) 215 | handler: handleNewParameters 216 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 217 | handler: handleTokenExchange 218 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 219 | handler: handleTokenExchangeUnderlying 220 | 221 | - name: Swap/BUSD 222 | kind: ethereum/contract 223 | network: mainnet 224 | source: 225 | abi: StableSwap 226 | address: '0x79a8c46dea5ada233abaffd40f3a0a2b1e5a4f27' 227 | startBlock: 9567295 228 | mapping: 229 | kind: ethereum/events 230 | apiVersion: 0.0.4 231 | language: wasm/assemblyscript 232 | file: ./src/mapping/swap.ts 233 | abis: 234 | - name: StableSwap 235 | file: ./abis/StableSwap.json 236 | - name: ERC20 237 | file: ./abis/ERC20.json 238 | entities: 239 | - AddLiquidityEvent 240 | - AdminFeeChangelog 241 | - AmplificationCoeffChangelog 242 | - Exchange 243 | - FeeChangeChangelog 244 | - Pool 245 | - RemoveLiquidityEvent 246 | - SystemInfo 247 | - TransferOwnershipEvent 248 | - Token 249 | eventHandlers: 250 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 251 | handler: handleAddLiquidity 252 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 253 | handler: handleRemoveLiquidity 254 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 255 | handler: handleRemoveLiquidityImbalance 256 | - event: NewAdmin(indexed address) 257 | handler: handleNewAdmin 258 | - event: NewParameters(uint256,uint256,uint256) 259 | handler: handleNewParameters 260 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 261 | handler: handleTokenExchange 262 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 263 | handler: handleTokenExchangeUnderlying 264 | 265 | - name: Swap/sUSDv2 266 | kind: ethereum/contract 267 | network: mainnet 268 | source: 269 | abi: StableSwap 270 | address: '0xa5407eae9ba41422680e2e00537571bcc53efbfd' 271 | startBlock: 9906598 272 | mapping: 273 | kind: ethereum/events 274 | apiVersion: 0.0.4 275 | language: wasm/assemblyscript 276 | file: ./src/mapping/swap.ts 277 | abis: 278 | - name: StableSwap 279 | file: ./abis/StableSwap.json 280 | - name: ERC20 281 | file: ./abis/ERC20.json 282 | entities: 283 | - AddLiquidityEvent 284 | - AdminFeeChangelog 285 | - AmplificationCoeffChangelog 286 | - Exchange 287 | - FeeChangeChangelog 288 | - Pool 289 | - RemoveLiquidityEvent 290 | - SystemInfo 291 | - TransferOwnershipEvent 292 | - Token 293 | eventHandlers: 294 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 295 | handler: handleAddLiquidity 296 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 297 | handler: handleRemoveLiquidity 298 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 299 | handler: handleRemoveLiquidityImbalance 300 | - event: NewAdmin(indexed address) 301 | handler: handleNewAdmin 302 | - event: NewParameters(uint256,uint256,uint256) 303 | handler: handleNewParameters 304 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 305 | handler: handleTokenExchange 306 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 307 | handler: handleTokenExchangeUnderlying 308 | 309 | - name: Swap/REN 310 | kind: ethereum/contract 311 | network: mainnet 312 | source: 313 | abi: StableSwap 314 | address: '0x93054188d876f558f4a66b2ef1d97d16edf0895b' 315 | startBlock: 10151385 316 | mapping: 317 | kind: ethereum/events 318 | apiVersion: 0.0.4 319 | language: wasm/assemblyscript 320 | file: ./src/mapping/swap.ts 321 | abis: 322 | - name: StableSwap 323 | file: ./abis/StableSwap.json 324 | - name: ERC20 325 | file: ./abis/ERC20.json 326 | entities: 327 | - AddLiquidityEvent 328 | - AdminFeeChangelog 329 | - AmplificationCoeffChangelog 330 | - Exchange 331 | - FeeChangeChangelog 332 | - Pool 333 | - RemoveLiquidityEvent 334 | - SystemInfo 335 | - TransferOwnershipEvent 336 | - Token 337 | eventHandlers: 338 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 339 | handler: handleAddLiquidity 340 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 341 | handler: handleRemoveLiquidity 342 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 343 | handler: handleRemoveLiquidityImbalance 344 | - event: NewAdmin(indexed address) 345 | handler: handleNewAdmin 346 | - event: NewParameters(uint256,uint256,uint256) 347 | handler: handleNewParameters 348 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 349 | handler: handleTokenExchange 350 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 351 | handler: handleTokenExchangeUnderlying 352 | 353 | - name: Swap/sBTC 354 | kind: ethereum/contract 355 | network: mainnet 356 | source: 357 | abi: StableSwap 358 | address: '0x7fc77b5c7614e1533320ea6ddc2eb61fa00a9714' 359 | startBlock: 10276641 360 | mapping: 361 | kind: ethereum/events 362 | apiVersion: 0.0.4 363 | language: wasm/assemblyscript 364 | file: ./src/mapping/swap.ts 365 | abis: 366 | - name: StableSwap 367 | file: ./abis/StableSwap.json 368 | - name: ERC20 369 | file: ./abis/ERC20.json 370 | entities: 371 | - AddLiquidityEvent 372 | - AdminFeeChangelog 373 | - AmplificationCoeffChangelog 374 | - Exchange 375 | - FeeChangeChangelog 376 | - Pool 377 | - RemoveLiquidityEvent 378 | - SystemInfo 379 | - TransferOwnershipEvent 380 | - Token 381 | eventHandlers: 382 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 383 | handler: handleAddLiquidity 384 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 385 | handler: handleRemoveLiquidity 386 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 387 | handler: handleRemoveLiquidityImbalance 388 | - event: NewAdmin(indexed address) 389 | handler: handleNewAdmin 390 | - event: NewParameters(uint256,uint256,uint256) 391 | handler: handleNewParameters 392 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 393 | handler: handleTokenExchange 394 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 395 | handler: handleTokenExchangeUnderlying 396 | 397 | - name: Swap/HBTC 398 | kind: ethereum/contract 399 | network: mainnet 400 | source: 401 | abi: StableSwap 402 | address: '0x4ca9b3063ec5866a4b82e437059d2c43d1be596f' 403 | startBlock: 10732328 404 | mapping: 405 | kind: ethereum/events 406 | apiVersion: 0.0.4 407 | language: wasm/assemblyscript 408 | file: ./src/mapping/swap.ts 409 | abis: 410 | - name: StableSwap 411 | file: ./abis/StableSwap.json 412 | - name: ERC20 413 | file: ./abis/ERC20.json 414 | entities: 415 | - AddLiquidityEvent 416 | - AdminFeeChangelog 417 | - AmplificationCoeffChangelog 418 | - Exchange 419 | - FeeChangeChangelog 420 | - Pool 421 | - RemoveLiquidityEvent 422 | - SystemInfo 423 | - TransferOwnershipEvent 424 | - Token 425 | eventHandlers: 426 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 427 | handler: handleAddLiquidity 428 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 429 | handler: handleRemoveLiquidity 430 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 431 | handler: handleRemoveLiquidityImbalance 432 | - event: NewAdmin(indexed address) 433 | handler: handleNewAdmin 434 | - event: NewParameters(uint256,uint256,uint256) 435 | handler: handleNewParameters 436 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 437 | handler: handleTokenExchange 438 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 439 | handler: handleTokenExchangeUnderlying 440 | 441 | - name: Swap/3pool 442 | kind: ethereum/contract 443 | network: mainnet 444 | source: 445 | abi: StableSwap 446 | address: '0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7' 447 | startBlock: 10809473 448 | mapping: 449 | kind: ethereum/events 450 | apiVersion: 0.0.4 451 | language: wasm/assemblyscript 452 | file: ./src/mapping/swap.ts 453 | abis: 454 | - name: StableSwap 455 | file: ./abis/StableSwap.json 456 | - name: ERC20 457 | file: ./abis/ERC20.json 458 | entities: 459 | - AddLiquidityEvent 460 | - AdminFeeChangelog 461 | - AmplificationCoeffChangelog 462 | - Exchange 463 | - FeeChangeChangelog 464 | - Pool 465 | - RemoveLiquidityEvent 466 | - SystemInfo 467 | - TransferOwnershipEvent 468 | - Token 469 | eventHandlers: 470 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 471 | handler: handleAddLiquidity 472 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 473 | handler: handleRemoveLiquidity 474 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 475 | handler: handleRemoveLiquidityImbalance 476 | - event: NewAdmin(indexed address) 477 | handler: handleNewAdmin 478 | - event: NewParameters(uint256,uint256,uint256) 479 | handler: handleNewParameters 480 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 481 | handler: handleTokenExchange 482 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 483 | handler: handleTokenExchangeUnderlying 484 | 485 | - name: Swap/GUSD 486 | kind: ethereum/contract 487 | network: mainnet 488 | source: 489 | abi: StableSwap 490 | address: '0x4f062658eaaf2c1ccf8c8e36d6824cdf41167956' 491 | startBlock: 11005604 492 | mapping: 493 | kind: ethereum/events 494 | apiVersion: 0.0.4 495 | language: wasm/assemblyscript 496 | file: ./src/mapping/swap.ts 497 | abis: 498 | - name: StableSwap 499 | file: ./abis/StableSwap.json 500 | - name: ERC20 501 | file: ./abis/ERC20.json 502 | entities: 503 | - AddLiquidityEvent 504 | - AdminFeeChangelog 505 | - AmplificationCoeffChangelog 506 | - Exchange 507 | - FeeChangeChangelog 508 | - Pool 509 | - RemoveLiquidityEvent 510 | - SystemInfo 511 | - TransferOwnershipEvent 512 | - Token 513 | eventHandlers: 514 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 515 | handler: handleAddLiquidity 516 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 517 | handler: handleRemoveLiquidity 518 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 519 | handler: handleRemoveLiquidityImbalance 520 | - event: NewAdmin(indexed address) 521 | handler: handleNewAdmin 522 | - event: NewParameters(uint256,uint256,uint256) 523 | handler: handleNewParameters 524 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 525 | handler: handleTokenExchange 526 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 527 | handler: handleTokenExchangeUnderlying 528 | 529 | - name: Swap/HUSD 530 | kind: ethereum/contract 531 | network: mainnet 532 | source: 533 | abi: StableSwap 534 | address: '0x3ef6a01a0f81d6046290f3e2a8c5b843e738e604' 535 | startBlock: 11010070 536 | mapping: 537 | kind: ethereum/events 538 | apiVersion: 0.0.4 539 | language: wasm/assemblyscript 540 | file: ./src/mapping/swap.ts 541 | abis: 542 | - name: StableSwap 543 | file: ./abis/StableSwap.json 544 | - name: ERC20 545 | file: ./abis/ERC20.json 546 | entities: 547 | - AddLiquidityEvent 548 | - AdminFeeChangelog 549 | - AmplificationCoeffChangelog 550 | - Exchange 551 | - FeeChangeChangelog 552 | - Pool 553 | - RemoveLiquidityEvent 554 | - SystemInfo 555 | - TransferOwnershipEvent 556 | - Token 557 | eventHandlers: 558 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 559 | handler: handleAddLiquidity 560 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 561 | handler: handleRemoveLiquidity 562 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 563 | handler: handleRemoveLiquidityImbalance 564 | - event: NewAdmin(indexed address) 565 | handler: handleNewAdmin 566 | - event: NewParameters(uint256,uint256,uint256) 567 | handler: handleNewParameters 568 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 569 | handler: handleTokenExchange 570 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 571 | handler: handleTokenExchangeUnderlying 572 | 573 | - name: Swap/USDK 574 | kind: ethereum/contract 575 | network: mainnet 576 | source: 577 | abi: StableSwap 578 | address: '0x3e01dd8a5e1fb3481f0f589056b428fc308af0fb' 579 | startBlock: 11010305 580 | mapping: 581 | kind: ethereum/events 582 | apiVersion: 0.0.4 583 | language: wasm/assemblyscript 584 | file: ./src/mapping/swap.ts 585 | abis: 586 | - name: StableSwap 587 | file: ./abis/StableSwap.json 588 | - name: ERC20 589 | file: ./abis/ERC20.json 590 | entities: 591 | - AddLiquidityEvent 592 | - AdminFeeChangelog 593 | - AmplificationCoeffChangelog 594 | - Exchange 595 | - FeeChangeChangelog 596 | - Pool 597 | - RemoveLiquidityEvent 598 | - SystemInfo 599 | - TransferOwnershipEvent 600 | - Token 601 | eventHandlers: 602 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 603 | handler: handleAddLiquidity 604 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 605 | handler: handleRemoveLiquidity 606 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 607 | handler: handleRemoveLiquidityImbalance 608 | - event: NewAdmin(indexed address) 609 | handler: handleNewAdmin 610 | - event: NewParameters(uint256,uint256,uint256) 611 | handler: handleNewParameters 612 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 613 | handler: handleTokenExchange 614 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 615 | handler: handleTokenExchangeUnderlying 616 | 617 | - name: Swap/USDN 618 | kind: ethereum/contract 619 | network: mainnet 620 | source: 621 | abi: StableSwap 622 | address: '0x0f9cb53ebe405d49a0bbdbd291a65ff571bc83e1' 623 | startBlock: 11010514 624 | mapping: 625 | kind: ethereum/events 626 | apiVersion: 0.0.4 627 | language: wasm/assemblyscript 628 | file: ./src/mapping/swap.ts 629 | abis: 630 | - name: StableSwap 631 | file: ./abis/StableSwap.json 632 | - name: ERC20 633 | file: ./abis/ERC20.json 634 | entities: 635 | - AddLiquidityEvent 636 | - AdminFeeChangelog 637 | - AmplificationCoeffChangelog 638 | - Exchange 639 | - FeeChangeChangelog 640 | - Pool 641 | - RemoveLiquidityEvent 642 | - SystemInfo 643 | - TransferOwnershipEvent 644 | - Token 645 | eventHandlers: 646 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 647 | handler: handleAddLiquidity 648 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 649 | handler: handleRemoveLiquidity 650 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 651 | handler: handleRemoveLiquidityImbalance 652 | - event: NewAdmin(indexed address) 653 | handler: handleNewAdmin 654 | - event: NewParameters(uint256,uint256,uint256) 655 | handler: handleNewParameters 656 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 657 | handler: handleTokenExchange 658 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 659 | handler: handleTokenExchangeUnderlying 660 | 661 | - name: Swap/LinkUSD 662 | kind: ethereum/contract 663 | network: mainnet 664 | source: 665 | abi: StableSwap 666 | address: '0xe7a24ef0c5e95ffb0f6684b813a78f2a3ad7d171' 667 | startBlock: 11011556 668 | mapping: 669 | kind: ethereum/events 670 | apiVersion: 0.0.4 671 | language: wasm/assemblyscript 672 | file: ./src/mapping/swap.ts 673 | abis: 674 | - name: StableSwap 675 | file: ./abis/StableSwap.json 676 | - name: ERC20 677 | file: ./abis/ERC20.json 678 | entities: 679 | - AddLiquidityEvent 680 | - AdminFeeChangelog 681 | - AmplificationCoeffChangelog 682 | - Exchange 683 | - FeeChangeChangelog 684 | - Pool 685 | - RemoveLiquidityEvent 686 | - SystemInfo 687 | - TransferOwnershipEvent 688 | - Token 689 | eventHandlers: 690 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 691 | handler: handleAddLiquidity 692 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 693 | handler: handleRemoveLiquidity 694 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 695 | handler: handleRemoveLiquidityImbalance 696 | - event: NewAdmin(indexed address) 697 | handler: handleNewAdmin 698 | - event: NewParameters(uint256,uint256,uint256) 699 | handler: handleNewParameters 700 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 701 | handler: handleTokenExchange 702 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 703 | handler: handleTokenExchangeUnderlying 704 | 705 | - name: Swap/MUSD 706 | kind: ethereum/contract 707 | network: mainnet 708 | source: 709 | abi: StableSwap 710 | address: '0x4f062658eaaf2c1ccf8c8e36d6824cdf41167956' 711 | startBlock: 11005604 712 | mapping: 713 | kind: ethereum/events 714 | apiVersion: 0.0.4 715 | language: wasm/assemblyscript 716 | file: ./src/mapping/swap.ts 717 | abis: 718 | - name: StableSwap 719 | file: ./abis/StableSwap.json 720 | - name: ERC20 721 | file: ./abis/ERC20.json 722 | entities: 723 | - AddLiquidityEvent 724 | - AdminFeeChangelog 725 | - AmplificationCoeffChangelog 726 | - Exchange 727 | - FeeChangeChangelog 728 | - Pool 729 | - RemoveLiquidityEvent 730 | - SystemInfo 731 | - TransferOwnershipEvent 732 | - Token 733 | eventHandlers: 734 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 735 | handler: handleAddLiquidity 736 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 737 | handler: handleRemoveLiquidity 738 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 739 | handler: handleRemoveLiquidityImbalance 740 | - event: NewAdmin(indexed address) 741 | handler: handleNewAdmin 742 | - event: NewParameters(uint256,uint256,uint256) 743 | handler: handleNewParameters 744 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 745 | handler: handleTokenExchange 746 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 747 | handler: handleTokenExchangeUnderlying 748 | 749 | - name: Swap/RSV 750 | kind: ethereum/contract 751 | network: mainnet 752 | source: 753 | abi: StableSwap 754 | address: '0xc18cc39da8b11da8c3541c598ee022258f9744da' 755 | startBlock: 11037531 756 | mapping: 757 | kind: ethereum/events 758 | apiVersion: 0.0.4 759 | language: wasm/assemblyscript 760 | file: ./src/mapping/swap.ts 761 | abis: 762 | - name: StableSwap 763 | file: ./abis/StableSwap.json 764 | - name: ERC20 765 | file: ./abis/ERC20.json 766 | entities: 767 | - AddLiquidityEvent 768 | - AdminFeeChangelog 769 | - AmplificationCoeffChangelog 770 | - Exchange 771 | - FeeChangeChangelog 772 | - Pool 773 | - RemoveLiquidityEvent 774 | - SystemInfo 775 | - TransferOwnershipEvent 776 | - Token 777 | eventHandlers: 778 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 779 | handler: handleAddLiquidity 780 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 781 | handler: handleRemoveLiquidity 782 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 783 | handler: handleRemoveLiquidityImbalance 784 | - event: NewAdmin(indexed address) 785 | handler: handleNewAdmin 786 | - event: NewParameters(uint256,uint256,uint256) 787 | handler: handleNewParameters 788 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 789 | handler: handleTokenExchange 790 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 791 | handler: handleTokenExchangeUnderlying 792 | 793 | - name: Swap/tBTC 794 | kind: ethereum/contract 795 | network: mainnet 796 | source: 797 | abi: StableSwap 798 | address: '0xc25099792e9349c7dd09759744ea681c7de2cb66' 799 | startBlock: 11095928 800 | mapping: 801 | kind: ethereum/events 802 | apiVersion: 0.0.4 803 | language: wasm/assemblyscript 804 | file: ./src/mapping/swap.ts 805 | abis: 806 | - name: StableSwap 807 | file: ./abis/StableSwap.json 808 | - name: ERC20 809 | file: ./abis/ERC20.json 810 | entities: 811 | - AddLiquidityEvent 812 | - AdminFeeChangelog 813 | - AmplificationCoeffChangelog 814 | - Exchange 815 | - FeeChangeChangelog 816 | - Pool 817 | - RemoveLiquidityEvent 818 | - SystemInfo 819 | - TransferOwnershipEvent 820 | - Token 821 | eventHandlers: 822 | - event: AddLiquidity(indexed address,uint256[2],uint256[2],uint256,uint256) 823 | handler: handleAddLiquidity 824 | - event: RemoveLiquidity(indexed address,uint256[2],uint256[2],uint256) 825 | handler: handleRemoveLiquidity 826 | - event: RemoveLiquidityImbalance(indexed address,uint256[2],uint256[2],uint256,uint256) 827 | handler: handleRemoveLiquidityImbalance 828 | - event: NewAdmin(indexed address) 829 | handler: handleNewAdmin 830 | - event: NewParameters(uint256,uint256,uint256) 831 | handler: handleNewParameters 832 | - event: TokenExchange(indexed address,int128,uint256,int128,uint256) 833 | handler: handleTokenExchange 834 | - event: TokenExchangeUnderlying(indexed address,int128,uint256,int128,uint256) 835 | handler: handleTokenExchangeUnderlying --------------------------------------------------------------------------------