Skip to content

feat!: remove NETNA_CONFIG and default ABIs to testnet#12

Open
WGB5445 wants to merge 3 commits intomainfrom
logan/upgrade-testnet-and-market-make-bot
Open

feat!: remove NETNA_CONFIG and default ABIs to testnet#12
WGB5445 wants to merge 3 commits intomainfrom
logan/upgrade-testnet-and-market-make-bot

Conversation

@WGB5445
Copy link
Copy Markdown
Collaborator

@WGB5445 WGB5445 commented Apr 13, 2026

Summary

This PR removes the legacy Netna (chain id 208) deployment path, deletes the Netna ABI bundle, and aligns the SDK’s default ABI selection and unknown-chain_id fallback behavior with Aptos testnet (testnet.json). Public configuration exports drop NETNA_CONFIG in favor of TESTNET_CONFIG, with README and all read/write/WebSocket examples updated accordingly. It also adds a runnable examples/write/market_maker_bot.py reference implementation and updates ABI registry tests.

Changes

  • Public API / config: Remove NETNA_CONFIG from exports and migrate NAMED_CONFIGS usage consistently to testnet.
  • ABI registry: Remove CHAIN_ID_NETNA handling; default ABI data and warnings now fall back to testnet instead of Netna.
  • ABI assets: Remove src/decibel/abi/json/netna.json.
  • ABI generation tooling: Update get_abi_filename mapping to match the new configuration surface.
  • Gas station defaults: Remove the Netna-specific gas station URL branch for chain_id == 208.
  • Examples: Replace NETNA_CONFIG with TESTNET_CONFIG across examples; add market_maker_bot.py.
  • Tests: Update tests/abi/test_registry.py for the new default/fallback behavior.

Motivation

Netna-specific ABIs and configuration increase maintenance burden and confuse onboarding relative to the current Aptos testnet deployment model. Centralizing on TESTNET_CONFIG reduces ambiguity and keeps defaults aligned with supported environments.

Verification

  • Run the test suite (notably tests/abi/test_registry.py).
  • Smoke-test a couple of read/write examples against testnet (use dry-run where applicable for trading flows).

Breaking changes

  • NETNA_CONFIG is removed from decibel exports.
  • Default ABI selection no longer uses Netna; consumers relying on Netna-specific ABIs must migrate to an explicit supported configuration.

This commit modifies the README and various example scripts to replace instances of NETNA_CONFIG with TESTNET_CONFIG, ensuring consistency in the configuration used for test network operations. This change enhances clarity and aligns with the intended usage of the Decibel library.
Copilot AI review requested due to automatic review settings April 13, 2026 11:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the legacy Netna (chain id 208) configuration/ABI path and changes the SDK’s default ABI selection and unknown chain_id fallback to Aptos testnet, updating exports, docs, examples, and tests accordingly.

Changes:

  • Removed NETNA_CONFIG from public exports and NAMED_CONFIGS; adjusted gas station defaults to drop Netna-specific URL handling.
  • Updated ABI registry/generation logic to remove chain id 208 and default/fallback to testnet.json; deleted the Netna ABI bundle.
  • Migrated all README/examples from NETNA_CONFIG to TESTNET_CONFIG and added a runnable market_maker_bot.py example.

Reviewed changes

Copilot reviewed 73 out of 73 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/abi/test_registry.py Updates ABI registry tests for testnet default/fallback behavior.
src/decibel/abi/json/netna.json Removes the Netna ABI JSON bundle.
src/decibel/abi/generate.py Removes Netna filename mapping; keeps testnet/mainnet mapping and default naming.
src/decibel/abi/_registry.py Drops chain id 208 handling; defaults and unknown chain fallback now use testnet ABIs.
src/decibel/_fee_pay.py Removes Netna-specific gas station URL default branch.
src/decibel/_constants.py Removes NETNA_CONFIG constant and NAMED_CONFIGS["netna"] entry.
src/decibel/init.py Removes NETNA_CONFIG from top-level exports.
README.md Updates documentation examples and config list to use TESTNET_CONFIG instead of NETNA_CONFIG.
examples/write/withdraw.py Migrates example to TESTNET_CONFIG.
examples/write/withdraw_from_vault.py Migrates example to TESTNET_CONFIG.
examples/write/update_tp_sl_order.py Migrates example to TESTNET_CONFIG and updates address derivations.
examples/write/trigger_matching.py Migrates example to TESTNET_CONFIG and updates address derivations.
examples/write/revoke_delegation.py Migrates example to TESTNET_CONFIG.
examples/write/revoke_builder_fee.py Migrates example to TESTNET_CONFIG.
examples/write/place_twap_order.py Migrates example to TESTNET_CONFIG.
examples/write/place_tp_sl_for_position.py Migrates example to TESTNET_CONFIG and updates address derivations.
examples/write/place_stop_order.py Migrates example to TESTNET_CONFIG.
examples/write/place_order_with_tp_sl.py Migrates example to TESTNET_CONFIG.
examples/write/place_market_order.py Migrates example to TESTNET_CONFIG.
examples/write/place_limit_order.py Migrates example to TESTNET_CONFIG.
examples/write/place_bulk_orders.py Migrates example to TESTNET_CONFIG.
examples/write/market_maker_bot.py Adds a reference market maker bot example using named configs and read/write clients.
examples/write/deposit.py Migrates example to TESTNET_CONFIG.
examples/write/deposit_to_vault.py Migrates example to TESTNET_CONFIG and updates subaccount derivation inputs.
examples/write/delegate_vault_actions.py Migrates example to TESTNET_CONFIG.
examples/write/delegate_trading.py Migrates example to TESTNET_CONFIG and updates subaccount derivation inputs.
examples/write/deactivate_subaccount.py Migrates example to TESTNET_CONFIG.
examples/write/create_vault.py Migrates example to TESTNET_CONFIG.
examples/write/create_subaccount.py Migrates example to TESTNET_CONFIG.
examples/write/configure_market_settings.py Migrates example to TESTNET_CONFIG and updates address derivations.
examples/write/cancel_twap_order.py Migrates example to TESTNET_CONFIG and updates address derivations.
examples/write/cancel_tp_sl_order.py Migrates example to TESTNET_CONFIG and updates address derivations.
examples/write/cancel_order.py Migrates example to TESTNET_CONFIG.
examples/write/cancel_order_by_client_id.py Migrates example to TESTNET_CONFIG.
examples/write/cancel_bulk_order.py Migrates example to TESTNET_CONFIG.
examples/write/approve_builder_fee.py Migrates example to TESTNET_CONFIG.
examples/write/activate_vault.py Migrates example to TESTNET_CONFIG.
examples/read/ws/subscribe_user_trade_history.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_user_positions.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_user_order_history.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_user_open_orders.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_user_notifications.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_user_bulk_orders.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_user_active_twaps.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_market_trades.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_market_price.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_market_depth.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_candlesticks.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_all_market_prices.py Migrates WS example to TESTNET_CONFIG.
examples/read/ws/subscribe_account_overview.py Migrates WS example to TESTNET_CONFIG.
examples/read/list_market_addresses.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_twap_history.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_trade_history.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_subaccounts.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_positions.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_order_history.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_open_orders.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_funding_history.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_fund_history.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_bulk_orders.py Migrates read example to TESTNET_CONFIG.
examples/read/get_user_active_twaps.py Migrates read example to TESTNET_CONFIG.
examples/read/get_trading_points.py Migrates read example to TESTNET_CONFIG.
examples/read/get_portfolio_chart.py Migrates read example to TESTNET_CONFIG.
examples/read/get_market_trades.py Migrates read example to TESTNET_CONFIG.
examples/read/get_market_price.py Migrates read example to TESTNET_CONFIG.
examples/read/get_market_depth.py Migrates read example to TESTNET_CONFIG.
examples/read/get_market_contexts.py Migrates read example to TESTNET_CONFIG.
examples/read/get_leaderboard.py Migrates read example to TESTNET_CONFIG.
examples/read/get_delegations.py Migrates read example to TESTNET_CONFIG.
examples/read/get_candlesticks.py Migrates read example to TESTNET_CONFIG.
examples/read/get_all_markets.py Migrates read example to TESTNET_CONFIG.
examples/read/get_all_market_prices.py Migrates read example to TESTNET_CONFIG.
examples/read/get_account_overview.py Migrates read example to TESTNET_CONFIG.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This commit improves the logging format for margin usage in the market maker bot and updates the Network and CompatVersion classes to inherit from StrEnum for better string representation. These changes enhance code clarity and maintainability.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 73 out of 73 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/decibel/abi/generate.py:53

  • get_abi_filename() now falls back to f"{config.network.value}.json" for non-testnet/mainnet configs. Since both LOCAL_CONFIG and DOCKER_CONFIG use Network.CUSTOM, this will generate the same filename (custom.json) and can overwrite outputs when fetching multiple networks. Consider special-casing LOCAL_CONFIG/DOCKER_CONFIG (e.g., local.json / docker.json) or incorporating a stable discriminator (like the named config key or chain_id) into the filename.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@WGB5445 WGB5445 requested a review from gregnazario April 14, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants