Skip to content

feat/exchange rate - #15

Closed
Benup211 wants to merge 23 commits into
mainfrom
feat/exchange-rate
Closed

Benup211 wants to merge 23 commits into
mainfrom
feat/exchange-rate

Conversation

@Benup211

@Benup211 Benup211 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator
  • feat(tusdt-cli): migrate to vault-alpha, add netuid display, fix config network
  • feat(cli): add upgrade/migration commands for contract address management
  • refactor(cli): remove accrue-interest, update params for interest/fee removal
  • feat:latest changes in contract synced with cli\ commands/vault.py: - set-global-params: added missing --vault-creation-fee option with parse_balance for human-readable TAO input - info: removed dead "Interest accrued" and "Interest accrued at" rows (no interest model exists); removed duplicate "Borrowed" key - list: removed duplicate borrowed_token_balance column (6 cols in row but only 5 headers) - list-all: removed duplicate borrowed_token_balance column (7 cols in row but only 6 headers) - set-params: removed stale interest_rate (bps) from help text and --interest-rate example
  • fix:updated abi\ hotkey fn added in vault and goveranance\ version bump
  • feat(cli): add extension signing, vault creation fee, --yes flag, and bridge auth fix
  • feat(lending-pool):lending pool cli added
  • feat:lending and governance new fn added cli
  • feat:alpha vault and lending pool with all command
  • feat:interest accural of both market
  • feat:lending cli added new function
  • feat:lending interest calculation get all params and calculate the debt offchain
  • feat:add support for deficit liquidation
  • feat: claim-alpha-excess; chain-clock interest projection
  • feat: full-seizure liquidate command
  • fix:abi metadata to latest contract changes
  • fix(lending): market-state shows total_supplied as face, not raw lTAO
  • feat(lending): liquidate pays full debt; drop market-deficit surface
  • feat:exchange rate display the latest value calculated from market state and last interest accural

Benup211 and others added 23 commits July 17, 2026 18:11
…ig network

BREAKING: Vault contract renamed from tusdt-vault to tusdt-vault-alpha.
All vault methods updated with per-netuid params and atomic-pull deposit.

- Vault: create_vault → create_alpha_vault(amount, netuid) (not payable)
- Vault: add_collateral → add_alpha_collateral(vault_id, amount) (not payable)
- Vault: release_collateral → release_alpha_collateral(vault_id, amount, dest_coldkey)
- Vault: all *_contract_params methods now require --netuid
- Vault: new commands — set-global-params, execute-global-update, cancel-global-update,
  get-global-params, set-approved-netuid, is-approved-netuid, claim-excess-alpha
- Governance: new forwarders — vault-claim-excess-alpha, vault-set-approved-netuid,
  vault-set-global-params, vault-cancel-global-update, elect-maintainer, election-set-netuid
- Governance: vault-set-params and vault-cancel-update now require --netuid
- Token: new commands — set-controller, add-minter, remove-minter, is-minter
- Auction: new command — active-count
- Config: added otc_address placeholders for finney and testnet
- Config: root CLI callback now reads saved network from config.json (fixes
  commands ignoring saved network preference)
- Display: vault info, list, and list-all now show Netuid column
- Tests: 51 new tests (141 total), covering vault-alpha, governance forwarders,
  ERC20 minters, and CLI command registration
…ment

Add CLI commands and client methods for the new vault, governance,
auction, and oracle upgrade functions.

Client (client.py):
- Add vault_set_token_controller, vault_update_auction_address,
  vault_update_oracle_address, vault_update_token_address
- Add gov_vault_set_token_controller, gov_vault_update_auction_address,
  gov_vault_update_oracle_address (governance forwarders)
- Add gov_update_vault_address, gov_update_auction_address,
  gov_update_oracle_address, gov_update_treasury_address
- Add get_vault_address, get_governance_auction_address,
  get_governance_oracle_address (governance reads)
- Add auction_set_controller, oracle_set_controller

Commands (16 new):
- governance: vault-set-token-controller, vault-update-auction-address,
  vault-update-oracle-address, update-vault-address,
  update-auction-address, update-oracle-address,
  update-treasury-address, vault-address, auction-address,
  oracle-address
- vault: set-token-controller, update-auction-address,
  update-oracle-address, update-token-address
- auction: set-controller
- oracle: set-controller

ABIs updated from rebuilt contract artifacts.
… removal

- Remove accrue_interest client method and CLI command
- Remove --interest-rate from vault set-params and governance
  vault-set-params commands
- Add value parameter to create_alpha_vault client method for
  vault creation fee
- Update vault display: replace "Debt" column with "Borrowed",
  remove debt_balance references from info/list/list-all
- Update test_create_alpha_vault to expect value kwarg
- Rebuild ABIs from updated vault and governance contracts
commands/vault.py:
- set-global-params: added missing --vault-creation-fee option with
  parse_balance for human-readable TAO input
- info: removed dead "Interest accrued" and "Interest accrued at"
  rows (no interest model exists); removed duplicate "Borrowed" key
- list: removed duplicate borrowed_token_balance column (6 cols in row
  but only 5 headers)
- list-all: removed duplicate borrowed_token_balance column (7 cols in
  row but only 6 headers)
- set-params: removed stale interest_rate (bps) from help text and
  --interest-rate example

commands/governance.py:
- vault-set-global-params: added missing --vault-creation-fee option
hotkey fn added in vault and goveranance\
version bump
… bridge auth fix

- Extension signing: new extension/ bridge server and signing.py for
  browser-wallet interaction (Polkadot.js/Talisman) via local WebSocket
- Signing UX: --signer-backend/--signer-address/--extension-* flags;
  LedgerSigner refactored to support multiple signing backends
- Vault creation fee: vault create now queries vault_creation_fee from
  on-chain global params, displays the fee, prompts for confirmation,
  and passes the fee as native TAO value with the extrinsic
- --yes/-y flag: wired yes_option into the root CLI callback and
  CLIContext; commands can now check state.assume_yes to skip prompts
- Dry-run shows value: DryRunResult now carries the transferred value
  and Output renders it in both JSON and rich modes
- Bridge auth fix: JavaScript now sends BRIDGE_TOKEN (not empty string);
  server closes unauthenticated connections and restricts relay to
  authenticated sessions only
- Remove dead code: drop unused imports, stale accrue-interest references,
  and duplicated output helpers across command files
feat(cli): add extension signing, vault creation fee, --yes flag, and bridge auth fix
- lending_liquidate(keypair, borrower, value): drop debt-market / debt-to-cover / collateral-netuid args; the tx carries the native TAO payment as value
- liquidate command: reads the borrower's debt on both markets + the TUSDT/TAO oracle price and prints the payment summary before submitting
- set-alpha-params: --liquidation-bonus renamed --liquidation-fee
- set-global-params: drop --close-factor / --full-close-hf-threshold
- tests updated for the new signature
…dation

Feat/lending full seizure liquidation
MarketState.total_supplied is tracked in lToken (scaled) units, but market-state printed it verbatim so a supplier holding 997_191_042 lTAO at exchange rate 1.002816870... saw '0.9972' instead of their ~1.0 TAO claim. Render it scaled to face (total_supplied x exchange_rate / 1e18) with explicit unit labels, alongside a raw lTAO row. Adds the face_from_ltao helper and pins the real-chain value. Withdraw commands are unchanged.
…nits

fix(lending): market-state shows total_supplied as face, not raw lTAO
feat(lending): liquidate pays full debt; drop market-deficit surface
@Benup211 Benup211 closed this Sep 8, 2026
@Benup211
Benup211 deleted the feat/exchange-rate branch September 9, 2026 08:41
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.

1 participant