├── README.md ├── .gitignore ├── package.json ├── .github └── workflows │ └── main.yml ├── abi ├── oracle.json ├── erc20.json └── masterchef.json ├── apys.js └── apy.json /README.md: -------------------------------------------------------------------------------- 1 | # apyrobot 2 | apyrobot 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | .history/ 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "apy-tool", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "axios": "^0.21.1", 13 | "lowdb": "^1.0.0", 14 | "moment": "^2.29.1", 15 | "web3": "^1.3.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: apy_robot 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the main branch 8 | # Allows you to run this workflow manually from the Actions tab 9 | workflow_dispatch: 10 | # schedule: 11 | # - cron: "0 0 * * *" 12 | 13 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 14 | jobs: 15 | # This workflow contains a single job called "build" 16 | build: 17 | # The type of runner that the job will run on 18 | runs-on: ubuntu-latest 19 | 20 | # Steps represent a sequence of tasks that will be executed as part of the job 21 | steps: 22 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 23 | - uses: actions/checkout@v2 24 | 25 | # Runs a single command using the runners shell 26 | - name: Use Node.js 16.x 27 | uses: actions/setup-node@v2 28 | with: 29 | node-version: 16.x 30 | - name: npm install 31 | run: | 32 | npm install 33 | - name: "run apy_robot" 34 | run: | 35 | node apys.js 36 | - run : git config --global --add safe.directory /github/workspace 37 | - name: Git Commit/Push Changes 38 | uses: EndBug/add-and-commit@v9 39 | with: 40 | message: "update data" 41 | -------------------------------------------------------------------------------- /abi/oracle.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "address", 6 | "name": "factory_", 7 | "type": "address" 8 | } 9 | ], 10 | "stateMutability": "nonpayable", 11 | "type": "constructor" 12 | }, 13 | { 14 | "inputs": [], 15 | "name": "CYCLE", 16 | "outputs": [ 17 | { 18 | "internalType": "uint256", 19 | "name": "", 20 | "type": "uint256" 21 | } 22 | ], 23 | "stateMutability": "view", 24 | "type": "function" 25 | }, 26 | { 27 | "inputs": [ 28 | { 29 | "internalType": "address", 30 | "name": "tokenIn", 31 | "type": "address" 32 | }, 33 | { 34 | "internalType": "uint256", 35 | "name": "amountIn", 36 | "type": "uint256" 37 | }, 38 | { 39 | "internalType": "address", 40 | "name": "tokenOut", 41 | "type": "address" 42 | } 43 | ], 44 | "name": "consult", 45 | "outputs": [ 46 | { 47 | "internalType": "uint256", 48 | "name": "amountOut", 49 | "type": "uint256" 50 | } 51 | ], 52 | "stateMutability": "view", 53 | "type": "function" 54 | }, 55 | { 56 | "inputs": [], 57 | "name": "factory", 58 | "outputs": [ 59 | { 60 | "internalType": "address", 61 | "name": "", 62 | "type": "address" 63 | } 64 | ], 65 | "stateMutability": "view", 66 | "type": "function" 67 | }, 68 | { 69 | "inputs": [ 70 | { 71 | "internalType": "address", 72 | "name": "", 73 | "type": "address" 74 | } 75 | ], 76 | "name": "pairObservations", 77 | "outputs": [ 78 | { 79 | "internalType": "uint256", 80 | "name": "timestamp", 81 | "type": "uint256" 82 | }, 83 | { 84 | "internalType": "uint256", 85 | "name": "price0Cumulative", 86 | "type": "uint256" 87 | }, 88 | { 89 | "internalType": "uint256", 90 | "name": "price1Cumulative", 91 | "type": "uint256" 92 | } 93 | ], 94 | "stateMutability": "view", 95 | "type": "function" 96 | }, 97 | { 98 | "inputs": [ 99 | { 100 | "internalType": "address", 101 | "name": "tokenA", 102 | "type": "address" 103 | }, 104 | { 105 | "internalType": "address", 106 | "name": "tokenB", 107 | "type": "address" 108 | } 109 | ], 110 | "name": "update", 111 | "outputs": [], 112 | "stateMutability": "nonpayable", 113 | "type": "function" 114 | } 115 | ] -------------------------------------------------------------------------------- /abi/erc20.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "string", 6 | "name": "name", 7 | "type": "string" 8 | }, 9 | { 10 | "internalType": "string", 11 | "name": "symbol", 12 | "type": "string" 13 | } 14 | ], 15 | "stateMutability": "nonpayable", 16 | "type": "constructor" 17 | }, 18 | { 19 | "anonymous": false, 20 | "inputs": [ 21 | { 22 | "indexed": true, 23 | "internalType": "address", 24 | "name": "owner", 25 | "type": "address" 26 | }, 27 | { 28 | "indexed": true, 29 | "internalType": "address", 30 | "name": "spender", 31 | "type": "address" 32 | }, 33 | { 34 | "indexed": false, 35 | "internalType": "uint256", 36 | "name": "value", 37 | "type": "uint256" 38 | } 39 | ], 40 | "name": "Approval", 41 | "type": "event" 42 | }, 43 | { 44 | "anonymous": false, 45 | "inputs": [ 46 | { 47 | "indexed": true, 48 | "internalType": "address", 49 | "name": "from", 50 | "type": "address" 51 | }, 52 | { 53 | "indexed": true, 54 | "internalType": "address", 55 | "name": "to", 56 | "type": "address" 57 | }, 58 | { 59 | "indexed": false, 60 | "internalType": "uint256", 61 | "name": "value", 62 | "type": "uint256" 63 | } 64 | ], 65 | "name": "Transfer", 66 | "type": "event" 67 | }, 68 | { 69 | "inputs": [], 70 | "name": "name", 71 | "outputs": [ 72 | { 73 | "internalType": "string", 74 | "name": "", 75 | "type": "string" 76 | } 77 | ], 78 | "stateMutability": "view", 79 | "type": "function" 80 | }, 81 | { 82 | "inputs": [], 83 | "name": "symbol", 84 | "outputs": [ 85 | { 86 | "internalType": "string", 87 | "name": "", 88 | "type": "string" 89 | } 90 | ], 91 | "stateMutability": "view", 92 | "type": "function" 93 | }, 94 | { 95 | "inputs": [], 96 | "name": "decimals", 97 | "outputs": [ 98 | { 99 | "internalType": "uint8", 100 | "name": "", 101 | "type": "uint8" 102 | } 103 | ], 104 | "stateMutability": "view", 105 | "type": "function" 106 | }, 107 | { 108 | "inputs": [], 109 | "name": "totalSupply", 110 | "outputs": [ 111 | { 112 | "internalType": "uint256", 113 | "name": "", 114 | "type": "uint256" 115 | } 116 | ], 117 | "stateMutability": "view", 118 | "type": "function" 119 | }, 120 | { 121 | "inputs": [ 122 | { 123 | "internalType": "address", 124 | "name": "account", 125 | "type": "address" 126 | } 127 | ], 128 | "name": "balanceOf", 129 | "outputs": [ 130 | { 131 | "internalType": "uint256", 132 | "name": "", 133 | "type": "uint256" 134 | } 135 | ], 136 | "stateMutability": "view", 137 | "type": "function" 138 | }, 139 | { 140 | "inputs": [ 141 | { 142 | "internalType": "address", 143 | "name": "recipient", 144 | "type": "address" 145 | }, 146 | { 147 | "internalType": "uint256", 148 | "name": "amount", 149 | "type": "uint256" 150 | } 151 | ], 152 | "name": "transfer", 153 | "outputs": [ 154 | { 155 | "internalType": "bool", 156 | "name": "", 157 | "type": "bool" 158 | } 159 | ], 160 | "stateMutability": "nonpayable", 161 | "type": "function" 162 | }, 163 | { 164 | "inputs": [ 165 | { 166 | "internalType": "address", 167 | "name": "owner", 168 | "type": "address" 169 | }, 170 | { 171 | "internalType": "address", 172 | "name": "spender", 173 | "type": "address" 174 | } 175 | ], 176 | "name": "allowance", 177 | "outputs": [ 178 | { 179 | "internalType": "uint256", 180 | "name": "", 181 | "type": "uint256" 182 | } 183 | ], 184 | "stateMutability": "view", 185 | "type": "function" 186 | }, 187 | { 188 | "inputs": [ 189 | { 190 | "internalType": "address", 191 | "name": "spender", 192 | "type": "address" 193 | }, 194 | { 195 | "internalType": "uint256", 196 | "name": "amount", 197 | "type": "uint256" 198 | } 199 | ], 200 | "name": "approve", 201 | "outputs": [ 202 | { 203 | "internalType": "bool", 204 | "name": "", 205 | "type": "bool" 206 | } 207 | ], 208 | "stateMutability": "nonpayable", 209 | "type": "function" 210 | }, 211 | { 212 | "inputs": [ 213 | { 214 | "internalType": "address", 215 | "name": "sender", 216 | "type": "address" 217 | }, 218 | { 219 | "internalType": "address", 220 | "name": "recipient", 221 | "type": "address" 222 | }, 223 | { 224 | "internalType": "uint256", 225 | "name": "amount", 226 | "type": "uint256" 227 | } 228 | ], 229 | "name": "transferFrom", 230 | "outputs": [ 231 | { 232 | "internalType": "bool", 233 | "name": "", 234 | "type": "bool" 235 | } 236 | ], 237 | "stateMutability": "nonpayable", 238 | "type": "function" 239 | }, 240 | { 241 | "inputs": [ 242 | { 243 | "internalType": "address", 244 | "name": "spender", 245 | "type": "address" 246 | }, 247 | { 248 | "internalType": "uint256", 249 | "name": "addedValue", 250 | "type": "uint256" 251 | } 252 | ], 253 | "name": "increaseAllowance", 254 | "outputs": [ 255 | { 256 | "internalType": "bool", 257 | "name": "", 258 | "type": "bool" 259 | } 260 | ], 261 | "stateMutability": "nonpayable", 262 | "type": "function" 263 | }, 264 | { 265 | "inputs": [ 266 | { 267 | "internalType": "address", 268 | "name": "spender", 269 | "type": "address" 270 | }, 271 | { 272 | "internalType": "uint256", 273 | "name": "subtractedValue", 274 | "type": "uint256" 275 | } 276 | ], 277 | "name": "decreaseAllowance", 278 | "outputs": [ 279 | { 280 | "internalType": "bool", 281 | "name": "", 282 | "type": "bool" 283 | } 284 | ], 285 | "stateMutability": "nonpayable", 286 | "type": "function" 287 | } 288 | ] -------------------------------------------------------------------------------- /abi/masterchef.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [ 4 | { 5 | "internalType": "contract SushiToken", 6 | "name": "_sushi", 7 | "type": "address" 8 | }, 9 | { 10 | "internalType": "address", 11 | "name": "_devaddr", 12 | "type": "address" 13 | }, 14 | { 15 | "internalType": "uint256", 16 | "name": "_sushiPerBlock", 17 | "type": "uint256" 18 | }, 19 | { 20 | "internalType": "uint256", 21 | "name": "_startBlock", 22 | "type": "uint256" 23 | }, 24 | { 25 | "internalType": "uint256", 26 | "name": "_bonusEndBlock", 27 | "type": "uint256" 28 | } 29 | ], 30 | "stateMutability": "nonpayable", 31 | "type": "constructor" 32 | }, 33 | { 34 | "anonymous": false, 35 | "inputs": [ 36 | { 37 | "indexed": true, 38 | "internalType": "address", 39 | "name": "user", 40 | "type": "address" 41 | }, 42 | { 43 | "indexed": true, 44 | "internalType": "uint256", 45 | "name": "pid", 46 | "type": "uint256" 47 | }, 48 | { 49 | "indexed": false, 50 | "internalType": "uint256", 51 | "name": "amount", 52 | "type": "uint256" 53 | } 54 | ], 55 | "name": "Deposit", 56 | "type": "event" 57 | }, 58 | { 59 | "anonymous": false, 60 | "inputs": [ 61 | { 62 | "indexed": true, 63 | "internalType": "address", 64 | "name": "user", 65 | "type": "address" 66 | }, 67 | { 68 | "indexed": true, 69 | "internalType": "uint256", 70 | "name": "pid", 71 | "type": "uint256" 72 | }, 73 | { 74 | "indexed": false, 75 | "internalType": "uint256", 76 | "name": "amount", 77 | "type": "uint256" 78 | } 79 | ], 80 | "name": "EmergencyWithdraw", 81 | "type": "event" 82 | }, 83 | { 84 | "anonymous": false, 85 | "inputs": [ 86 | { 87 | "indexed": true, 88 | "internalType": "address", 89 | "name": "previousOwner", 90 | "type": "address" 91 | }, 92 | { 93 | "indexed": true, 94 | "internalType": "address", 95 | "name": "newOwner", 96 | "type": "address" 97 | } 98 | ], 99 | "name": "OwnershipTransferred", 100 | "type": "event" 101 | }, 102 | { 103 | "anonymous": false, 104 | "inputs": [ 105 | { 106 | "indexed": true, 107 | "internalType": "address", 108 | "name": "user", 109 | "type": "address" 110 | }, 111 | { 112 | "indexed": true, 113 | "internalType": "uint256", 114 | "name": "pid", 115 | "type": "uint256" 116 | }, 117 | { 118 | "indexed": false, 119 | "internalType": "uint256", 120 | "name": "amount", 121 | "type": "uint256" 122 | } 123 | ], 124 | "name": "Withdraw", 125 | "type": "event" 126 | }, 127 | { 128 | "inputs": [], 129 | "name": "BONUS_MULTIPLIER", 130 | "outputs": [ 131 | { 132 | "internalType": "uint256", 133 | "name": "", 134 | "type": "uint256" 135 | } 136 | ], 137 | "stateMutability": "view", 138 | "type": "function", 139 | "constant": true 140 | }, 141 | { 142 | "inputs": [], 143 | "name": "bonusEndBlock", 144 | "outputs": [ 145 | { 146 | "internalType": "uint256", 147 | "name": "", 148 | "type": "uint256" 149 | } 150 | ], 151 | "stateMutability": "view", 152 | "type": "function", 153 | "constant": true 154 | }, 155 | { 156 | "inputs": [], 157 | "name": "devaddr", 158 | "outputs": [ 159 | { 160 | "internalType": "address", 161 | "name": "", 162 | "type": "address" 163 | } 164 | ], 165 | "stateMutability": "view", 166 | "type": "function", 167 | "constant": true 168 | }, 169 | { 170 | "inputs": [], 171 | "name": "migrator", 172 | "outputs": [ 173 | { 174 | "internalType": "contract IMigratorChef", 175 | "name": "", 176 | "type": "address" 177 | } 178 | ], 179 | "stateMutability": "view", 180 | "type": "function", 181 | "constant": true 182 | }, 183 | { 184 | "inputs": [], 185 | "name": "owner", 186 | "outputs": [ 187 | { 188 | "internalType": "address", 189 | "name": "", 190 | "type": "address" 191 | } 192 | ], 193 | "stateMutability": "view", 194 | "type": "function", 195 | "constant": true 196 | }, 197 | { 198 | "inputs": [ 199 | { 200 | "internalType": "uint256", 201 | "name": "", 202 | "type": "uint256" 203 | } 204 | ], 205 | "name": "poolInfo", 206 | "outputs": [ 207 | { 208 | "internalType": "contract IERC20", 209 | "name": "lpToken", 210 | "type": "address" 211 | }, 212 | { 213 | "internalType": "uint256", 214 | "name": "allocPoint", 215 | "type": "uint256" 216 | }, 217 | { 218 | "internalType": "uint256", 219 | "name": "lastRewardBlock", 220 | "type": "uint256" 221 | }, 222 | { 223 | "internalType": "uint256", 224 | "name": "accSushiPerShare", 225 | "type": "uint256" 226 | } 227 | ], 228 | "stateMutability": "view", 229 | "type": "function", 230 | "constant": true 231 | }, 232 | { 233 | "inputs": [], 234 | "name": "renounceOwnership", 235 | "outputs": [], 236 | "stateMutability": "nonpayable", 237 | "type": "function" 238 | }, 239 | { 240 | "inputs": [], 241 | "name": "startBlock", 242 | "outputs": [ 243 | { 244 | "internalType": "uint256", 245 | "name": "", 246 | "type": "uint256" 247 | } 248 | ], 249 | "stateMutability": "view", 250 | "type": "function", 251 | "constant": true 252 | }, 253 | { 254 | "inputs": [], 255 | "name": "sushi", 256 | "outputs": [ 257 | { 258 | "internalType": "contract SushiToken", 259 | "name": "", 260 | "type": "address" 261 | } 262 | ], 263 | "stateMutability": "view", 264 | "type": "function", 265 | "constant": true 266 | }, 267 | { 268 | "inputs": [], 269 | "name": "sushiPerBlock", 270 | "outputs": [ 271 | { 272 | "internalType": "uint256", 273 | "name": "", 274 | "type": "uint256" 275 | } 276 | ], 277 | "stateMutability": "view", 278 | "type": "function", 279 | "constant": true 280 | }, 281 | { 282 | "inputs": [], 283 | "name": "totalAllocPoint", 284 | "outputs": [ 285 | { 286 | "internalType": "uint256", 287 | "name": "", 288 | "type": "uint256" 289 | } 290 | ], 291 | "stateMutability": "view", 292 | "type": "function", 293 | "constant": true 294 | }, 295 | { 296 | "inputs": [ 297 | { 298 | "internalType": "address", 299 | "name": "newOwner", 300 | "type": "address" 301 | } 302 | ], 303 | "name": "transferOwnership", 304 | "outputs": [], 305 | "stateMutability": "nonpayable", 306 | "type": "function" 307 | }, 308 | { 309 | "inputs": [ 310 | { 311 | "internalType": "uint256", 312 | "name": "", 313 | "type": "uint256" 314 | }, 315 | { 316 | "internalType": "address", 317 | "name": "", 318 | "type": "address" 319 | } 320 | ], 321 | "name": "userInfo", 322 | "outputs": [ 323 | { 324 | "internalType": "uint256", 325 | "name": "amount", 326 | "type": "uint256" 327 | }, 328 | { 329 | "internalType": "uint256", 330 | "name": "rewardDebt", 331 | "type": "uint256" 332 | } 333 | ], 334 | "stateMutability": "view", 335 | "type": "function", 336 | "constant": true 337 | }, 338 | { 339 | "inputs": [], 340 | "name": "poolLength", 341 | "outputs": [ 342 | { 343 | "internalType": "uint256", 344 | "name": "", 345 | "type": "uint256" 346 | } 347 | ], 348 | "stateMutability": "view", 349 | "type": "function", 350 | "constant": true 351 | }, 352 | { 353 | "inputs": [ 354 | { 355 | "internalType": "uint256", 356 | "name": "_allocPoint", 357 | "type": "uint256" 358 | }, 359 | { 360 | "internalType": "contract IERC20", 361 | "name": "_lpToken", 362 | "type": "address" 363 | }, 364 | { 365 | "internalType": "bool", 366 | "name": "_withUpdate", 367 | "type": "bool" 368 | } 369 | ], 370 | "name": "add", 371 | "outputs": [], 372 | "stateMutability": "nonpayable", 373 | "type": "function" 374 | }, 375 | { 376 | "inputs": [ 377 | { 378 | "internalType": "uint256", 379 | "name": "_pid", 380 | "type": "uint256" 381 | }, 382 | { 383 | "internalType": "uint256", 384 | "name": "_allocPoint", 385 | "type": "uint256" 386 | }, 387 | { 388 | "internalType": "bool", 389 | "name": "_withUpdate", 390 | "type": "bool" 391 | } 392 | ], 393 | "name": "set", 394 | "outputs": [], 395 | "stateMutability": "nonpayable", 396 | "type": "function" 397 | }, 398 | { 399 | "inputs": [ 400 | { 401 | "internalType": "contract IMigratorChef", 402 | "name": "_migrator", 403 | "type": "address" 404 | } 405 | ], 406 | "name": "setMigrator", 407 | "outputs": [], 408 | "stateMutability": "nonpayable", 409 | "type": "function" 410 | }, 411 | { 412 | "inputs": [ 413 | { 414 | "internalType": "uint256", 415 | "name": "_pid", 416 | "type": "uint256" 417 | } 418 | ], 419 | "name": "migrate", 420 | "outputs": [], 421 | "stateMutability": "nonpayable", 422 | "type": "function" 423 | }, 424 | { 425 | "inputs": [ 426 | { 427 | "internalType": "uint256", 428 | "name": "_from", 429 | "type": "uint256" 430 | }, 431 | { 432 | "internalType": "uint256", 433 | "name": "_to", 434 | "type": "uint256" 435 | } 436 | ], 437 | "name": "getMultiplier", 438 | "outputs": [ 439 | { 440 | "internalType": "uint256", 441 | "name": "", 442 | "type": "uint256" 443 | } 444 | ], 445 | "stateMutability": "view", 446 | "type": "function", 447 | "constant": true 448 | }, 449 | { 450 | "inputs": [ 451 | { 452 | "internalType": "uint256", 453 | "name": "_pid", 454 | "type": "uint256" 455 | }, 456 | { 457 | "internalType": "address", 458 | "name": "_user", 459 | "type": "address" 460 | } 461 | ], 462 | "name": "pendingSushi", 463 | "outputs": [ 464 | { 465 | "internalType": "uint256", 466 | "name": "", 467 | "type": "uint256" 468 | } 469 | ], 470 | "stateMutability": "view", 471 | "type": "function", 472 | "constant": true 473 | }, 474 | { 475 | "inputs": [], 476 | "name": "massUpdatePools", 477 | "outputs": [], 478 | "stateMutability": "nonpayable", 479 | "type": "function" 480 | }, 481 | { 482 | "inputs": [ 483 | { 484 | "internalType": "uint256", 485 | "name": "_pid", 486 | "type": "uint256" 487 | } 488 | ], 489 | "name": "updatePool", 490 | "outputs": [], 491 | "stateMutability": "nonpayable", 492 | "type": "function" 493 | }, 494 | { 495 | "inputs": [ 496 | { 497 | "internalType": "uint256", 498 | "name": "_pid", 499 | "type": "uint256" 500 | }, 501 | { 502 | "internalType": "uint256", 503 | "name": "_amount", 504 | "type": "uint256" 505 | } 506 | ], 507 | "name": "deposit", 508 | "outputs": [], 509 | "stateMutability": "nonpayable", 510 | "type": "function" 511 | }, 512 | { 513 | "inputs": [ 514 | { 515 | "internalType": "uint256", 516 | "name": "_pid", 517 | "type": "uint256" 518 | }, 519 | { 520 | "internalType": "uint256", 521 | "name": "_amount", 522 | "type": "uint256" 523 | } 524 | ], 525 | "name": "withdraw", 526 | "outputs": [], 527 | "stateMutability": "nonpayable", 528 | "type": "function" 529 | }, 530 | { 531 | "inputs": [ 532 | { 533 | "internalType": "uint256", 534 | "name": "_pid", 535 | "type": "uint256" 536 | } 537 | ], 538 | "name": "emergencyWithdraw", 539 | "outputs": [], 540 | "stateMutability": "nonpayable", 541 | "type": "function" 542 | }, 543 | { 544 | "inputs": [ 545 | { 546 | "internalType": "address", 547 | "name": "_devaddr", 548 | "type": "address" 549 | } 550 | ], 551 | "name": "dev", 552 | "outputs": [], 553 | "stateMutability": "nonpayable", 554 | "type": "function" 555 | } 556 | ] -------------------------------------------------------------------------------- /apys.js: -------------------------------------------------------------------------------- 1 | // 类型, 池子, 锁仓/交易额, 日化 2 | const coins = [ 3 | { 4 | pid: 8, 5 | lpAddresses: '0xFBe7b74623e4be82279027a286fa3A5b5280F77c', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 6 | tokenAddresses: '0x66a79d23e58475d2738179ca52cd0b41d73f0bea', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 7 | symbol: 'HBTC/USDT', 8 | islp: true 9 | }, 10 | { 11 | pid: 9, 12 | lpAddresses: '0x78C90d3f8A64474982417cDB490E840c01E516D4', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 13 | tokenAddresses: '0x64ff637fb478863b7468bc97d30a5bf3a428a1fd', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 14 | symbol: 'ETH/USDT', 15 | islp: true 16 | }, 17 | { 18 | pid: 10, 19 | lpAddresses: '0xdff86B408284dff30A7CAD7688fEdB465734501C', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 20 | tokenAddresses: '0x0298c2b32eae4da002a15f36fdf7615bea3da047', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 21 | symbol: 'HUSD/USDT', 22 | islp: true 23 | }, 24 | { 25 | pid: 11, 26 | lpAddresses: '0x060B4bfcE16D15A943ec83C56C87940613e162eB', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 27 | tokenAddresses: '0xecb56cf772b5c9a6907fb7d32387da2fcbfb63b4', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 28 | symbol: 'HLTC/USDT', 29 | islp: true 30 | }, 31 | { 32 | pid: 12, 33 | lpAddresses: '0x1f0eC8e0096e145f2bf2Cb4950Ed7b52d1cbd35f', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 34 | tokenAddresses: '0xef3cebd77e0c52cb6f60875d9306397b5caca375', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 35 | symbol: 'HBCH/USDT', 36 | islp: true 37 | }, 38 | { 39 | pid: 13, 40 | lpAddresses: '0x5484ab0DF3E51187f83F7f6b1a13f7a7Ee98C368', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 41 | tokenAddresses: '0xa2c49cee16a5e5bdefde931107dc1fae9f7773e3', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 42 | symbol: 'HDOT/USDT', 43 | islp: true 44 | }, 45 | { 46 | pid: 14, 47 | lpAddresses: '0x600072aF0470d9Ed1D83885D03d17368943fF22A', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 48 | tokenAddresses: '0xae3a768f9ab104c69a7cd6041fe16ffa235d1810', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 49 | symbol: 'HFIL/USDT', 50 | islp: true 51 | }, 52 | { 53 | pid: 16, 54 | lpAddresses: '0x615E6285c5944540fd8bd921c9c8c56739Fd1E13', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 55 | tokenAddresses: '0x25D2e80cB6B86881Fd7e07dd263Fb79f4AbE033c', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 56 | symbol: 'MDX/USDT', 57 | islp: true 58 | }, 59 | { 60 | pid: 15, 61 | lpAddresses: '0x3375afF2CAcF683b8FC34807B9443EB32e7Afff6', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 62 | tokenAddresses: '0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 63 | symbol: 'WHT/HUSD', 64 | islp: true 65 | }, 66 | { 67 | pid: 17, 68 | lpAddresses: '0x499B6E03749B4bAF95F9E70EeD5355b138EA6C31', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 69 | tokenAddresses: '0x5545153ccfca01fbd7dd11c0b23ba694d9509a6f', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 70 | symbol: 'WHT/USDT', 71 | islp: true 72 | }, 73 | { 74 | pid: 18, 75 | lpAddresses: '0xdE5b574925EE475c41b99a7591EC43E92dCD2fc1', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 76 | tokenAddresses: '0xe499ef4616993730ced0f31fa2703b92b50bb536', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 77 | symbol: 'HPT/USDT', 78 | islp: true 79 | }, 80 | { 81 | pid: 19, 82 | lpAddresses: '0x6Dd2993B50b365c707718b0807fC4e344c072eC2', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 83 | tokenAddresses: '0x25D2e80cB6B86881Fd7e07dd263Fb79f4AbE033c', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 84 | symbol: 'MDX/WHT', 85 | islp: true 86 | }, 87 | { 88 | pid: 21, 89 | lpAddresses: '0x7964e55bbdaecde48c2c8ef86e433ed47fecb519', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 90 | tokenAddresses: '0xe36ffd17b2661eb57144ceaef942d95295e637f0', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 91 | symbol: 'FILDA/HUSD', 92 | islp: true 93 | }, 94 | { 95 | pid: 22, 96 | lpAddresses: '0x023f375a51af8645d7446ba5942baedc53b0582d', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 97 | tokenAddresses: '0x8f67854497218043e1f72908ffe38d0ed7f24721', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 98 | symbol: 'LHB/USDT', 99 | islp: true 100 | }, 101 | { 102 | pid: 23, 103 | lpAddresses: '0xfAfeAafeFc5F92F22415506e78D9AB1E33C03257', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 104 | tokenAddresses: '0x202b4936fe1a82a4965220860ae46d7d3939bb25', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 105 | symbol: 'AAVE/USDT', 106 | islp: true 107 | }, 108 | { 109 | pid: 24, 110 | lpAddresses: '0xc7A4C808a29fc8Cd3A8a6848f7F18bED9924C692', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 111 | tokenAddresses: '0x777850281719d5a96c29812ab72f822e0e09f3da', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 112 | symbol: 'SNX/USDT', 113 | islp: true 114 | }, 115 | { 116 | pid: 25, 117 | lpAddresses: '0x84455d880af684eb29997B82832dd71EF29c1354', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 118 | tokenAddresses: '0x22c54ce8321a4015740ee1109d9cbc25815c46e6', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 119 | symbol: 'UNI/USDT', 120 | islp: true 121 | }, 122 | { 123 | pid: 26, 124 | lpAddresses: '0x52a342015BAa2496A90A9bB6069D7692564132e6', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 125 | tokenAddresses: '0x9e004545c59d359f6b7bfb06a26390b087717b42', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 126 | symbol: 'LINK/USDT', 127 | islp: true 128 | }, 129 | { 130 | pid: 27, 131 | lpAddresses: '0xB6A77CDD31771A4F439622aA36b20cb53C19868C', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 132 | tokenAddresses: '0x045de15ca76e76426e8fc7cba8392a3138078d0f', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 133 | symbol: 'BAL/USDT', 134 | islp: true 135 | }, 136 | { 137 | pid: 28, 138 | lpAddresses: '0x64Af3564C6D6BEc5883358c560211EcD0f8d1AC7', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 139 | tokenAddresses: '0xb4f019beac758abbee2f906033aaa2f0f6dacb35', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 140 | symbol: 'YFI/USDT', 141 | islp: true 142 | }, 143 | { 144 | pid: 29, 145 | lpAddresses: '0xBFff969A85e355eE0851b019Dba1e87C7780F40d', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 146 | tokenAddresses: '0x66a79d23e58475d2738179ca52cd0b41d73f0bea', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 147 | symbol: 'HBTC/WHT', 148 | islp: true 149 | }, 150 | { 151 | pid: 30, 152 | lpAddresses: '0x53E458aD1CFEB9582736db6BdE9aF89948e3bc3d', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 153 | tokenAddresses: '0x64ff637fb478863b7468bc97d30a5bf3a428a1fd', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 154 | symbol: 'ETH/WHT', 155 | islp: true 156 | }, 157 | { 158 | pid: 31, 159 | lpAddresses: '0x793c2a814e23EE38aB46412Be65E94Fe47D4B397', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 160 | tokenAddresses: '0x66a79d23e58475d2738179ca52cd0b41d73f0bea', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 161 | symbol: 'HBTC/ETH', 162 | islp: true 163 | }, 164 | { 165 | pid: 32, 166 | lpAddresses: '0x2Fb4bE0F2785bD6009A383f3290CC97A4e3bD46B', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 167 | tokenAddresses: '0x66a79d23e58475d2738179ca52cd0b41d73f0bea', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 168 | symbol: 'HBTC/MDX', 169 | islp: true 170 | }, 171 | { 172 | pid: 33, 173 | lpAddresses: '0xb55569893b397324c0d048c9709F40c23445540E', // lpAddresses 统一用来查询余额,lp的话填写lp地址,单币的填币种地址 174 | tokenAddresses: '0x64ff637fb478863b7468bc97d30a5bf3a428a1fd', // tokenAddresses,单币的话不需要,lp填要获取价格的币种地址 175 | symbol: 'ETH/MDX', 176 | islp: true 177 | }, 178 | ] 179 | const hecoAddress = 'https://http-mainnet.hecochain.com' 180 | 181 | const web3 = require('web3') 182 | const low = require('lowdb') 183 | const FileSync = require('lowdb/adapters/FileSync') 184 | const adapter = new FileSync('./apy.json') 185 | const db = low(adapter) 186 | //address 187 | const oracleAddress = '0x7b4B0d9Cd226017eA3875D49196Ea63A6ea8C278' 188 | const usdtAddress = '0xa71edc38d189767582c38a3145b5873052c3e47a' 189 | const chefAddress = '0xFB03e11D93632D97a8981158A632Dd5986F5E909' 190 | const mdxAddress = '0x25D2e80cB6B86881Fd7e07dd263Fb79f4AbE033c' 191 | //abi 192 | const erc20Abi = require('./abi/erc20.json') 193 | const oracleAbi = require('./abi/oracle.json') 194 | const chefAbi = require('./abi/masterchef.json') 195 | // contract 196 | const provider = new web3(hecoAddress) 197 | const orcalContract = new provider.eth.Contract(oracleAbi, oracleAddress) 198 | const chefContract = new provider.eth.Contract(chefAbi, chefAddress) 199 | // 200 | const BLOCKS_PER_YEAR = 10512000 201 | const SUSHI_PER_BLOCK = 0.625 202 | 203 | const getPoolWeight = async (pid) => { 204 | const { allocPoint } = await chefContract.methods.poolInfo(pid).call(); 205 | const totalAllocPoint = await chefContract.methods 206 | .totalAllocPoint() 207 | .call(); 208 | return allocPoint/totalAllocPoint; 209 | }; 210 | 211 | const calculateCoin = async(lpAddresses, tokenSymbol, pid) => { 212 | const tokenContract = new provider.eth.Contract(erc20Abi, lpAddresses) 213 | const totalValue = await tokenContract.methods.balanceOf(chefAddress).call() 214 | const decimal = await tokenContract.methods.decimals().call() 215 | if(tokenSymbol == 'USDT') { 216 | return { 217 | totalUsdtValue: totalValue/Math.pow(10, decimal), 218 | tokenPriceInWeth: 1, 219 | poolWeight: await getPoolWeight(pid) 220 | } 221 | } else { 222 | let price = 0 223 | try { 224 | price = await orcalContract.methods.consult(lpAddresses, String(Math.pow(10, decimal)), usdtAddress).call() 225 | } catch (error) { 226 | console.log(tokenSymbol, 'get price', error) 227 | } 228 | return { 229 | totalUsdtValue: totalValue/Math.pow(10, decimal)*price/Math.pow(10, 18), 230 | tokenPriceInUsdt: price/Math.pow(10, 18), 231 | poolWeight: await getPoolWeight(pid) 232 | } 233 | } 234 | } 235 | 236 | const calculateLp = async(lpAddresses, tokenAddresses, tokenSymbol, pid) => { 237 | const currentTokenContract = new provider.eth.Contract(erc20Abi, lpAddresses) 238 | const currentLpContract = new provider.eth.Contract(erc20Abi, tokenAddresses) 239 | const totalSupply = await currentTokenContract.methods.totalSupply().call() 240 | // chef的总量 241 | const balance = await currentTokenContract.methods.balanceOf(chefAddress).call() 242 | const decimal = await currentLpContract.methods.decimals().call() 243 | let price = 0 244 | try { 245 | price = await orcalContract.methods.consult(tokenAddresses, String(Math.pow(10, decimal)), usdtAddress).call() 246 | } catch (error) { 247 | console.log(tokenSymbol, 'get price', error) 248 | } 249 | const tokenAmount = await currentLpContract.methods.balanceOf(currentTokenContract.options.address).call() 250 | //份额 251 | const portionLp = balance/totalSupply 252 | const totalAmount = tokenAmount*portionLp/Math.pow(10, decimal) 253 | const poolWeight = await getPoolWeight(pid) 254 | return { 255 | totalUsdtValue: totalAmount*price/Math.pow(10, 18)*2, 256 | tokenPriceInUsdt: price/Math.pow(10, 18), 257 | poolWeight 258 | } 259 | } 260 | 261 | const getCoinsInfo = async() => { 262 | const mdxPrice = await orcalContract.methods.consult(mdxAddress, String(Math.pow(10, 18)), usdtAddress).call() 263 | db.set('single', []).write() 264 | db.set('lps', []).write() 265 | for(const coin of coins) { 266 | let res = null 267 | if(coin.islp) { 268 | res = await calculateLp(coin.lpAddresses, coin.tokenAddresses, coin.symbol, coin.pid) 269 | } else { 270 | res = await calculateCoin(coin.lpAddresses, coin.symbol, coin.pid) 271 | } 272 | const apy = mdxPrice/1e+18*SUSHI_PER_BLOCK*BLOCKS_PER_YEAR*res.poolWeight/res.totalUsdtValue*100 273 | if(coin.islp) { 274 | db.get('lps').push({...res, symbol: coin.symbol, apy}).write() 275 | } else { 276 | db.get('single').push({...res, symbol: coin.symbol, apy}).write() 277 | } 278 | } 279 | } 280 | getCoinsInfo() 281 | 282 | 283 | // 284 | const axios = require('axios') 285 | const API_URL = 'https://api.mdex.com' 286 | const moment = require('moment'); // require 287 | const tokens = { 288 | '0x0298c2b32eaE4da002a15f36fdf7615BEa3DA047': 'HUSD', 289 | '0x5545153CCFcA01fbd7Dd11C0b23ba694D9509A6F': 'HT', 290 | '0x64FF637fB478863B7468bc97D30a5bF3A428a1fD': 'ETH', 291 | '0xa71EdC38d189767582C38A3145b5873052c3e47a': 'USDT', 292 | '0x66a79D23E58475D2738179Ca52cd0b41d73f0BEa': 'HBTC', 293 | '0x25D2e80cB6B86881Fd7e07dd263Fb79f4AbE033c': 'MDX', 294 | '0xa042fb0e60125A4022670014AC121931e7501Af4': 'BAG', 295 | '0xA2c49cEe16a5E5bDEFDe931107dc1fae9f7773E3': 'HDOT', 296 | '0xecb56cf772B5c9A6907FB7d32387Da2fCbfB63b4': 'HLTC', 297 | '0xeF3CEBD77E0C52cb6f60875d9306397B5Caca375': 'HBCH', 298 | "0xE499Ef4616993730CEd0f31FA2703B92B50bB536": "HPT", 299 | '0xae3a768f9aB104c69A7CD6041fE16fFa235d1810': 'HFIL', 300 | '0x202b4936fE1a82A4965220860aE46d7d3939Bb25': 'AAVE', 301 | '0x777850281719d5a96C29812ab72f822E0e09F3Da': 'SNX', 302 | '0x22C54cE8321A4015740eE1109D9cBc25815C46E6': 'UNI', 303 | } 304 | const getApy = async() => { 305 | const list = await axios.get(`${API_URL}/pool/list`) 306 | const apys = await axios.get(`${API_URL}/pool/apys`) 307 | if(list.data.code == 0 && apys.data.code == 0) { 308 | db.set('minging', []).write() 309 | list.data.result.forEach(val => { 310 | db.get('minging').push({...val, apy: apys.data.result[val.pool_id], symbol0: tokens[val.token0], symbol1: tokens[val.token1]}).write() 311 | }) 312 | const time = new Date().getTime() 313 | db.set('time', moment(time).utcOffset(8).format('YYYY-MM-DD HH:mm')).write() 314 | } 315 | } 316 | getApy() 317 | -------------------------------------------------------------------------------- /apy.json: -------------------------------------------------------------------------------- 1 | { 2 | "minging": [ 3 | { 4 | "id": 1, 5 | "pool_id": 0, 6 | "token0": "0x0298c2b32eaE4da002a15f36fdf7615BEa3DA047", 7 | "token1": "0x5545153CCFcA01fbd7Dd11C0b23ba694D9509A6F", 8 | "alloc_mdx_amt": "77146907685090674440692", 9 | "total_quantity": "23934967861248396829976873417", 10 | "pool_quantity": "134800813486409780417840987", 11 | "alloc_point": "131", 12 | "apy": "10.621974160189884", 13 | "symbol0": "HUSD", 14 | "symbol1": "HT" 15 | }, 16 | { 17 | "id": 2, 18 | "pool_id": 1, 19 | "token0": "0x64FF637fB478863B7468bc97D30a5bF3A428a1fD", 20 | "token1": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 21 | "alloc_mdx_amt": "118256739858274977816558", 22 | "total_quantity": "26367365051244914552618082208", 23 | "pool_quantity": "424370440105930154625204585", 24 | "alloc_point": "149", 25 | "apy": "3.838215979353644", 26 | "symbol0": "ETH", 27 | "symbol1": "USDT" 28 | }, 29 | { 30 | "id": 3, 31 | "pool_id": 2, 32 | "token0": "0x66a79D23E58475D2738179Ca52cd0b41d73f0BEa", 33 | "token1": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 34 | "alloc_mdx_amt": "128283312897442480380577", 35 | "total_quantity": "25741352620141545605866490748", 36 | "pool_quantity": "452625245637508608780010693", 37 | "alloc_point": "109", 38 | "apy": "2.6320212937684833", 39 | "symbol0": "HBTC", 40 | "symbol1": "USDT" 41 | }, 42 | { 43 | "id": 4, 44 | "pool_id": 3, 45 | "token0": "0x0298c2b32eaE4da002a15f36fdf7615BEa3DA047", 46 | "token1": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 47 | "alloc_mdx_amt": "158101950268690271967429", 48 | "total_quantity": "74354607302181997277557257056", 49 | "pool_quantity": "112809481903709145078474690", 50 | "alloc_point": "8734", 51 | "apy": "845.9243869315769", 52 | "symbol0": "HUSD", 53 | "symbol1": "USDT" 54 | }, 55 | { 56 | "id": 5, 57 | "pool_id": 4, 58 | "token0": "0x25D2e80cB6B86881Fd7e07dd263Fb79f4AbE033c", 59 | "token1": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 60 | "alloc_mdx_amt": "65122209220743845790449", 61 | "total_quantity": "7658522405629849920344845278", 62 | "pool_quantity": "168294912216567304371985037", 63 | "alloc_point": "127", 64 | "apy": "8.250230608513172", 65 | "symbol0": "MDX", 66 | "symbol1": "USDT" 67 | }, 68 | { 69 | "id": 6, 70 | "pool_id": 5, 71 | "token0": "0x0298c2b32eaE4da002a15f36fdf7615BEa3DA047", 72 | "token1": "0xa042fb0e60125A4022670014AC121931e7501Af4", 73 | "alloc_mdx_amt": "30545618463068432662503", 74 | "total_quantity": "1652671144369720059488841991", 75 | "pool_quantity": "27333185955215978064511763", 76 | "alloc_point": "19", 77 | "apy": "7.592305720163464", 78 | "symbol0": "HUSD", 79 | "symbol1": "BAG" 80 | }, 81 | { 82 | "id": 7, 83 | "pool_id": 6, 84 | "token0": "0x66a79D23E58475D2738179Ca52cd0b41d73f0BEa", 85 | "token1": "0xa042fb0e60125A4022670014AC121931e7501Af4", 86 | "alloc_mdx_amt": "13980553749898218078070", 87 | "total_quantity": "1518386577064151222360302351", 88 | "pool_quantity": "11159319553783261852572737", 89 | "alloc_point": "19", 90 | "apy": "18.597685881766502", 91 | "symbol0": "HBTC", 92 | "symbol1": "BAG" 93 | }, 94 | { 95 | "id": 8, 96 | "pool_id": 7, 97 | "token0": "0xA2c49cEe16a5E5bDEFDe931107dc1fae9f7773E3", 98 | "token1": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 99 | "alloc_mdx_amt": "21618036552553809244068", 100 | "total_quantity": "5707754274493289485776916949", 101 | "pool_quantity": "104505167809336223606917936", 102 | "alloc_point": "30", 103 | "apy": "3.1378320122927055", 104 | "symbol0": "HDOT", 105 | "symbol1": "USDT" 106 | }, 107 | { 108 | "id": 9, 109 | "pool_id": 8, 110 | "token0": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 111 | "token1": "0xecb56cf772B5c9A6907FB7d32387Da2fCbfB63b4", 112 | "alloc_mdx_amt": "28160953112870851151345", 113 | "total_quantity": "5733840632617564504111474732", 114 | "pool_quantity": "64900687720223807864154759", 115 | "alloc_point": "30", 116 | "apy": "5.051520600784902", 117 | "symbol0": "USDT", 118 | "symbol1": "HLTC" 119 | }, 120 | { 121 | "id": 10, 122 | "pool_id": 9, 123 | "token0": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 124 | "token1": "0xeF3CEBD77E0C52cb6f60875d9306397B5Caca375", 125 | "alloc_mdx_amt": "12871407640991013055475", 126 | "total_quantity": "5767218779009982891296198858", 127 | "pool_quantity": "12181909711254496759164750", 128 | "alloc_point": "220", 129 | "apy": "197.4478156725283", 130 | "symbol0": "USDT", 131 | "symbol1": "HBCH" 132 | }, 133 | { 134 | "id": 11, 135 | "pool_id": 10, 136 | "token0": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 137 | "token1": "0xE499Ef4616993730CEd0f31FA2703B92B50bB536", 138 | "alloc_mdx_amt": "2036201533344273119249", 139 | "total_quantity": "827511815679118312851645048", 140 | "pool_quantity": "4968445476310837275017284", 141 | "alloc_point": "4", 142 | "apy": "8.78341013685098", 143 | "symbol0": "USDT", 144 | "symbol1": "HPT" 145 | }, 146 | { 147 | "id": 12, 148 | "pool_id": 11, 149 | "token0": "0x5545153CCFcA01fbd7Dd11C0b23ba694D9509A6F", 150 | "token1": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 151 | "alloc_mdx_amt": "79931438304058444052984", 152 | "total_quantity": "15630888325486635480746660475", 153 | "pool_quantity": "482902338749113626690154816", 154 | "alloc_point": "40", 155 | "apy": "0.9053522165635889", 156 | "symbol0": "HT", 157 | "symbol1": "USDT" 158 | }, 159 | { 160 | "id": 13, 161 | "pool_id": 12, 162 | "token0": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 163 | "token1": "0xae3a768f9aB104c69A7CD6041fE16fFa235d1810", 164 | "alloc_mdx_amt": "9418931978847208236467", 165 | "total_quantity": "8140624615572625064713152437", 166 | "pool_quantity": "13734836250136067028850530", 167 | "alloc_point": "90", 168 | "apy": "71.60715152908816", 169 | "symbol0": "USDT", 170 | "symbol1": "HFIL" 171 | }, 172 | { 173 | "id": 14, 174 | "pool_id": 13, 175 | "token0": "0x202b4936fE1a82A4965220860aE46d7d3939Bb25", 176 | "token1": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 177 | "alloc_mdx_amt": "232649025632780448989", 178 | "total_quantity": "940219258543180965259877060", 179 | "pool_quantity": "1550759753735665880744084", 180 | "alloc_point": "7", 181 | "apy": "49.323714411767895", 182 | "symbol0": "AAVE", 183 | "symbol1": "USDT" 184 | }, 185 | { 186 | "id": 15, 187 | "pool_id": 14, 188 | "token0": "0x777850281719d5a96C29812ab72f822E0e09F3Da", 189 | "token1": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 190 | "alloc_mdx_amt": "365242159195688168515", 191 | "total_quantity": "913389181163179837065557536", 192 | "pool_quantity": "912653701586628138676857", 193 | "alloc_point": "7", 194 | "apy": "83.84513218269511", 195 | "symbol0": "SNX", 196 | "symbol1": "USDT" 197 | }, 198 | { 199 | "id": 16, 200 | "pool_id": 15, 201 | "token0": "0x22C54cE8321A4015740eE1109D9cBc25815C46E6", 202 | "token1": "0xa71EdC38d189767582C38A3145b5873052c3e47a", 203 | "alloc_mdx_amt": "1363237681745841545803", 204 | "total_quantity": "965887058045840518571852768", 205 | "pool_quantity": "5533723714104868163225095", 206 | "alloc_point": "7", 207 | "apy": "13.828685085917266", 208 | "symbol0": "UNI", 209 | "symbol1": "USDT" 210 | }, 211 | { 212 | "id": 17, 213 | "pool_id": 16, 214 | "token0": "0x25D2e80cB6B86881Fd7e07dd263Fb79f4AbE033c", 215 | "token1": "0x5545153CCFcA01fbd7Dd11C0b23ba694D9509A6F", 216 | "alloc_mdx_amt": "21962385748098412754950", 217 | "total_quantity": "10727714646659001380522980562", 218 | "pool_quantity": "36928983297855996575886762", 219 | "alloc_point": "59", 220 | "apy": "17.46642361474523", 221 | "symbol0": "MDX", 222 | "symbol1": "HT" 223 | } 224 | ], 225 | "single": [], 226 | "lps": [ 227 | { 228 | "totalUsdtValue": 16753982.426447762, 229 | "tokenPriceInUsdt": 42157.10299501955, 230 | "poolWeight": 0.3605, 231 | "symbol": "HBTC/USDT", 232 | "apy": 166.68494434189697 233 | }, 234 | { 235 | "totalUsdtValue": 19552128.277113393, 236 | "tokenPriceInUsdt": 3050.5517835236838, 237 | "poolWeight": 0.3488, 238 | "symbol": "ETH/USDT", 239 | "apy": 138.1947674044676 240 | }, 241 | { 242 | "totalUsdtValue": 28470989.74007828, 243 | "tokenPriceInUsdt": 0.9995714261760767, 244 | "poolWeight": 0.0822, 245 | "symbol": "HUSD/USDT", 246 | "apy": 22.3654898001474 247 | }, 248 | { 249 | "totalUsdtValue": 1799600.7600036133, 250 | "tokenPriceInUsdt": 122.68576691415484, 251 | "poolWeight": 0.0059, 252 | "symbol": "HLTC/USDT", 253 | "apy": 25.39715120600859 254 | }, 255 | { 256 | "totalUsdtValue": 403978.8700292296, 257 | "tokenPriceInUsdt": 342.59352170417674, 258 | "poolWeight": 0.0041, 259 | "symbol": "HBCH/USDT", 260 | "apy": 78.62024041207333 261 | }, 262 | { 263 | "totalUsdtValue": 711873.8183779503, 264 | "tokenPriceInUsdt": 21.2616459101628, 265 | "poolWeight": 0.006, 266 | "symbol": "HDOT/USDT", 267 | "apy": 65.29161193639558 268 | }, 269 | { 270 | "totalUsdtValue": 1473585.5510853864, 271 | "tokenPriceInUsdt": 23.679465750471593, 272 | "poolWeight": 0.0097, 273 | "symbol": "HFIL/USDT", 274 | "apy": 50.99241030501987 275 | }, 276 | { 277 | "totalUsdtValue": 4302851.860198134, 278 | "tokenPriceInUsdt": 0.2699361489162591, 279 | "poolWeight": 0.0414, 280 | "symbol": "MDX/USDT", 281 | "apy": 74.53377322546356 282 | }, 283 | { 284 | "totalUsdtValue": 29001.785031520736, 285 | "tokenPriceInUsdt": 9.358718978941674, 286 | "poolWeight": 0, 287 | "symbol": "WHT/HUSD", 288 | "apy": 0 289 | }, 290 | { 291 | "totalUsdtValue": 8466517.45388626, 292 | "tokenPriceInUsdt": 9.358718955347545, 293 | "poolWeight": 0.0507, 294 | "symbol": "WHT/USDT", 295 | "apy": 46.388711770879745 296 | }, 297 | { 298 | "totalUsdtValue": 142398.09899795978, 299 | "tokenPriceInUsdt": 0.00221529597788366, 300 | "poolWeight": 0.0007, 301 | "symbol": "HPT/USDT", 302 | "apy": 38.08053220396276 303 | }, 304 | { 305 | "totalUsdtValue": 944109.5778934071, 306 | "tokenPriceInUsdt": 0.26993611350219465, 307 | "poolWeight": 0.0039, 308 | "symbol": "MDX/WHT", 309 | "apy": 32.00010212861078 310 | }, 311 | { 312 | "totalUsdtValue": 70311.17144983963, 313 | "tokenPriceInUsdt": 0.020440601492885596, 314 | "poolWeight": 0.0006, 315 | "symbol": "FILDA/HUSD", 316 | "apy": 66.10526910417349 317 | }, 318 | { 319 | "totalUsdtValue": 46373.47635227505, 320 | "tokenPriceInUsdt": 0.003648067994627566, 321 | "poolWeight": 0.0005, 322 | "symbol": "LHB/USDT", 323 | "apy": 83.52365898438309 324 | }, 325 | { 326 | "totalUsdtValue": 235682.53346052155, 327 | "tokenPriceInUsdt": 179.92801206535034, 328 | "poolWeight": 0.0012, 329 | "symbol": "AAVE/USDT", 330 | "apy": 39.442370560734744 331 | }, 332 | { 333 | "totalUsdtValue": 283954.61651282007, 334 | "tokenPriceInUsdt": 5.077956360307259, 335 | "poolWeight": 0.0012, 336 | "symbol": "SNX/USDT", 337 | "apy": 32.737195589926124 338 | }, 339 | { 340 | "totalUsdtValue": 152929.20120773336, 341 | "tokenPriceInUsdt": 12.011214587426629, 342 | "poolWeight": 0.0023, 343 | "symbol": "UNI/USDT", 344 | "apy": 116.50553990489804 345 | }, 346 | { 347 | "totalUsdtValue": 129797.50674275144, 348 | "tokenPriceInUsdt": 17.64837842564148, 349 | "poolWeight": 0.0017, 350 | "symbol": "LINK/USDT", 351 | "apy": 101.45926970932256 352 | }, 353 | { 354 | "totalUsdtValue": 28333.336505241517, 355 | "tokenPriceInUsdt": 14.436577024373916, 356 | "poolWeight": 0.0007, 357 | "symbol": "BAL/USDT", 358 | "apy": 191.38569838648309 359 | }, 360 | { 361 | "totalUsdtValue": 62126.02950345042, 362 | "tokenPriceInUsdt": 24828.60704334296, 363 | "poolWeight": 0.0007, 364 | "symbol": "YFI/USDT", 365 | "apy": 87.28379131928459 366 | }, 367 | { 368 | "totalUsdtValue": 634923.4754437874, 369 | "tokenPriceInUsdt": 42157.09468459728, 370 | "poolWeight": 0.0005, 371 | "symbol": "HBTC/WHT", 372 | "apy": 6.100392526926961 373 | }, 374 | { 375 | "totalUsdtValue": 708667.0456831394, 376 | "tokenPriceInUsdt": 3050.5515725727887, 377 | "poolWeight": 0.0008, 378 | "symbol": "ETH/WHT", 379 | "apy": 8.744941531258062 380 | }, 381 | { 382 | "totalUsdtValue": 2971034.9670099565, 383 | "tokenPriceInUsdt": 42157.093853557926, 384 | "poolWeight": 0.0117, 385 | "symbol": "HBTC/ETH", 386 | "apy": 30.50614003065087 387 | }, 388 | { 389 | "totalUsdtValue": 291692.05621459783, 390 | "tokenPriceInUsdt": 42157.0930225191, 391 | "poolWeight": 0.002, 392 | "symbol": "HBTC/MDX", 393 | "apy": 53.11467819909639 394 | }, 395 | { 396 | "totalUsdtValue": 360324.5435716526, 397 | "tokenPriceInUsdt": 3050.551551477772, 398 | "poolWeight": 0.002, 399 | "symbol": "ETH/MDX", 400 | "apy": 42.997708525481556 401 | } 402 | ], 403 | "time": "2021-05-19 14:07" 404 | } --------------------------------------------------------------------------------