@oracle-agent/oracle 0.14.1 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/SETUP.md +4 -4
- package/dist/action-receipts.mjs +1 -0
- package/dist/action-semantics.mjs +1 -0
- package/dist/address-book.mjs +2 -0
- package/dist/bin/desk-server.mjs +60 -0
- package/dist/bin/oracle-data-mcp.mjs +9 -0
- package/dist/bin/oracle-equities.mjs +20 -0
- package/dist/bin/oracle-init.mjs +24 -0
- package/dist/bin/oracle-public-server.mjs +5 -0
- package/dist/bin/oracle-route.mjs +22 -0
- package/dist/bin/oracle-scan.mjs +18 -0
- package/dist/bin/oracle-upgrade.mjs +21 -0
- package/dist/bin/oracle.mjs +63 -0
- package/dist/chains.mjs +1 -0
- package/dist/cli/commands/auth.mjs +16 -0
- package/dist/cli/commands/bootstrap.mjs +18 -0
- package/dist/cli/commands/chain.mjs +21 -0
- package/dist/cli/commands/chat.mjs +45 -0
- package/dist/cli/commands/credential.mjs +1 -0
- package/dist/cli/commands/data-mcp.mjs +2 -0
- package/dist/cli/commands/data.mjs +12 -0
- package/dist/cli/commands/doctor.mjs +5 -0
- package/dist/cli/commands/equities.mjs +15 -0
- package/dist/cli/commands/farm.mjs +59 -0
- package/dist/cli/commands/fees.mjs +10 -0
- package/dist/cli/commands/follow.mjs +28 -0
- package/dist/cli/commands/harness.mjs +15 -0
- package/dist/cli/commands/help.mjs +1 -0
- package/dist/cli/commands/init.mjs +3 -0
- package/dist/cli/commands/mcp.mjs +36 -0
- package/dist/cli/commands/model.mjs +54 -0
- package/dist/cli/commands/plugins.mjs +43 -0
- package/dist/cli/commands/prepare.mjs +2 -0
- package/dist/cli/commands/public.mjs +3 -0
- package/dist/cli/commands/resolve.mjs +23 -0
- package/dist/cli/commands/route.mjs +2 -0
- package/dist/cli/commands/runner.mjs +1 -0
- package/dist/cli/commands/scan.mjs +2 -0
- package/dist/cli/commands/setup.mjs +34 -0
- package/dist/cli/commands/sign.mjs +4 -0
- package/dist/cli/commands/signer.mjs +1 -0
- package/dist/cli/commands/strategy.mjs +18 -0
- package/dist/cli/commands/swap.mjs +36 -0
- package/dist/cli/commands/upgrade.mjs +2 -0
- package/dist/cli/commands/vault.mjs +1 -0
- package/dist/cli/commands/version.mjs +2 -0
- package/dist/data/desk-data.mjs +55 -0
- package/dist/data/names.mjs +2 -0
- package/dist/data/providers/farming.mjs +2 -0
- package/dist/equities/index.mjs +1 -0
- package/dist/index.mjs +60 -0
- package/dist/nft-gas-war-guard.mjs +1 -0
- package/dist/onboarding/harness-configs.mjs +4 -0
- package/dist/portfolio-risk.mjs +1 -0
- package/dist/prepare-envelope.mjs +1 -0
- package/dist/public-api/agent-grants.mjs +3 -0
- package/dist/public-control/policy-schema.mjs +1 -0
- package/dist/router/index.mjs +2 -0
- package/dist/scanner/index.mjs +4 -0
- package/dist/signals/index.mjs +1 -0
- package/dist/strategy/index.mjs +3 -0
- package/dist/watch-preferences.mjs +1 -0
- package/package.json +33 -78
- package/public/oracle-splash/_variants/ice.html +5 -18
- package/public/oracle-splash/_variants/ivory.html +5 -18
- package/public/oracle-splash/downloads/index.html +4 -4
- package/public/oracle-splash/index.html +113 -34
- package/CONTRIBUTING.md +0 -99
- package/bin/desk-server.mjs +0 -473
- package/bin/oracle-data-mcp.mjs +0 -1252
- package/bin/oracle-equities.mjs +0 -168
- package/bin/oracle-init.mjs +0 -525
- package/bin/oracle-public-server.mjs +0 -36
- package/bin/oracle-route.mjs +0 -254
- package/bin/oracle-scan.mjs +0 -192
- package/bin/oracle-upgrade.mjs +0 -42
- package/bin/oracle.mjs +0 -34
- package/docs/adding-a-chain.md +0 -229
- package/docs/architecture.md +0 -139
- package/docs/buzz-integration.md +0 -115
- package/docs/cli.md +0 -143
- package/docs/connectors.md +0 -13
- package/docs/hyperliquid-builder-code.md +0 -50
- package/docs/locals-only-fee-waiver.md +0 -34
- package/docs/oracle-pack-standard.md +0 -29
- package/docs/profiles.md +0 -151
- package/docs/public-surface.md +0 -206
- package/examples/add-a-chain.mjs +0 -65
- package/examples/oracle-pack-template.mjs +0 -38
- package/examples/research-a-token.mjs +0 -70
- package/plugins/oracle-owner-gate/__init__.py +0 -288
- package/plugins/oracle-owner-gate/plugin.yaml +0 -9
- package/protocols/templates/safe-erc20/SECURITY.md +0 -16
- package/protocols/templates/safe-erc20/foundry.toml +0 -12
- package/protocols/templates/safe-erc20/remappings.txt +0 -2
- package/protocols/templates/safe-erc20/src/SafeERC20.sol +0 -53
- package/protocols/templates/safe-erc20/test/SafeERC20.t.sol +0 -72
- package/scripts/adversarial-bench.mjs +0 -114
- package/scripts/build-dist.mjs +0 -119
- package/scripts/build-inscription.py +0 -230
- package/scripts/check-doc-drift.mjs +0 -123
- package/scripts/check-test-count.mjs +0 -105
- package/scripts/e2e-hl-markets.mjs +0 -21
- package/scripts/e2e-hl-perps.mjs +0 -48
- package/scripts/e2e-hypercore-staking.mjs +0 -128
- package/scripts/e2e-solana-bitcoin.mjs +0 -183
- package/scripts/guard-publish.mjs +0 -22
- package/scripts/protocol-template-gate.mjs +0 -15
- package/scripts/public-api-scan.mjs +0 -23
- package/scripts/publish-dist.mjs +0 -67
- package/scripts/record-hero-cli.sh +0 -80
- package/scripts/secret-scan.mjs +0 -169
- package/scripts/smoke-dist-bins.mjs +0 -89
- package/scripts/verify-dist.mjs +0 -29
- package/scripts/verify-v3-venues.mjs +0 -233
- package/skins/oracle.yaml +0 -56
- package/src/action-receipts.mjs +0 -265
- package/src/action-semantics.mjs +0 -62
- package/src/address-book.mjs +0 -208
- package/src/agent-auth.mjs +0 -206
- package/src/approval-guard.mjs +0 -282
- package/src/attestation-secret.mjs +0 -94
- package/src/audit-log.mjs +0 -196
- package/src/auth/oauth.mjs +0 -672
- package/src/auto-slippage.mjs +0 -378
- package/src/capability-posture.mjs +0 -125
- package/src/cards.mjs +0 -422
- package/src/chains.mjs +0 -62
- package/src/cli/chain-catalog.mjs +0 -215
- package/src/cli/chain-state.mjs +0 -74
- package/src/cli/commands/auth.mjs +0 -193
- package/src/cli/commands/bootstrap.mjs +0 -87
- package/src/cli/commands/chain.mjs +0 -143
- package/src/cli/commands/chat.mjs +0 -465
- package/src/cli/commands/credential.mjs +0 -9
- package/src/cli/commands/data-mcp.mjs +0 -18
- package/src/cli/commands/data.mjs +0 -75
- package/src/cli/commands/doctor.mjs +0 -136
- package/src/cli/commands/equities.mjs +0 -41
- package/src/cli/commands/farm.mjs +0 -129
- package/src/cli/commands/fees.mjs +0 -109
- package/src/cli/commands/follow.mjs +0 -130
- package/src/cli/commands/harness.mjs +0 -63
- package/src/cli/commands/help.mjs +0 -7
- package/src/cli/commands/init.mjs +0 -27
- package/src/cli/commands/mcp.mjs +0 -154
- package/src/cli/commands/model.mjs +0 -106
- package/src/cli/commands/plugins.mjs +0 -275
- package/src/cli/commands/prepare.mjs +0 -12
- package/src/cli/commands/public.mjs +0 -20
- package/src/cli/commands/resolve.mjs +0 -64
- package/src/cli/commands/route.mjs +0 -12
- package/src/cli/commands/runner.mjs +0 -9
- package/src/cli/commands/scan.mjs +0 -12
- package/src/cli/commands/setup.mjs +0 -294
- package/src/cli/commands/sign.mjs +0 -21
- package/src/cli/commands/signer.mjs +0 -9
- package/src/cli/commands/swap.mjs +0 -102
- package/src/cli/commands/upgrade.mjs +0 -12
- package/src/cli/commands/vault.mjs +0 -9
- package/src/cli/commands/version.mjs +0 -22
- package/src/cli/first-run.mjs +0 -23
- package/src/cli/kernel.mjs +0 -262
- package/src/cli/mcp-targets/chatgpt.mjs +0 -51
- package/src/cli/mcp-targets/claude-code.mjs +0 -39
- package/src/cli/mcp-targets/claude-desktop.mjs +0 -24
- package/src/cli/mcp-targets/codex.mjs +0 -41
- package/src/cli/mcp-targets/cursor.mjs +0 -32
- package/src/cli/mcp-targets/shared.mjs +0 -71
- package/src/cli/mcp-targets/vscode.mjs +0 -39
- package/src/cli/messaging-platforms.mjs +0 -217
- package/src/cli/model-config.mjs +0 -78
- package/src/cli/operator-dispatch.mjs +0 -194
- package/src/cli/oracle-harness.py +0 -415
- package/src/cli/paths.mjs +0 -107
- package/src/cli/runtime.mjs +0 -351
- package/src/cli/setup-state.mjs +0 -168
- package/src/cli/spawn-child.mjs +0 -43
- package/src/data/catalog.mjs +0 -858
- package/src/data/desk-data.mjs +0 -877
- package/src/data/http.mjs +0 -253
- package/src/data/names.mjs +0 -188
- package/src/data/provider-endpoint.mjs +0 -94
- package/src/data/providers/aave-v3.mjs +0 -139
- package/src/data/providers/across-bridge.mjs +0 -41
- package/src/data/providers/aerodrome.mjs +0 -245
- package/src/data/providers/aevo.mjs +0 -33
- package/src/data/providers/approval-indexer.mjs +0 -133
- package/src/data/providers/approvals.mjs +0 -594
- package/src/data/providers/babylon-staking.mjs +0 -149
- package/src/data/providers/balancer.mjs +0 -209
- package/src/data/providers/beefy-yields.mjs +0 -45
- package/src/data/providers/birdeye-tokens.mjs +0 -33
- package/src/data/providers/bisq-markets.mjs +0 -145
- package/src/data/providers/bitcoin-esplora.mjs +0 -216
- package/src/data/providers/bitcoin-meta.mjs +0 -378
- package/src/data/providers/blockscout.mjs +0 -14
- package/src/data/providers/bob-rootstock.mjs +0 -198
- package/src/data/providers/braiins-insights.mjs +0 -103
- package/src/data/providers/bridge-aggregator.mjs +0 -259
- package/src/data/providers/bridges.mjs +0 -242
- package/src/data/providers/bungee.mjs +0 -29
- package/src/data/providers/celestia-da.mjs +0 -38
- package/src/data/providers/changenow.mjs +0 -135
- package/src/data/providers/compound.mjs +0 -32
- package/src/data/providers/connext.mjs +0 -28
- package/src/data/providers/convex.mjs +0 -30
- package/src/data/providers/cow-protocol.mjs +0 -110
- package/src/data/providers/cowswap.mjs +0 -415
- package/src/data/providers/curve.mjs +0 -201
- package/src/data/providers/das-assets.mjs +0 -59
- package/src/data/providers/debridge.mjs +0 -109
- package/src/data/providers/defillama.mjs +0 -88
- package/src/data/providers/dexscreener.mjs +0 -43
- package/src/data/providers/drift.mjs +0 -32
- package/src/data/providers/dydx.mjs +0 -41
- package/src/data/providers/evm-rpc.mjs +0 -225
- package/src/data/providers/farming.mjs +0 -291
- package/src/data/providers/geckoterminal.mjs +0 -34
- package/src/data/providers/gmx.mjs +0 -496
- package/src/data/providers/hiro-stacks.mjs +0 -150
- package/src/data/providers/hl-assets.mjs +0 -165
- package/src/data/providers/hl-info.mjs +0 -108
- package/src/data/providers/hl-markets.mjs +0 -210
- package/src/data/providers/hl-outcome.mjs +0 -61
- package/src/data/providers/hl-perps.mjs +0 -419
- package/src/data/providers/hl-staking.mjs +0 -353
- package/src/data/providers/hl-ws.mjs +0 -119
- package/src/data/providers/hyperevm-dex.mjs +0 -49
- package/src/data/providers/jito-mev.mjs +0 -117
- package/src/data/providers/jupiter-venues.mjs +0 -119
- package/src/data/providers/jupiter.mjs +0 -315
- package/src/data/providers/kamino-strategies.mjs +0 -143
- package/src/data/providers/l2beat-tvl.mjs +0 -42
- package/src/data/providers/lifi.mjs +0 -166
- package/src/data/providers/liquid-esplora.mjs +0 -152
- package/src/data/providers/magiceden-ordinals.mjs +0 -141
- package/src/data/providers/magiceden-sol.mjs +0 -406
- package/src/data/providers/mempool-lightning.mjs +0 -144
- package/src/data/providers/mempool-mining.mjs +0 -142
- package/src/data/providers/meteora-dlmm.mjs +0 -168
- package/src/data/providers/morpho.mjs +0 -177
- package/src/data/providers/nft-gallery.mjs +0 -163
- package/src/data/providers/nft-portfolio.mjs +0 -494
- package/src/data/providers/odos.mjs +0 -156
- package/src/data/providers/ondo.mjs +0 -31
- package/src/data/providers/oneinch.mjs +0 -174
- package/src/data/providers/opensea-multichain.mjs +0 -136
- package/src/data/providers/opensea-nft.mjs +0 -371
- package/src/data/providers/orca.mjs +0 -29
- package/src/data/providers/ordinals-runes.mjs +0 -180
- package/src/data/providers/pancakeswap.mjs +0 -28
- package/src/data/providers/paraswap.mjs +0 -125
- package/src/data/providers/pendle.mjs +0 -188
- package/src/data/providers/poly-clob.mjs +0 -283
- package/src/data/providers/poly-public.mjs +0 -96
- package/src/data/providers/poly-ws.mjs +0 -103
- package/src/data/providers/polygon-staking.mjs +0 -227
- package/src/data/providers/portfolio-history.mjs +0 -394
- package/src/data/providers/portfolio.mjs +0 -600
- package/src/data/providers/pyth-price-feeds.mjs +0 -172
- package/src/data/providers/raydium.mjs +0 -35
- package/src/data/providers/relayscan-mev.mjs +0 -72
- package/src/data/providers/rfq.mjs +0 -15
- package/src/data/providers/rh-agent.mjs +0 -59
- package/src/data/providers/sanctum-lst.mjs +0 -180
- package/src/data/providers/satflow.mjs +0 -341
- package/src/data/providers/signed-material-guard.mjs +0 -108
- package/src/data/providers/solana-rpc.mjs +0 -197
- package/src/data/providers/solend-lending.mjs +0 -166
- package/src/data/providers/spark-lend.mjs +0 -42
- package/src/data/providers/squid-router.mjs +0 -29
- package/src/data/providers/stargate.mjs +0 -29
- package/src/data/providers/sushiswap.mjs +0 -30
- package/src/data/providers/symbiotic-restaking.mjs +0 -41
- package/src/data/providers/thorchain.mjs +0 -36
- package/src/data/providers/traderjoe.mjs +0 -28
- package/src/data/providers/twap.mjs +0 -152
- package/src/data/providers/uniswap-v3.mjs +0 -457
- package/src/data/providers/uniswap-v4.mjs +0 -414
- package/src/data/providers/vertex.mjs +0 -41
- package/src/data/providers/wallet-watch.mjs +0 -264
- package/src/data/providers/wormhole.mjs +0 -28
- package/src/data/providers/yearn.mjs +0 -31
- package/src/data/providers/zerox.mjs +0 -167
- package/src/data/public-api-scan.mjs +0 -61
- package/src/data/quote-placeholder.mjs +0 -31
- package/src/desk/swap-prepare.mjs +0 -194
- package/src/equities/bridge.mjs +0 -388
- package/src/equities/fixtures/bridge_routes.json +0 -159
- package/src/equities/fixtures/dst_transitions.json +0 -29
- package/src/equities/fixtures/equity_dex_pools.json +0 -154
- package/src/equities/fixtures/hip3_l2books.json +0 -2711
- package/src/equities/fixtures/nyse_holidays.json +0 -1
- package/src/equities/fixtures/oracles.json +0 -100
- package/src/equities/fixtures/rh_pool_state.json +0 -244
- package/src/equities/fixtures/solana_xstocks.json +0 -704
- package/src/equities/fixtures/ton_xstocks.json +0 -35
- package/src/equities/fixtures/universe.json +0 -411
- package/src/equities/fixtures/venues.json +0 -3542
- package/src/equities/fixtures.mjs +0 -405
- package/src/equities/funding.mjs +0 -142
- package/src/equities/index.mjs +0 -166
- package/src/equities/liveness.mjs +0 -148
- package/src/equities/marketHours.mjs +0 -249
- package/src/equities/normalize.mjs +0 -295
- package/src/equities/num.mjs +0 -146
- package/src/equities/prepare.mjs +0 -95
- package/src/equities/rank.mjs +0 -260
- package/src/equities/sourceNum.mjs +0 -69
- package/src/equities/types.mjs +0 -220
- package/src/equities/venues/arcus-perp.mjs +0 -84
- package/src/equities/venues/arcus-spot.mjs +0 -105
- package/src/equities/venues/hyperliquid-hip3.mjs +0 -224
- package/src/equities/venues/rh-uniswap.mjs +0 -216
- package/src/equities/venues/solana-xstocks.mjs +0 -139
- package/src/equities/venues/ton-stonfi.mjs +0 -139
- package/src/exact-integer.mjs +0 -72
- package/src/exec-policy.mjs +0 -419
- package/src/flags.mjs +0 -15
- package/src/fresh-window.mjs +0 -76
- package/src/gmx-attestation.mjs +0 -176
- package/src/index.mjs +0 -107
- package/src/licensing/locals-only.mjs +0 -25
- package/src/nft-gas-war-guard.mjs +0 -139
- package/src/onboarding/agent-keys.mjs +0 -161
- package/src/onboarding/harness-configs.mjs +0 -102
- package/src/onboarding/index.mjs +0 -18
- package/src/onboarding/tiers.mjs +0 -139
- package/src/oracle-env.mjs +0 -55
- package/src/package-manifest.mjs +0 -42
- package/src/plugins/agent-plugin-loader.mjs +0 -225
- package/src/portfolio-risk.mjs +0 -170
- package/src/prepare-envelope.mjs +0 -204
- package/src/profile-upgrade.mjs +0 -277
- package/src/protocol-execution.mjs +0 -84
- package/src/protocol-templates/gate.mjs +0 -179
- package/src/protocol-templates/prepare-deploy.mjs +0 -81
- package/src/public-api/agent-grants.mjs +0 -57
- package/src/public-api/buzz-integration.mjs +0 -267
- package/src/public-api/connect-agent.mjs +0 -424
- package/src/public-api/grants.mjs +0 -142
- package/src/public-api/http.mjs +0 -707
- package/src/public-api/metering.mjs +0 -111
- package/src/public-control/aa-adapter.mjs +0 -402
- package/src/public-control/build-registry.mjs +0 -227
- package/src/public-control/bundler-client.mjs +0 -357
- package/src/public-control/grant-indexer.mjs +0 -296
- package/src/public-control/policy-render.mjs +0 -69
- package/src/public-control/policy-schema.mjs +0 -322
- package/src/public-control/runtime-config.mjs +0 -275
- package/src/public-control/session-key-model.mjs +0 -379
- package/src/public-control/session-orchestrator.mjs +0 -418
- package/src/rfq/intent.mjs +0 -180
- package/src/rfq/sources.mjs +0 -181
- package/src/route-attestation.mjs +0 -132
- package/src/router/best-execution.mjs +0 -326
- package/src/router/index.mjs +0 -250
- package/src/router/integrator-fee.mjs +0 -135
- package/src/router/prepare-bridge.mjs +0 -293
- package/src/router/prepare-route.mjs +0 -398
- package/src/router/proposal.mjs +0 -311
- package/src/router/risk-classifier.mjs +0 -119
- package/src/router/route-sources.mjs +0 -364
- package/src/scanner/chains.config.mjs +0 -543
- package/src/scanner/contract.mjs +0 -270
- package/src/scanner/evm-scanner.mjs +0 -394
- package/src/scanner/index.mjs +0 -9
- package/src/scanner/v2-venue.mjs +0 -351
- package/src/scanner/v3-venue.mjs +0 -308
- package/src/scopes.mjs +0 -44
- package/src/sell-simulation.mjs +0 -167
- package/src/signals/engine.mjs +0 -146
- package/src/signals/index.mjs +0 -1
- package/src/token-transfer-guard.mjs +0 -188
- package/src/tui/app.mjs +0 -438
- package/src/tui/backend.mjs +0 -215
- package/src/tui/format.mjs +0 -272
- package/src/tui/gateway-client.mjs +0 -177
- package/src/tui/input.mjs +0 -501
- package/src/tui/memory.mjs +0 -105
- package/src/tui/meta-learn.mjs +0 -85
- package/src/tui/renderer.mjs +0 -443
- package/src/tui/scheduler.mjs +0 -205
- package/src/tui/skills-loader.mjs +0 -140
- package/src/tui/standalone-client.mjs +0 -752
- package/src/tui/theme.mjs +0 -81
- package/src/vault-attestation.mjs +0 -146
- package/src/venues.mjs +0 -206
- package/src/watch-preferences.mjs +0 -85
- /package/{profiles → dist/assets/profiles}/_template/SOUL.md +0 -0
- /package/{profiles → dist/assets/profiles}/_template/profile.json +0 -0
- /package/{profiles → dist/assets/profiles}/bitcoin-agent/SOUL.md +0 -0
- /package/{profiles → dist/assets/profiles}/bitcoin-agent/profile.json +0 -0
- /package/{profiles → dist/assets/profiles}/hyperliquid-agent/SOUL.md +0 -0
- /package/{profiles → dist/assets/profiles}/hyperliquid-agent/profile.json +0 -0
- /package/{profiles → dist/assets/profiles}/oracle/SOUL.md +0 -0
- /package/{profiles → dist/assets/profiles}/oracle/profile.json +0 -0
- /package/{profiles → dist/assets/profiles}/polymarket-agent/SOUL.md +0 -0
- /package/{profiles → dist/assets/profiles}/polymarket-agent/profile.json +0 -0
- /package/{profiles → dist/assets/profiles}/profile.schema.json +0 -0
- /package/{profiles → dist/assets/profiles}/protocol-builder/SOUL.md +0 -0
- /package/{profiles → dist/assets/profiles}/protocol-builder/profile.json +0 -0
- /package/{profiles → dist/assets/profiles}/robinhood-agent/SOUL.md +0 -0
- /package/{profiles → dist/assets/profiles}/robinhood-agent/profile.json +0 -0
- /package/{profiles → dist/assets/profiles}/solana-agent/SOUL.md +0 -0
- /package/{profiles → dist/assets/profiles}/solana-agent/profile.json +0 -0
- /package/{profiles → dist/assets/profiles}/stable-agent/SOUL.md +0 -0
- /package/{profiles → dist/assets/profiles}/stable-agent/profile.json +0 -0
- /package/{skills → dist/assets/skills}/balance/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/bitcoin-l1.md +0 -0
- /package/{skills → dist/assets/skills}/chain-defi-ecosystem-profiling.md +0 -0
- /package/{skills → dist/assets/skills}/evm-contract-research.md +0 -0
- /package/{skills → dist/assets/skills}/hyperliquid.md +0 -0
- /package/{skills → dist/assets/skills}/multichain-exec-desk.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-action-semantics/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-best-execution/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-best-execution.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-bitcoin/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-chain-graphs-telegram-cards/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-chat/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-chat/chain.SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-chat/setup.SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-circuit-breaker/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-contract-research/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-desk/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-desk.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-dex-launch/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-equities/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-grants/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-hypercore-staking/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-hyperliquid/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-meme-token-sniper/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-multichain-nft-launch/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-multichain-token-launch/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-nft-gacha-launch/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-nft-mint-gas-war/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-polymarket/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-protocol-builder/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-protocol-security/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-public-product/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-receipts/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-receipts.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-rfq-tokenized-assets/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-smart-wallet-scanner/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-solana/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-solana-nft/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/oracle-token-research/SKILL.md +0 -0
- /package/{skills → dist/assets/skills}/solana.md +0 -0
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
// Pyth Hermes price feeds — keyless real-time Solana-native oracle reads.
|
|
2
|
-
//
|
|
3
|
-
// Hermes serves the same signed price updates Solana on-chain programs consume,
|
|
4
|
-
// so this is the price surface an operator should quote against when the
|
|
5
|
-
// counterparty is a Pyth-pulling program. Read-only: this module never returns
|
|
6
|
-
// the binary VAA as something executable, only the parsed price alongside it.
|
|
7
|
-
|
|
8
|
-
import { httpJson } from "../http.mjs";
|
|
9
|
-
|
|
10
|
-
export const PYTH_HERMES_API = "https://hermes.pyth.network";
|
|
11
|
-
|
|
12
|
-
// Well-known mainnet feed ids (hex, no 0x). Handy defaults for health + lookups.
|
|
13
|
-
export const PYTH_FEEDS = {
|
|
14
|
-
"SOL/USD": "ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d",
|
|
15
|
-
"BTC/USD": "e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
|
|
16
|
-
"ETH/USD": "ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace",
|
|
17
|
-
"USDC/USD": "eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a",
|
|
18
|
-
"USDT/USD": "2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",
|
|
19
|
-
"JUP/USD": "0a0408d619e9380abad35060f9192039ed5042fa6f82301d0e48bb52be830996",
|
|
20
|
-
"JTO/USD": "b43660a5f790c69354b0729a5ef9d50d68f1df92107540210b9cccba1f947cc2",
|
|
21
|
-
"BONK/USD": "72b021217ca3fe68922a19aaf990109cb9d84e9ad004b4d2025ad6f529314419",
|
|
22
|
-
"PYTH/USD": "0bbf28e9a841a1cc788f6a361b17ca072d0ea3098a1e5df1c3922d06719579ff",
|
|
23
|
-
"HYPE/USD": "4279e31cc369bbcc2faf022b382b080e32a8e689ff20fbc530d2a603eb6cd98b",
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const FEED_ID_RE = /^[0-9a-fA-F]{64}$/;
|
|
27
|
-
|
|
28
|
-
function base(opts = {}) {
|
|
29
|
-
return String(opts.baseUrl || process.env.PYTH_HERMES_URL || PYTH_HERMES_API).replace(/\/$/, "");
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Accept a raw hex feed id, an "0x"-prefixed id, or a symbol from PYTH_FEEDS.
|
|
34
|
-
* Anything else is rejected rather than forwarded — a malformed id silently
|
|
35
|
-
* drops out of the Hermes response and would otherwise look like a missing
|
|
36
|
-
* price rather than a caller bug.
|
|
37
|
-
*/
|
|
38
|
-
export function pythFeedId(value, label = "feedId") {
|
|
39
|
-
const raw = String(value ?? "").trim();
|
|
40
|
-
if (!raw) throw new Error(`pyth-price-feeds: ${label} required`);
|
|
41
|
-
const known = PYTH_FEEDS[raw.toUpperCase()] || PYTH_FEEDS[`${raw.toUpperCase()}/USD`];
|
|
42
|
-
if (known) return known;
|
|
43
|
-
const hex = raw.startsWith("0x") || raw.startsWith("0X") ? raw.slice(2) : raw;
|
|
44
|
-
if (!FEED_ID_RE.test(hex)) {
|
|
45
|
-
throw new Error(`pyth-price-feeds: ${label} must be a 32-byte hex feed id or a known symbol`);
|
|
46
|
-
}
|
|
47
|
-
return hex.toLowerCase();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function scaled(component = {}) {
|
|
51
|
-
const price = Number(component.price);
|
|
52
|
-
const expo = Number(component.expo);
|
|
53
|
-
if (!Number.isFinite(price) || !Number.isFinite(expo)) return null;
|
|
54
|
-
return price * 10 ** expo;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function normalizeParsed(item = {}) {
|
|
58
|
-
const conf = scaled({ price: Number(item.price?.conf), expo: item.price?.expo });
|
|
59
|
-
const value = scaled(item.price);
|
|
60
|
-
return {
|
|
61
|
-
id: item.id || null,
|
|
62
|
-
price: value,
|
|
63
|
-
confidence: conf,
|
|
64
|
-
// Confidence relative to price — the number that actually decides whether a
|
|
65
|
-
// quote is safe to act on. A wide band means Pyth publishers disagree.
|
|
66
|
-
confidenceBps: value && conf != null ? Math.round((conf / Math.abs(value)) * 10_000) : null,
|
|
67
|
-
emaPrice: scaled(item.ema_price),
|
|
68
|
-
publishTime: item.price?.publish_time ?? null,
|
|
69
|
-
publishTimeIso: item.price?.publish_time ? new Date(item.price.publish_time * 1000).toISOString() : null,
|
|
70
|
-
ageSeconds: item.price?.publish_time ? Math.max(0, Math.round(Date.now() / 1000 - item.price.publish_time)) : null,
|
|
71
|
-
expo: item.price?.expo ?? null,
|
|
72
|
-
raw: {
|
|
73
|
-
price: item.price ?? null,
|
|
74
|
-
emaPrice: item.ema_price ?? null,
|
|
75
|
-
metadata: item.metadata ?? null,
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
async function fetchLatest(ids, opts = {}) {
|
|
81
|
-
const url = new URL(`${base(opts)}/v2/updates/price/latest`);
|
|
82
|
-
for (const id of ids) url.searchParams.append("ids[]", id);
|
|
83
|
-
url.searchParams.set("encoding", "hex");
|
|
84
|
-
url.searchParams.set("parsed", "true");
|
|
85
|
-
// Without this a single retired id 400s the whole batch.
|
|
86
|
-
url.searchParams.set("ignore_invalid_price_ids", "true");
|
|
87
|
-
return httpJson(url.toString(), {
|
|
88
|
-
fetchImpl: opts.fetchImpl,
|
|
89
|
-
timeoutMs: opts.timeoutMs ?? 12_000,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export async function pythHealth(opts = {}) {
|
|
94
|
-
try {
|
|
95
|
-
const data = await fetchLatest([PYTH_FEEDS["SOL/USD"]], opts);
|
|
96
|
-
const parsed = Array.isArray(data?.parsed) ? data.parsed.map(normalizeParsed) : [];
|
|
97
|
-
const sol = parsed[0] || null;
|
|
98
|
-
return {
|
|
99
|
-
ok: Boolean(sol && Number.isFinite(sol.price) && sol.price > 0),
|
|
100
|
-
provider: "pyth-price-feeds",
|
|
101
|
-
solUsd: sol?.price ?? null,
|
|
102
|
-
ageSeconds: sol?.ageSeconds ?? null,
|
|
103
|
-
exec: false,
|
|
104
|
-
};
|
|
105
|
-
} catch (error) {
|
|
106
|
-
return { ok: false, provider: "pyth-price-feeds", error: String(error?.message || error), exec: false };
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export async function pythLatestPrice(args = {}, opts = {}) {
|
|
111
|
-
const id = pythFeedId(args.feedId || args.id || args.symbol, "feedId");
|
|
112
|
-
const data = await fetchLatest([id], opts);
|
|
113
|
-
const parsed = Array.isArray(data?.parsed) ? data.parsed.map(normalizeParsed) : [];
|
|
114
|
-
const price = parsed.find((p) => String(p.id).toLowerCase() === id) || parsed[0] || null;
|
|
115
|
-
if (!price) throw new Error(`pyth-price-feeds: no price returned for feed ${id}`);
|
|
116
|
-
return {
|
|
117
|
-
provider: "pyth-price-feeds",
|
|
118
|
-
chain: "solana-mainnet-beta",
|
|
119
|
-
feedId: id,
|
|
120
|
-
...price,
|
|
121
|
-
// The signed update bytes an on-chain Pyth consumer would post. Surfaced
|
|
122
|
-
// for inspection only — Oracle never submits it.
|
|
123
|
-
binaryUpdate: data?.binary?.data?.[0] || null,
|
|
124
|
-
binaryEncoding: data?.binary?.encoding || null,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export async function pythLatestPrices(args = {}, opts = {}) {
|
|
129
|
-
const list = Array.isArray(args) ? args : args.feedIds || args.ids || args.symbols || [];
|
|
130
|
-
const ids = [...new Set(list.map((v) => pythFeedId(v, "feedIds[]")))];
|
|
131
|
-
if (!ids.length) throw new Error("pyth-price-feeds: feedIds[] required");
|
|
132
|
-
// Hermes caps a single query string; chunk so large batches still resolve.
|
|
133
|
-
const CHUNK = 40;
|
|
134
|
-
const chunks = [];
|
|
135
|
-
for (let i = 0; i < ids.length; i += CHUNK) chunks.push(ids.slice(i, i + CHUNK));
|
|
136
|
-
const responses = [];
|
|
137
|
-
for (const chunk of chunks) responses.push(await fetchLatest(chunk, opts));
|
|
138
|
-
const prices = responses.flatMap((data) => (Array.isArray(data?.parsed) ? data.parsed.map(normalizeParsed) : []));
|
|
139
|
-
const byId = Object.fromEntries(prices.map((p) => [String(p.id).toLowerCase(), p]));
|
|
140
|
-
return {
|
|
141
|
-
provider: "pyth-price-feeds",
|
|
142
|
-
chain: "solana-mainnet-beta",
|
|
143
|
-
requested: ids.length,
|
|
144
|
-
returned: prices.length,
|
|
145
|
-
missing: ids.filter((id) => !byId[id]),
|
|
146
|
-
prices,
|
|
147
|
-
byId,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export async function pythFeedDirectory(args = {}, opts = {}) {
|
|
152
|
-
const url = new URL(`${base(opts)}/v2/price_feeds`);
|
|
153
|
-
if (args.query) url.searchParams.set("query", String(args.query));
|
|
154
|
-
url.searchParams.set("asset_type", String(args.assetType || "crypto"));
|
|
155
|
-
const feeds = await httpJson(url.toString(), {
|
|
156
|
-
fetchImpl: opts.fetchImpl,
|
|
157
|
-
timeoutMs: opts.timeoutMs ?? 15_000,
|
|
158
|
-
});
|
|
159
|
-
const list = Array.isArray(feeds) ? feeds : [];
|
|
160
|
-
return {
|
|
161
|
-
provider: "pyth-price-feeds",
|
|
162
|
-
count: list.length,
|
|
163
|
-
feeds: list.map((f) => ({
|
|
164
|
-
id: f.id,
|
|
165
|
-
symbol: f.attributes?.symbol || null,
|
|
166
|
-
displaySymbol: f.attributes?.display_symbol || null,
|
|
167
|
-
base: f.attributes?.base || null,
|
|
168
|
-
quote: f.attributes?.quote_currency || null,
|
|
169
|
-
assetType: f.attributes?.asset_type || null,
|
|
170
|
-
})),
|
|
171
|
-
};
|
|
172
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// Raydium — largest Solana DEX (AMM + CLMM).
|
|
2
|
-
// https://docs.raydium.io — public REST API via Jupiter routing.
|
|
3
|
-
// Never signs, never broadcasts.
|
|
4
|
-
|
|
5
|
-
import { httpJson } from "../http.mjs";
|
|
6
|
-
|
|
7
|
-
const JUPITER_QUOTE_API = "https://quote-api.jup.ag/v6";
|
|
8
|
-
|
|
9
|
-
export async function raydiumQuote({ inputMint, outputMint, amount, slippageBps = 50 } = {}) {
|
|
10
|
-
if (!inputMint || !outputMint || !amount) {
|
|
11
|
-
return { error: "raydium quote requires inputMint, outputMint, amount" };
|
|
12
|
-
}
|
|
13
|
-
try {
|
|
14
|
-
const params = new URLSearchParams({ inputMint, outputMint, amount: String(amount), slippageBps: String(slippageBps), onlyDirectRoutes: "true" });
|
|
15
|
-
const data = await httpJson(`${JUPITER_QUOTE_API}/quote?${params}`);
|
|
16
|
-
// Filter for Raydium routes specifically
|
|
17
|
-
const raydiumRoutes = (data?.routePlan || []).filter(r => r?.swapInfo?.label?.toLowerCase().includes("raydium"));
|
|
18
|
-
return {
|
|
19
|
-
amountOut: data?.outAmount,
|
|
20
|
-
priceImpactPct: data?.priceImpactPct,
|
|
21
|
-
raydiumRoutes: raydiumRoutes.length,
|
|
22
|
-
allRoutes: data?.routePlan?.length || 0,
|
|
23
|
-
};
|
|
24
|
-
} catch (e) {
|
|
25
|
-
return { error: String(e.message || e).slice(0, 200) };
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function raydiumHealth() {
|
|
30
|
-
try {
|
|
31
|
-
return { ok: true, note: "Raydium routes through Jupiter aggregator on Solana" };
|
|
32
|
-
} catch (e) {
|
|
33
|
-
return { ok: false, error: String(e.message || e).slice(0, 160) };
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Relayscan (Flashbots) — Ethereum MEV-Boost relay + builder monitoring, no key.
|
|
2
|
-
//
|
|
3
|
-
// Read-only mainnet MEV data: relay payload share, builder block counts and
|
|
4
|
-
// measured builder profit, and per-day aggregates.
|
|
5
|
-
//
|
|
6
|
-
// Endpoint reality, probed live 2026-08-06:
|
|
7
|
-
// GET /overview/json?t=24h -> 200
|
|
8
|
-
// GET /builder-profit/json?t=24h -> 200
|
|
9
|
-
// GET /stats/day/{YYYY-MM-DD}/json -> 200 (there is NO /stats/day/json)
|
|
10
|
-
// Supported `t` windows mirror the site nav: 1h, 12h, 24h, 7d.
|
|
11
|
-
|
|
12
|
-
import { httpJson } from "../http.mjs";
|
|
13
|
-
|
|
14
|
-
export const RELAYSCAN_API = "https://relayscan.io";
|
|
15
|
-
|
|
16
|
-
const TIMESPANS = new Set(["1h", "12h", "24h", "7d"]);
|
|
17
|
-
|
|
18
|
-
function base(opts = {}) {
|
|
19
|
-
return (opts.baseUrl || process.env.RELAYSCAN_API_URL || RELAYSCAN_API).replace(/\/$/, "");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function timespan(args = {}) {
|
|
23
|
-
const t = String(args.timespan || args.t || "24h").toLowerCase();
|
|
24
|
-
if (!TIMESPANS.has(t)) throw new Error(`relayscan-mev: timespan must be one of ${[...TIMESPANS].join(", ")}`);
|
|
25
|
-
return t;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function isoDate(args = {}) {
|
|
29
|
-
// Default to yesterday: today's bucket is incomplete until UTC midnight.
|
|
30
|
-
const raw = args.date || args.day;
|
|
31
|
-
if (raw == null) {
|
|
32
|
-
const d = new Date(Date.now() - 24 * 60 * 60 * 1000);
|
|
33
|
-
return d.toISOString().slice(0, 10);
|
|
34
|
-
}
|
|
35
|
-
const text = String(raw).trim();
|
|
36
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(text)) throw new Error("relayscan-mev: date must be YYYY-MM-DD");
|
|
37
|
-
return text;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Relay payload share over a window (which relays delivered blocks). */
|
|
41
|
-
export async function relayscanOverview(args = {}, opts = {}) {
|
|
42
|
-
return httpJson(`${base(opts)}/overview/json?t=${timespan(args)}`, {
|
|
43
|
-
fetchImpl: opts.fetchImpl,
|
|
44
|
-
timeoutMs: opts.timeoutMs ?? 20_000,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** Per-builder block counts and measured profit (coinbase balance delta). */
|
|
49
|
-
export async function relayscanBuilderProfit(args = {}, opts = {}) {
|
|
50
|
-
return httpJson(`${base(opts)}/builder-profit/json?t=${timespan(args)}`, {
|
|
51
|
-
fetchImpl: opts.fetchImpl,
|
|
52
|
-
timeoutMs: opts.timeoutMs ?? 20_000,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/** One UTC day of relay + builder aggregates. */
|
|
57
|
-
export async function relayscanDailyStats(args = {}, opts = {}) {
|
|
58
|
-
const date = isoDate(args);
|
|
59
|
-
return httpJson(`${base(opts)}/stats/day/${date}/json`, {
|
|
60
|
-
fetchImpl: opts.fetchImpl,
|
|
61
|
-
timeoutMs: opts.timeoutMs ?? 25_000,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export async function relayscanHealth(opts = {}) {
|
|
66
|
-
const data = await relayscanOverview({ timespan: "1h" }, opts);
|
|
67
|
-
return {
|
|
68
|
-
ok: Array.isArray(data?.relays) && data.relays.length > 0,
|
|
69
|
-
provider: "relayscan-mev",
|
|
70
|
-
relays: Array.isArray(data?.relays) ? data.relays.length : 0,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { normalizeRfqIntent } from "../../rfq/intent.mjs";
|
|
2
|
-
import { requestRfqQuotes } from "../../rfq/sources.mjs";
|
|
3
|
-
|
|
4
|
-
export function rfqIntent(args = {}, opts = {}) {
|
|
5
|
-
return normalizeRfqIntent(args, opts);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export async function rfqQuote(args = {}, opts = {}) {
|
|
9
|
-
const intent = args.intent?.kind === "rfq-intent" ? args.intent : normalizeRfqIntent(args, opts);
|
|
10
|
-
return requestRfqQuotes(intent, opts);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export async function rfqHealth() {
|
|
14
|
-
return { ok: true, provider: "rfq", mode: "intent-rfq", execution: "prepare" };
|
|
15
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
// RH agent HTTP read client — talks to the live RH product over HTTP.
|
|
2
|
-
// Unauthenticated D0/D1 ops only. Does NOT import rhbot.
|
|
3
|
-
|
|
4
|
-
import { httpJson } from "../http.mjs";
|
|
5
|
-
|
|
6
|
-
export const RH_AGENT_DEFAULT_BASE = "http://127.0.0.1:8792";
|
|
7
|
-
|
|
8
|
-
function baseUrl(opts = {}) {
|
|
9
|
-
return (
|
|
10
|
-
opts.baseUrl ||
|
|
11
|
-
process.env.RH_AGENT_BASE_URL ||
|
|
12
|
-
process.env.RH_AGENT_URL ||
|
|
13
|
-
RH_AGENT_DEFAULT_BASE
|
|
14
|
-
).replace(/\/$/, "");
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async function get(path, opts = {}) {
|
|
18
|
-
return httpJson(`${baseUrl(opts)}${path}`, {
|
|
19
|
-
fetchImpl: opts.fetchImpl,
|
|
20
|
-
timeoutMs: opts.timeoutMs,
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export async function rhHealth(opts = {}) {
|
|
25
|
-
return get("/api/health", opts);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export async function rhPolicy(opts = {}) {
|
|
29
|
-
return get("/api/agent/policy", opts);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// D1 — public RH routes (no requireUser)
|
|
33
|
-
export async function rhChainConfig(opts = {}) {
|
|
34
|
-
return get("/api/chain/config", opts);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export async function rhChainGas(opts = {}) {
|
|
38
|
-
return get("/api/chain/gas", opts);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export async function rhSwapsConfig(opts = {}) {
|
|
42
|
-
return get("/api/swaps/config", opts);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export async function rhSwapsPresets(opts = {}) {
|
|
46
|
-
return get("/api/swaps/presets", opts);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export async function rhTradingStatus(opts = {}) {
|
|
50
|
-
return get("/api/trading/status", opts);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export async function rhNftDrops(opts = {}) {
|
|
54
|
-
return get("/api/nft-drops", opts);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export async function rhFeeEstimate(opts = {}) {
|
|
58
|
-
return get("/api/fee/estimate", opts);
|
|
59
|
-
}
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
// Sanctum — Solana liquid staking token (LST) directory, APY, and TVL.
|
|
2
|
-
//
|
|
3
|
-
// Sanctum's extra-api is the keyless aggregate view across every LST in the
|
|
4
|
-
// Sanctum universe (JitoSOL, mSOL, bSOL, and the long tail of validator LSTs).
|
|
5
|
-
// Read-only: no stake, unstake, or swap preparation lives here.
|
|
6
|
-
//
|
|
7
|
-
// Endpoint shape notes learned the hard way:
|
|
8
|
-
// - there is no /v1/apy/indiv; the individual read is the same batch
|
|
9
|
-
// endpoint with one lst= parameter
|
|
10
|
-
// - every apy/tvl endpoint REQUIRES at least one lst= query parameter and
|
|
11
|
-
// returns HTTP 400 "missing field lst" without one
|
|
12
|
-
// - lst= accepts either the symbol (jitoSOL) or the mint
|
|
13
|
-
|
|
14
|
-
import { httpJson } from "../http.mjs";
|
|
15
|
-
|
|
16
|
-
export const SANCTUM_API = "https://extra-api.sanctum.so";
|
|
17
|
-
// Sanctum's own batch ceiling — larger queries start dropping entries.
|
|
18
|
-
const MAX_BATCH = 30;
|
|
19
|
-
|
|
20
|
-
export const SANCTUM_MAJOR_LSTS = ["jitoSOL", "mSOL", "bSOL", "INF", "hSOL", "bonkSOL", "jupSOL", "dSOL"];
|
|
21
|
-
|
|
22
|
-
function base(opts = {}) {
|
|
23
|
-
return String(opts.baseUrl || process.env.SANCTUM_API_URL || SANCTUM_API).replace(/\/$/, "");
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function lstParam(value, label = "lst") {
|
|
27
|
-
const text = String(value ?? "").trim();
|
|
28
|
-
if (!text || /[?&=\s]/.test(text)) throw new Error(`sanctum-lst: ${label} must be an LST symbol or mint`);
|
|
29
|
-
return text;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function chunk(list, size) {
|
|
33
|
-
const out = [];
|
|
34
|
-
for (let i = 0; i < list.length; i += size) out.push(list.slice(i, i + size));
|
|
35
|
-
return out;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function batched(path, lsts, opts = {}) {
|
|
39
|
-
const merged = {};
|
|
40
|
-
const errs = {};
|
|
41
|
-
for (const group of chunk(lsts, MAX_BATCH)) {
|
|
42
|
-
const url = new URL(`${base(opts)}/v1/${path}`);
|
|
43
|
-
for (const lst of group) url.searchParams.append("lst", lst);
|
|
44
|
-
const data = await httpJson(url.toString(), {
|
|
45
|
-
fetchImpl: opts.fetchImpl,
|
|
46
|
-
timeoutMs: opts.timeoutMs ?? 20_000,
|
|
47
|
-
});
|
|
48
|
-
// Each endpoint names its payload differently (apys / tvls / solValues).
|
|
49
|
-
const payload = data?.apys || data?.tvls || data?.solValues || {};
|
|
50
|
-
Object.assign(merged, payload);
|
|
51
|
-
Object.assign(errs, data?.errs || {});
|
|
52
|
-
}
|
|
53
|
-
return { values: merged, errs };
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export async function sanctumHealth(opts = {}) {
|
|
57
|
-
try {
|
|
58
|
-
// Probe the directory AND a live APY read — the directory alone can serve
|
|
59
|
-
// from cache while the pricing side is down.
|
|
60
|
-
const [directory, apy] = await Promise.all([
|
|
61
|
-
httpJson(`${base(opts)}/v1/lsts`, { fetchImpl: opts.fetchImpl, timeoutMs: opts.timeoutMs ?? 15_000 }),
|
|
62
|
-
batched("apy/inception", ["jitoSOL"], opts),
|
|
63
|
-
]);
|
|
64
|
-
const lsts = Array.isArray(directory?.lsts) ? directory.lsts : [];
|
|
65
|
-
return {
|
|
66
|
-
ok: lsts.length > 0 && Number.isFinite(Number(apy.values.jitoSOL)),
|
|
67
|
-
provider: "sanctum-lst",
|
|
68
|
-
lstCount: lsts.length,
|
|
69
|
-
jitoSolApyInception: Number(apy.values.jitoSOL) ?? null,
|
|
70
|
-
exec: false,
|
|
71
|
-
};
|
|
72
|
-
} catch (error) {
|
|
73
|
-
return { ok: false, provider: "sanctum-lst", error: String(error?.message || error), exec: false };
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export async function sanctumLstList(args = {}, opts = {}) {
|
|
78
|
-
const data = await httpJson(`${base(opts)}/v1/lsts`, {
|
|
79
|
-
fetchImpl: opts.fetchImpl,
|
|
80
|
-
timeoutMs: opts.timeoutMs ?? 20_000,
|
|
81
|
-
});
|
|
82
|
-
let lsts = (Array.isArray(data?.lsts) ? data.lsts : []).map((l) => ({
|
|
83
|
-
symbol: l.symbol || null,
|
|
84
|
-
name: l.name || null,
|
|
85
|
-
mint: l.mint || null,
|
|
86
|
-
decimals: l.decimals ?? null,
|
|
87
|
-
pool: l.pool?.pool || null,
|
|
88
|
-
poolProgram: l.pool?.program || null,
|
|
89
|
-
voteAccount: l.pool?.vote_account || null,
|
|
90
|
-
logoUri: l.logo_uri || null,
|
|
91
|
-
}));
|
|
92
|
-
if (args.symbol) {
|
|
93
|
-
const want = String(args.symbol).toLowerCase();
|
|
94
|
-
lsts = lsts.filter((l) => String(l.symbol || "").toLowerCase() === want || l.mint === args.symbol);
|
|
95
|
-
}
|
|
96
|
-
const limit = Number(args.limit);
|
|
97
|
-
if (Number.isFinite(limit) && limit > 0) lsts = lsts.slice(0, limit);
|
|
98
|
-
return { provider: "sanctum-lst", chain: "solana-mainnet-beta", count: lsts.length, lsts };
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* APY across a set of LSTs. Defaults to the major LSTs rather than all 240+,
|
|
103
|
-
* because the full universe costs 9 upstream round-trips.
|
|
104
|
-
*
|
|
105
|
-
* `latest` is the current-epoch figure and legitimately reads 0 early in an
|
|
106
|
-
* epoch before enough samples land; `inception` is the since-launch figure and
|
|
107
|
-
* is the number to trust for ranking. Both are returned.
|
|
108
|
-
*/
|
|
109
|
-
export async function sanctumApyAll(args = {}, opts = {}) {
|
|
110
|
-
let symbols = args.lsts || args.symbols || null;
|
|
111
|
-
if (args.all === true) {
|
|
112
|
-
const directory = await sanctumLstList({}, opts);
|
|
113
|
-
symbols = directory.lsts.map((l) => l.symbol).filter(Boolean);
|
|
114
|
-
}
|
|
115
|
-
if (!Array.isArray(symbols) || !symbols.length) symbols = SANCTUM_MAJOR_LSTS;
|
|
116
|
-
const list = [...new Set(symbols.map((s) => lstParam(s, "lsts[]")))];
|
|
117
|
-
|
|
118
|
-
const [latest, inception] = await Promise.all([
|
|
119
|
-
batched("apy/latest", list, opts),
|
|
120
|
-
batched("apy/inception", list, opts),
|
|
121
|
-
]);
|
|
122
|
-
|
|
123
|
-
const apys = list.map((symbol) => {
|
|
124
|
-
const epoch = Number(latest.values[symbol]);
|
|
125
|
-
const since = Number(inception.values[symbol]);
|
|
126
|
-
return {
|
|
127
|
-
lst: symbol,
|
|
128
|
-
apyLatest: Number.isFinite(epoch) ? epoch : null,
|
|
129
|
-
apyLatestPct: Number.isFinite(epoch) ? epoch * 100 : null,
|
|
130
|
-
apyInception: Number.isFinite(since) ? since : null,
|
|
131
|
-
apyInceptionPct: Number.isFinite(since) ? since * 100 : null,
|
|
132
|
-
error: latest.errs[symbol] || inception.errs[symbol] || null,
|
|
133
|
-
};
|
|
134
|
-
});
|
|
135
|
-
apys.sort((a, b) => (b.apyInception ?? -1) - (a.apyInception ?? -1));
|
|
136
|
-
|
|
137
|
-
return {
|
|
138
|
-
provider: "sanctum-lst",
|
|
139
|
-
chain: "solana-mainnet-beta",
|
|
140
|
-
count: apys.length,
|
|
141
|
-
apys,
|
|
142
|
-
byLst: Object.fromEntries(apys.map((a) => [a.lst, a])),
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Full picture for one LST: current + inception APY, TVL in lamports, and the
|
|
148
|
-
* SOL value of one token (the number that reveals accrued staking value).
|
|
149
|
-
*/
|
|
150
|
-
export async function sanctumApyIndividual(args = {}, opts = {}) {
|
|
151
|
-
const lst = lstParam(args.lst || args.mint || args.symbol, "lst");
|
|
152
|
-
const [latest, inception, tvl, solValue] = await Promise.all([
|
|
153
|
-
batched("apy/latest", [lst], opts),
|
|
154
|
-
batched("apy/inception", [lst], opts),
|
|
155
|
-
batched("tvl/current", [lst], opts).catch(() => ({ values: {}, errs: {} })),
|
|
156
|
-
batched("sol-value/current", [lst], opts).catch(() => ({ values: {}, errs: {} })),
|
|
157
|
-
]);
|
|
158
|
-
const epoch = Number(latest.values[lst]);
|
|
159
|
-
const since = Number(inception.values[lst]);
|
|
160
|
-
const err = latest.errs[lst] || inception.errs[lst] || null;
|
|
161
|
-
if (!Number.isFinite(epoch) && !Number.isFinite(since)) {
|
|
162
|
-
throw new Error(`sanctum-lst: no APY for ${lst}${err ? ` (${JSON.stringify(err)})` : ""}`);
|
|
163
|
-
}
|
|
164
|
-
const solValueRaw = solValue.values[lst];
|
|
165
|
-
return {
|
|
166
|
-
provider: "sanctum-lst",
|
|
167
|
-
chain: "solana-mainnet-beta",
|
|
168
|
-
lst,
|
|
169
|
-
apyLatest: Number.isFinite(epoch) ? epoch : null,
|
|
170
|
-
apyLatestPct: Number.isFinite(epoch) ? epoch * 100 : null,
|
|
171
|
-
apyInception: Number.isFinite(since) ? since : null,
|
|
172
|
-
apyInceptionPct: Number.isFinite(since) ? since * 100 : null,
|
|
173
|
-
tvlLamports: tvl.values[lst] ?? null,
|
|
174
|
-
tvlSol: tvl.values[lst] != null ? Number(tvl.values[lst]) / 1e9 : null,
|
|
175
|
-
// Lamports of SOL backing one LST token (9 decimals).
|
|
176
|
-
solValueLamports: solValueRaw ?? null,
|
|
177
|
-
solPerToken: solValueRaw != null ? Number(solValueRaw) / 1e9 : null,
|
|
178
|
-
error: err,
|
|
179
|
-
};
|
|
180
|
-
}
|