@symmio/trading-core 2.0.0 → 3.0.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/dist/balance-history/get-balance-history/types.d.ts +1 -1
- package/dist/balance-history/get-balance-history/types.js.map +1 -1
- package/dist/core/chains/actions/get-chain-config.d.ts +1 -1
- package/dist/core/chains/actions/get-chain-config.js.map +1 -1
- package/dist/core/chains/actions/get-default-solver.d.ts +1 -1
- package/dist/core/chains/actions/get-default-solver.js.map +1 -1
- package/dist/core/chains/actions/list-supported-chains.js.map +1 -1
- package/dist/core/chains/registry.d.ts.map +1 -1
- package/dist/core/chains/registry.js +52 -50
- package/dist/core/chains/registry.js.map +1 -1
- package/dist/core/chains/supported-chains.d.ts +3 -3
- package/dist/core/chains/supported-chains.d.ts.map +1 -1
- package/dist/core/chains/supported-chains.js +1 -1
- package/dist/core/chains/supported-chains.js.map +1 -1
- package/dist/core/chains/types.d.ts +18 -4
- package/dist/core/chains/types.d.ts.map +1 -1
- package/dist/core/chains/types.js.map +1 -1
- package/dist/core/config/create-config.d.ts +7 -7
- package/dist/core/config/create-config.d.ts.map +1 -1
- package/dist/core/config/create-config.js +39 -38
- package/dist/core/config/create-config.js.map +1 -1
- package/dist/core/config/merge-chain-config.js +1 -0
- package/dist/core/config/merge-chain-config.js.map +1 -1
- package/dist/index.d.ts +18 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +318 -316
- package/dist/margin/calculate-margin-risk.d.ts +1 -1
- package/dist/margin/calculate-margin-risk.js.map +1 -1
- package/dist/notifications/types.d.ts +1 -1
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/quotes/close-planning/min-remaining-quantity.d.ts +1 -1
- package/dist/quotes/close-planning/min-remaining-quantity.js.map +1 -1
- package/dist/quotes/get-quote-history/query-document.d.ts +1 -1
- package/dist/quotes/get-quote-history/query-document.js.map +1 -1
- package/dist/quotes/get-quote-history/types.d.ts +2 -2
- package/dist/quotes/get-quote-history/types.js.map +1 -1
- package/dist/quotes/grouping/aggregate-metrics.d.ts +1 -1
- package/dist/quotes/grouping/aggregate-metrics.js.map +1 -1
- package/dist/quotes/open-price.d.ts +10 -10
- package/dist/quotes/open-price.d.ts.map +1 -1
- package/dist/quotes/open-price.js +1 -1
- package/dist/quotes/open-price.js.map +1 -1
- package/dist/quotes/upnl/calculate-quote-leverage.d.ts +8 -6
- package/dist/quotes/upnl/calculate-quote-leverage.d.ts.map +1 -1
- package/dist/quotes/upnl/calculate-quote-leverage.js.map +1 -1
- package/dist/shared/utils/query.d.ts +2 -2
- package/dist/shared/utils/query.js.map +1 -1
- package/dist/solvers/force-close/force-close-position.js +1 -1
- package/dist/solvers/force-close/force-close-position.js.map +1 -1
- package/dist/solvers/force-close/get-force-close-params.js +1 -1
- package/dist/solvers/force-close/get-force-close-params.js.map +1 -1
- package/dist/solvers/instant-close/shared/calldata.js +1 -1
- package/dist/solvers/instant-close/shared/calldata.js.map +1 -1
- package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.d.ts +129 -0
- package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.d.ts.map +1 -0
- package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.js +115 -0
- package/dist/solvers/instant-open/get-instant-open-fees/get-instant-open-fees.js.map +1 -0
- package/dist/solvers/instant-open/get-instant-open-fees/index.d.ts +3 -0
- package/dist/solvers/instant-open/get-instant-open-fees/index.d.ts.map +1 -0
- package/dist/solvers/instant-open/get-instant-open-fees/query.d.ts +34 -0
- package/dist/solvers/instant-open/get-instant-open-fees/query.d.ts.map +1 -0
- package/dist/solvers/instant-open/get-instant-open-fees/query.js +33 -0
- package/dist/solvers/instant-open/get-instant-open-fees/query.js.map +1 -0
- package/dist/solvers/instant-open/index.d.ts +1 -0
- package/dist/solvers/instant-open/index.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.d.ts.map +1 -1
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js +58 -55
- package/dist/solvers/instant-open/instant-open/adapters/enigma-instant-open.js.map +1 -1
- package/dist/solvers/instant-open/instant-open/types.d.ts +14 -4
- package/dist/solvers/instant-open/instant-open/types.d.ts.map +1 -1
- package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts +45 -10
- package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.d.ts.map +1 -1
- package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js +157 -72
- package/dist/solvers/instant-open/prepare-instant-open-params/prepare-instant-open-params.js.map +1 -1
- package/dist/solvers/instant-open/shared/calldata.d.ts +35 -7
- package/dist/solvers/instant-open/shared/calldata.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/calldata.js +56 -14
- package/dist/solvers/instant-open/shared/calldata.js.map +1 -1
- package/dist/solvers/instant-open/shared/index.d.ts +1 -0
- package/dist/solvers/instant-open/shared/index.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/open-estimate-guard.d.ts +89 -0
- package/dist/solvers/instant-open/shared/open-estimate-guard.d.ts.map +1 -0
- package/dist/solvers/instant-open/shared/open-estimate-guard.js +52 -0
- package/dist/solvers/instant-open/shared/open-estimate-guard.js.map +1 -0
- package/dist/solvers/instant-open/shared/selectors.d.ts +46 -7
- package/dist/solvers/instant-open/shared/selectors.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/selectors.js +12 -5
- package/dist/solvers/instant-open/shared/selectors.js.map +1 -1
- package/dist/solvers/instant-open/shared/trade-math.d.ts +112 -8
- package/dist/solvers/instant-open/shared/trade-math.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/trade-math.js +59 -25
- package/dist/solvers/instant-open/shared/trade-math.js.map +1 -1
- package/dist/solvers/instant-open/shared/types.d.ts +32 -0
- package/dist/solvers/instant-open/shared/types.d.ts.map +1 -1
- package/dist/solvers/instant-open/shared/types.js.map +1 -1
- package/dist/solvers/markets/adapters/enigma-markets.d.ts.map +1 -1
- package/dist/solvers/markets/adapters/enigma-markets.js +38 -32
- package/dist/solvers/markets/adapters/enigma-markets.js.map +1 -1
- package/dist/solvers/markets/types.d.ts +15 -0
- package/dist/solvers/markets/types.d.ts.map +1 -1
- package/dist/solvers/revenue/get-solver-revenue.d.ts +11 -11
- package/dist/solvers/revenue/get-solver-revenue.d.ts.map +1 -1
- package/dist/solvers/revenue/get-solver-revenue.js +12 -12
- package/dist/solvers/revenue/get-solver-revenue.js.map +1 -1
- package/dist/solvers/revenue/query.d.ts +2 -2
- package/dist/solvers/revenue/query.d.ts.map +1 -1
- package/dist/solvers/revenue/query.js +1 -1
- package/dist/solvers/revenue/query.js.map +1 -1
- package/dist/solvers/revenue/to-solver-revenue.d.ts +3 -2
- package/dist/solvers/revenue/to-solver-revenue.d.ts.map +1 -1
- package/dist/solvers/revenue/to-solver-revenue.js.map +1 -1
- package/dist/solvers/shared/index.d.ts +1 -0
- package/dist/solvers/shared/index.d.ts.map +1 -1
- package/dist/solvers/shared/resolvers/resolve-market.d.ts +36 -5
- package/dist/solvers/shared/resolvers/resolve-market.d.ts.map +1 -1
- package/dist/solvers/shared/resolvers/resolve-market.js +30 -8
- package/dist/solvers/shared/resolvers/resolve-market.js.map +1 -1
- package/dist/solvers/shared/resolvers/types.d.ts +14 -0
- package/dist/solvers/shared/resolvers/types.d.ts.map +1 -1
- package/dist/solvers/shared/solver-close-fee.d.ts +76 -0
- package/dist/solvers/shared/solver-close-fee.d.ts.map +1 -0
- package/dist/solvers/shared/solver-close-fee.js +26 -0
- package/dist/solvers/shared/solver-close-fee.js.map +1 -0
- package/dist/solvers/symbols/to-solver-symbol.d.ts.map +1 -1
- package/dist/solvers/symbols/to-solver-symbol.js +36 -30
- package/dist/solvers/symbols/to-solver-symbol.js.map +1 -1
- package/dist/solvers/symbols/types.d.ts +22 -1
- package/dist/solvers/symbols/types.d.ts.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.d.ts +8 -99
- package/dist/solvers/types/generated/enigma-solver.d.ts.map +1 -1
- package/dist/solvers/types/generated/enigma-solver.js +5 -11
- package/dist/solvers/types/generated/enigma-solver.js.map +1 -1
- package/dist/solvers/types/generated/rasa-solver.js +2 -2
- package/dist/solvers/types/generated/rasa-solver.js.map +1 -1
- package/dist/symmio-contracts/abi/index.d.ts +4 -4
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/account-layer.d.ts +499 -132
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/account-layer.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/account-layer.js +591 -149
- package/dist/symmio-contracts/abi/v0.8.6/account-layer.js.map +1 -0
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/index.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/instant-layer.d.ts +24 -24
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/instant-layer.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/instant-layer.js +28 -28
- package/dist/symmio-contracts/abi/v0.8.6/instant-layer.js.map +1 -0
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/symmio.d.ts +4724 -1019
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/symmio.d.ts.map +1 -1
- package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/symmio.js +12750 -8308
- package/dist/symmio-contracts/abi/v0.8.6/symmio.js.map +1 -0
- package/dist/symmio-contracts/account-layer/actions/add-margin.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/add-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/cancel-registration.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/cancel-registration.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/create-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/delete-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-and-allocate-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/deposit-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/edit-account-name.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/generate-account-manager-address.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-info.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-account-balance-of.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-affiliate-state.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-account-virtual-nonce.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-account-virtual-nonce.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-accounts-count-of-user.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-sub-accounts-count-of-user.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts-addresses.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-user-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-account.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/get-virtual-accounts-addresses-of-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/predict-next-virtual-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/predict-next-virtual-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/remove-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/request-to-register-affiliate.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-add-margin.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-add-margin.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-add-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-cancel-registration.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-create-sub-accounts.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-create-sub-accounts.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-create-sub-accounts.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-delete-sub-account.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-delete-sub-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-delete-sub-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-and-allocate-for-account.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-and-allocate-for-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-and-allocate-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-for-account.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-for-account.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-deposit-for-account.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-edit-account-name.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-edit-account-name.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-edit-account-name.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-remove-margin.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-remove-margin.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-remove-margin.js.map +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.d.ts +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.js +1 -1
- package/dist/symmio-contracts/account-layer/actions/simulate-request-to-register-affiliate.js.map +1 -1
- package/dist/symmio-contracts/account-layer/types.d.ts +10 -10
- package/dist/symmio-contracts/account-layer/types.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/get-delegation-expiry.js +1 -1
- package/dist/symmio-contracts/instant-layer/actions/get-delegation-expiry.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/get-is-delegation-active.js +1 -1
- package/dist/symmio-contracts/instant-layer/actions/get-is-delegation-active.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js +1 -1
- package/dist/symmio-contracts/instant-layer/actions/grant-delegation.js.map +1 -1
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegation.d.ts +1 -1
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegation.js +1 -1
- package/dist/symmio-contracts/instant-layer/actions/simulate-grant-delegation.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js +1 -1
- package/dist/symmio-contracts/symmio/actions/allocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.d.ts +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate-and-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js +1 -1
- package/dist/symmio-contracts/symmio/actions/deallocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js +1 -1
- package/dist/symmio-contracts/symmio/actions/finalize-withdraw-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-close-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js +1 -1
- package/dist/symmio-contracts/symmio/actions/force-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-cool-downs-of-ma.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-cool-downs-of-ma.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-fee-for-user.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-fee-for-user.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-last-withdraw-request-id.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-last-withdraw-request-id.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-onchain-contract-markets.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-onchain-contract-markets.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-party-a-open-positions.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-party-a-open-positions.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-party-a-pending-quotes.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-party-a-pending-quotes.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-pending-quotes.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-pending-quotes.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-pending-withdraw-requests.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-pending-withdraw-requests.js +10 -9
- package/dist/symmio-contracts/symmio/actions/get-pending-withdraw-requests.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-quote.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-withdraw-requests.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-withdraw-requests.js +9 -8
- package/dist/symmio-contracts/symmio/actions/get-withdraw-requests.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/get-withdrawable-time.js +1 -1
- package/dist/symmio-contracts/symmio/actions/get-withdrawable-time.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.d.ts +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/request-cancel-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-close-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js +1 -1
- package/dist/symmio-contracts/symmio/actions/request-to-cancel-quote.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-allocate.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-allocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-deallocate-and-initiate-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-deallocate-and-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-deallocate.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-deallocate.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-finalize-withdraw-request.d.ts +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-finalize-withdraw-request.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-finalize-withdraw-request.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-initiate-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-initiate-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-request-cancel-withdraw.js +1 -1
- package/dist/symmio-contracts/symmio/actions/simulate-request-cancel-withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.d.ts +1 -1
- package/dist/symmio-contracts/symmio/actions/withdraw.js.map +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js +1 -1
- package/dist/symmio-contracts/symmio/internal/call-as-sub-account.js.map +1 -1
- package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.d.ts +1 -1
- package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.js +1 -1
- package/dist/symmio-contracts/symmio/internal/simulate-call-as-sub-account.js.map +1 -1
- package/dist/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.d.ts +214 -0
- package/dist/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.d.ts.map +1 -0
- package/dist/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.js +248 -0
- package/dist/symmio-contracts/symmio/internal/withdraw-requests-v0-8-5.js.map +1 -0
- package/dist/symmio-contracts/symmio/parts.d.ts +1 -1
- package/dist/symmio-contracts/symmio/parts.js.map +1 -1
- package/dist/symmio-contracts/symmio/types.d.ts +29 -19
- package/dist/symmio-contracts/symmio/types.d.ts.map +1 -1
- package/dist/symmio-contracts/symmio/types.js.map +1 -1
- package/dist/tpsl/grouping/notional.js +6 -6
- package/dist/websocket/tpsl/parse-tpsl-frame.d.ts +1 -1
- package/dist/websocket/tpsl/parse-tpsl-frame.js.map +1 -1
- package/dist/websocket/tpsl/watch-tpsl-notifications.d.ts +1 -1
- package/dist/websocket/tpsl/watch-tpsl-notifications.js.map +1 -1
- package/package.json +1 -1
- package/dist/solvers/add-solver-whitelist/add-solver-whitelist.d.ts +0 -27
- package/dist/solvers/add-solver-whitelist/add-solver-whitelist.d.ts.map +0 -1
- package/dist/solvers/add-solver-whitelist/add-solver-whitelist.js +0 -25
- package/dist/solvers/add-solver-whitelist/add-solver-whitelist.js.map +0 -1
- package/dist/solvers/add-solver-whitelist/index.d.ts +0 -3
- package/dist/solvers/add-solver-whitelist/index.d.ts.map +0 -1
- package/dist/solvers/add-solver-whitelist/query.d.ts +0 -19
- package/dist/solvers/add-solver-whitelist/query.d.ts.map +0 -1
- package/dist/solvers/add-solver-whitelist/query.js +0 -12
- package/dist/solvers/add-solver-whitelist/query.js.map +0 -1
- package/dist/symmio-contracts/abi/v0.8.5/account-layer.js.map +0 -1
- package/dist/symmio-contracts/abi/v0.8.5/instant-layer.js.map +0 -1
- package/dist/symmio-contracts/abi/v0.8.5/symmio.js.map +0 -1
- /package/dist/symmio-contracts/abi/{v0.8.5 → v0.8.6}/index.d.ts +0 -0
|
@@ -16,13 +16,44 @@ export interface ResolveMarketParameters {
|
|
|
16
16
|
marketName?: string;
|
|
17
17
|
pricePrecision?: number;
|
|
18
18
|
quantityPrecision?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Also resolve the market's solver-fee caps (`minOpenSolverFeeCap` /
|
|
21
|
+
* `minCloseSolverFeeCap`, decimal ratio strings). With this set, pre-filled
|
|
22
|
+
* metadata short-circuits the fetch only when both caps are pre-filled too;
|
|
23
|
+
* a fetched market that carries no caps (a non-Enigma kind) resolves both to
|
|
24
|
+
* `"0"`. The open wizard sets this; the close wizard does not need caps.
|
|
25
|
+
*/
|
|
26
|
+
includeSolverFeeCaps?: boolean;
|
|
27
|
+
/** Pre-fetched `minOpenSolverFeeCap` (decimal ratio string). */
|
|
28
|
+
minOpenSolverFeeCap?: string;
|
|
29
|
+
/** Pre-fetched `minCloseSolverFeeCap` (decimal ratio string). */
|
|
30
|
+
minCloseSolverFeeCap?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Also resolve the market's solver fee rates (`hedgerFeeOpen` /
|
|
33
|
+
* `hedgerFeeClose`, decimal fraction strings). Same short-circuit contract as
|
|
34
|
+
* `includeSolverFeeCaps`: pre-filled metadata skips the fetch only when both
|
|
35
|
+
* rates are pre-filled too. The open wizard sets this — the solver charges
|
|
36
|
+
* these fees from the VA, so the `addMargin` transfer must fund them.
|
|
37
|
+
*/
|
|
38
|
+
includeHedgerFees?: boolean;
|
|
39
|
+
/** Pre-fetched `hedgerFeeOpen` (decimal fraction string). */
|
|
40
|
+
hedgerFeeOpen?: string;
|
|
41
|
+
/** Pre-fetched `hedgerFeeClose` (decimal fraction string). */
|
|
42
|
+
hedgerFeeClose?: string;
|
|
43
|
+
/** Pre-fetched early (peak) close-fee rate (decimal fraction string). */
|
|
44
|
+
hedgerFeeCloseEarlyRate?: string;
|
|
45
|
+
/** Pre-fetched early-window length in seconds. */
|
|
46
|
+
hedgerFeeCloseEarlyThreshold?: number;
|
|
47
|
+
/** Pre-fetched standard-rate threshold in seconds. */
|
|
48
|
+
hedgerFeeCloseStandardThreshold?: number;
|
|
19
49
|
}
|
|
20
50
|
/**
|
|
21
|
-
* Resolve market metadata (`name`, `pricePrecision`, `quantityPrecision
|
|
22
|
-
* `
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
51
|
+
* Resolve market metadata (`name`, `pricePrecision`, `quantityPrecision`, and —
|
|
52
|
+
* when `includeSolverFeeCaps` is set — the solver-fee cap minimums) for
|
|
53
|
+
* `marketId`. Returns caller-supplied values when everything needed is
|
|
54
|
+
* pre-filled; otherwise fetches `/contract-symbols` and extracts the matching
|
|
55
|
+
* record. The normalized {@link Market} shape guarantees the metadata fields,
|
|
56
|
+
* so only "not found" can fail here.
|
|
26
57
|
*
|
|
27
58
|
* Shared by the instant-open and instant-close wizards.
|
|
28
59
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-market.d.ts","sourceRoot":"","sources":["../../../../src/solvers/shared/resolvers/resolve-market.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve-market.d.ts","sourceRoot":"","sources":["../../../../src/solvers/shared/resolvers/resolve-market.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gEAAgE;IAChE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iEAAiE;IACjE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,kDAAkD;IAClD,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,sDAAsD;IACtD,+BAA+B,CAAC,EAAE,MAAM,CAAC;CAC1C;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,uBAAuB,GAAG,OAAO,CAAC,cAAc,CAAC,CAoEhH"}
|
|
@@ -2,21 +2,43 @@ import { SymmError as e } from "../../../shared/errors/symm-error.js";
|
|
|
2
2
|
import { getMarkets as t } from "../../markets/get-markets.js";
|
|
3
3
|
//#region src/solvers/shared/resolvers/resolve-market.ts
|
|
4
4
|
async function n(n, r) {
|
|
5
|
-
let { marketName: i, pricePrecision: a, quantityPrecision: o } = r;
|
|
6
|
-
if (i !== void 0 && a !== void 0 && o !== void 0) return {
|
|
5
|
+
let { marketName: i, pricePrecision: a, quantityPrecision: o, minOpenSolverFeeCap: s, minCloseSolverFeeCap: c } = r, { hedgerFeeOpen: l, hedgerFeeClose: u } = r, { hedgerFeeCloseEarlyRate: d, hedgerFeeCloseEarlyThreshold: f, hedgerFeeCloseStandardThreshold: p } = r, m = r.includeSolverFeeCaps === !0, h = s !== void 0 && c !== void 0, g = r.includeHedgerFees === !0;
|
|
6
|
+
if (i !== void 0 && a !== void 0 && o !== void 0 && (!m || h) && (!g || l !== void 0 && u !== void 0)) return {
|
|
7
7
|
name: i,
|
|
8
8
|
pricePrecision: a,
|
|
9
|
-
quantityPrecision: o
|
|
9
|
+
quantityPrecision: o,
|
|
10
|
+
...m ? {
|
|
11
|
+
minOpenSolverFeeCap: s,
|
|
12
|
+
minCloseSolverFeeCap: c
|
|
13
|
+
} : {},
|
|
14
|
+
...g ? {
|
|
15
|
+
hedgerFeeOpen: l,
|
|
16
|
+
hedgerFeeClose: u,
|
|
17
|
+
hedgerFeeCloseEarlyRate: d,
|
|
18
|
+
hedgerFeeCloseEarlyThreshold: f,
|
|
19
|
+
hedgerFeeCloseStandardThreshold: p
|
|
20
|
+
} : {}
|
|
10
21
|
};
|
|
11
|
-
let
|
|
22
|
+
let _ = (await t(n, {
|
|
12
23
|
chainId: r.chainId,
|
|
13
24
|
solverId: r.solverId
|
|
14
25
|
})).find((e) => e.symbolId === r.marketId);
|
|
15
|
-
if (!
|
|
26
|
+
if (!_) throw new e("api", "RESOLVE_MARKET_NOT_FOUND", `Market id ${r.marketId} not returned by solver /contract-symbols.`);
|
|
16
27
|
return {
|
|
17
|
-
name: i ??
|
|
18
|
-
pricePrecision: a ??
|
|
19
|
-
quantityPrecision: o ??
|
|
28
|
+
name: i ?? _.name,
|
|
29
|
+
pricePrecision: a ?? _.pricePrecision,
|
|
30
|
+
quantityPrecision: o ?? _.quantityPrecision,
|
|
31
|
+
...m ? {
|
|
32
|
+
minOpenSolverFeeCap: s ?? (_.kind === "enigma" ? _.minOpenSolverFeeCap : "0"),
|
|
33
|
+
minCloseSolverFeeCap: c ?? (_.kind === "enigma" ? _.minCloseSolverFeeCap : "0")
|
|
34
|
+
} : {},
|
|
35
|
+
...g ? {
|
|
36
|
+
hedgerFeeOpen: l ?? _.hedgerFeeOpen,
|
|
37
|
+
hedgerFeeClose: u ?? _.hedgerFeeClose,
|
|
38
|
+
hedgerFeeCloseEarlyRate: d ?? (_.kind === "enigma" ? _.hedgerFeeCloseEarlyRate : void 0),
|
|
39
|
+
hedgerFeeCloseEarlyThreshold: f ?? (_.kind === "enigma" ? _.hedgerFeeCloseEarlyThreshold : void 0),
|
|
40
|
+
hedgerFeeCloseStandardThreshold: p ?? (_.kind === "enigma" ? _.hedgerFeeCloseStandardThreshold : void 0)
|
|
41
|
+
} : {}
|
|
20
42
|
};
|
|
21
43
|
}
|
|
22
44
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-market.js","names":[],"sources":["../../../../src/solvers/shared/resolvers/resolve-market.ts"],"sourcesContent":["import type { SolverId } from \"../../../core/chains/types\";\nimport type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport { getMarkets } from \"../../markets/get-markets\";\nimport type { ResolvedMarket } from \"./types\";\n\n/**\n * Parameters for {@link resolveMarket}.\n */\nexport interface ResolveMarketParameters {\n chainId?: number;\n /**\n * Solver whose `/contract-symbols` listing to read. **Must match the solver\n * the trade is sent to** — the resolved `name` and precisions are encoded into\n * the signed quote. Defaults to the chain's `defaultSolverId`.\n */\n solverId?: SolverId;\n marketId: number;\n marketName?: string;\n pricePrecision?: number;\n quantityPrecision?: number;\n}\n\n/**\n * Resolve market metadata (`name`, `pricePrecision`, `quantityPrecision`) for\n * `marketId`. Returns caller-supplied values when
|
|
1
|
+
{"version":3,"file":"resolve-market.js","names":[],"sources":["../../../../src/solvers/shared/resolvers/resolve-market.ts"],"sourcesContent":["import type { SolverId } from \"../../../core/chains/types\";\nimport type { Config } from \"../../../core/config\";\nimport { SymmError } from \"../../../shared/errors/symm-error\";\nimport { getMarkets } from \"../../markets/get-markets\";\nimport type { ResolvedMarket } from \"./types\";\n\n/**\n * Parameters for {@link resolveMarket}.\n */\nexport interface ResolveMarketParameters {\n chainId?: number;\n /**\n * Solver whose `/contract-symbols` listing to read. **Must match the solver\n * the trade is sent to** — the resolved `name` and precisions are encoded into\n * the signed quote. Defaults to the chain's `defaultSolverId`.\n */\n solverId?: SolverId;\n marketId: number;\n marketName?: string;\n pricePrecision?: number;\n quantityPrecision?: number;\n /**\n * Also resolve the market's solver-fee caps (`minOpenSolverFeeCap` /\n * `minCloseSolverFeeCap`, decimal ratio strings). With this set, pre-filled\n * metadata short-circuits the fetch only when both caps are pre-filled too;\n * a fetched market that carries no caps (a non-Enigma kind) resolves both to\n * `\"0\"`. The open wizard sets this; the close wizard does not need caps.\n */\n includeSolverFeeCaps?: boolean;\n /** Pre-fetched `minOpenSolverFeeCap` (decimal ratio string). */\n minOpenSolverFeeCap?: string;\n /** Pre-fetched `minCloseSolverFeeCap` (decimal ratio string). */\n minCloseSolverFeeCap?: string;\n /**\n * Also resolve the market's solver fee rates (`hedgerFeeOpen` /\n * `hedgerFeeClose`, decimal fraction strings). Same short-circuit contract as\n * `includeSolverFeeCaps`: pre-filled metadata skips the fetch only when both\n * rates are pre-filled too. The open wizard sets this — the solver charges\n * these fees from the VA, so the `addMargin` transfer must fund them.\n */\n includeHedgerFees?: boolean;\n /** Pre-fetched `hedgerFeeOpen` (decimal fraction string). */\n hedgerFeeOpen?: string;\n /** Pre-fetched `hedgerFeeClose` (decimal fraction string). */\n hedgerFeeClose?: string;\n /** Pre-fetched early (peak) close-fee rate (decimal fraction string). */\n hedgerFeeCloseEarlyRate?: string;\n /** Pre-fetched early-window length in seconds. */\n hedgerFeeCloseEarlyThreshold?: number;\n /** Pre-fetched standard-rate threshold in seconds. */\n hedgerFeeCloseStandardThreshold?: number;\n}\n\n/**\n * Resolve market metadata (`name`, `pricePrecision`, `quantityPrecision`, and —\n * when `includeSolverFeeCaps` is set — the solver-fee cap minimums) for\n * `marketId`. Returns caller-supplied values when everything needed is\n * pre-filled; otherwise fetches `/contract-symbols` and extracts the matching\n * record. The normalized {@link Market} shape guarantees the metadata fields,\n * so only \"not found\" can fail here.\n *\n * Shared by the instant-open and instant-close wizards.\n *\n * @throws {SymmError} `RESOLVE_MARKET_NOT_FOUND` when no record matches.\n */\nexport async function resolveMarket(config: Config, parameters: ResolveMarketParameters): Promise<ResolvedMarket> {\n const { marketName, pricePrecision, quantityPrecision, minOpenSolverFeeCap, minCloseSolverFeeCap } = parameters;\n const { hedgerFeeOpen, hedgerFeeClose } = parameters;\n const { hedgerFeeCloseEarlyRate, hedgerFeeCloseEarlyThreshold, hedgerFeeCloseStandardThreshold } = parameters;\n const needCaps = parameters.includeSolverFeeCaps === true;\n const capsPrefilled = minOpenSolverFeeCap !== undefined && minCloseSolverFeeCap !== undefined;\n const needFees = parameters.includeHedgerFees === true;\n const feesPrefilled = hedgerFeeOpen !== undefined && hedgerFeeClose !== undefined;\n\n if (\n marketName !== undefined &&\n pricePrecision !== undefined &&\n quantityPrecision !== undefined &&\n (!needCaps || capsPrefilled) &&\n (!needFees || feesPrefilled)\n ) {\n return {\n name: marketName,\n pricePrecision,\n quantityPrecision,\n ...(needCaps ? { minOpenSolverFeeCap, minCloseSolverFeeCap } : {}),\n ...(needFees\n ? {\n hedgerFeeOpen,\n hedgerFeeClose,\n hedgerFeeCloseEarlyRate,\n hedgerFeeCloseEarlyThreshold,\n hedgerFeeCloseStandardThreshold,\n }\n : {}),\n };\n }\n\n const markets = await getMarkets(config, { chainId: parameters.chainId, solverId: parameters.solverId });\n const match = markets.find((m) => m.symbolId === parameters.marketId);\n if (!match) {\n throw new SymmError(\n \"api\",\n \"RESOLVE_MARKET_NOT_FOUND\",\n `Market id ${parameters.marketId} not returned by solver /contract-symbols.`,\n );\n }\n\n return {\n name: marketName ?? match.name,\n pricePrecision: pricePrecision ?? match.pricePrecision,\n quantityPrecision: quantityPrecision ?? match.quantityPrecision,\n ...(needCaps\n ? {\n minOpenSolverFeeCap: minOpenSolverFeeCap ?? (match.kind === \"enigma\" ? match.minOpenSolverFeeCap : \"0\"),\n minCloseSolverFeeCap: minCloseSolverFeeCap ?? (match.kind === \"enigma\" ? match.minCloseSolverFeeCap : \"0\"),\n }\n : {}),\n ...(needFees\n ? {\n hedgerFeeOpen: hedgerFeeOpen ?? match.hedgerFeeOpen,\n hedgerFeeClose: hedgerFeeClose ?? match.hedgerFeeClose,\n // Early-close decay is Enigma-only; a non-Enigma market has no such fields.\n hedgerFeeCloseEarlyRate:\n hedgerFeeCloseEarlyRate ?? (match.kind === \"enigma\" ? match.hedgerFeeCloseEarlyRate : undefined),\n hedgerFeeCloseEarlyThreshold:\n hedgerFeeCloseEarlyThreshold ?? (match.kind === \"enigma\" ? match.hedgerFeeCloseEarlyThreshold : undefined),\n hedgerFeeCloseStandardThreshold:\n hedgerFeeCloseStandardThreshold ??\n (match.kind === \"enigma\" ? match.hedgerFeeCloseStandardThreshold : undefined),\n }\n : {}),\n };\n}\n"],"mappings":";;;AAiEA,eAAsB,EAAc,GAAgB,GAA8D;CAChH,IAAM,EAAE,eAAY,mBAAgB,sBAAmB,wBAAqB,4BAAyB,GAC/F,EAAE,kBAAe,sBAAmB,GACpC,EAAE,4BAAyB,iCAA8B,uCAAoC,GAC7F,IAAW,EAAW,yBAAyB,IAC/C,IAAgB,MAAwB,KAAA,KAAa,MAAyB,KAAA,GAC9E,IAAW,EAAW,sBAAsB;CAGlD,IACE,MAAe,KAAA,KACf,MAAmB,KAAA,KACnB,MAAsB,KAAA,MACrB,CAAC,KAAY,OACb,CAAC,KAPkB,MAAkB,KAAA,KAAa,MAAmB,KAAA,IAStE,OAAO;EACL,MAAM;EACN;EACA;EACA,GAAI,IAAW;GAAE;GAAqB;EAAqB,IAAI,CAAC;EAChE,GAAI,IACA;GACE;GACA;GACA;GACA;GACA;EACF,IACA,CAAC;CACP;CAIF,IAAM,KAAQ,MADQ,EAAW,GAAQ;EAAE,SAAS,EAAW;EAAS,UAAU,EAAW;CAAS,CAAC,GACjF,MAAM,MAAM,EAAE,aAAa,EAAW,QAAQ;CACpE,IAAI,CAAC,GACH,MAAM,IAAI,EACR,OACA,4BACA,aAAa,EAAW,SAAS,2CACnC;CAGF,OAAO;EACL,MAAM,KAAc,EAAM;EAC1B,gBAAgB,KAAkB,EAAM;EACxC,mBAAmB,KAAqB,EAAM;EAC9C,GAAI,IACA;GACE,qBAAqB,MAAwB,EAAM,SAAS,WAAW,EAAM,sBAAsB;GACnG,sBAAsB,MAAyB,EAAM,SAAS,WAAW,EAAM,uBAAuB;EACxG,IACA,CAAC;EACL,GAAI,IACA;GACE,eAAe,KAAiB,EAAM;GACtC,gBAAgB,KAAkB,EAAM;GAExC,yBACE,MAA4B,EAAM,SAAS,WAAW,EAAM,0BAA0B,KAAA;GACxF,8BACE,MAAiC,EAAM,SAAS,WAAW,EAAM,+BAA+B,KAAA;GAClG,iCACE,MACC,EAAM,SAAS,WAAW,EAAM,kCAAkC,KAAA;EACvE,IACA,CAAC;CACP;AACF"}
|
|
@@ -10,5 +10,19 @@ export interface ResolvedMarket {
|
|
|
10
10
|
name: string;
|
|
11
11
|
pricePrecision: number;
|
|
12
12
|
quantityPrecision: number;
|
|
13
|
+
/** Present when resolved with `includeSolverFeeCaps`. Decimal ratio string; `"0"` for kinds without caps. */
|
|
14
|
+
minOpenSolverFeeCap?: string;
|
|
15
|
+
/** Present when resolved with `includeSolverFeeCaps`. Decimal ratio string; `"0"` for kinds without caps. */
|
|
16
|
+
minCloseSolverFeeCap?: string;
|
|
17
|
+
/** Present when resolved with `includeHedgerFees`. Solver open-fee rate, decimal fraction string. */
|
|
18
|
+
hedgerFeeOpen?: string;
|
|
19
|
+
/** Present when resolved with `includeHedgerFees`. Solver standard (floor) close-fee rate, decimal fraction string. */
|
|
20
|
+
hedgerFeeClose?: string;
|
|
21
|
+
/** Present when resolved with `includeHedgerFees` on an Enigma market. Early (peak) close-fee rate, decimal fraction string. */
|
|
22
|
+
hedgerFeeCloseEarlyRate?: string;
|
|
23
|
+
/** Present when resolved with `includeHedgerFees` on an Enigma market. Early-window length in seconds. */
|
|
24
|
+
hedgerFeeCloseEarlyThreshold?: number;
|
|
25
|
+
/** Present when resolved with `includeHedgerFees` on an Enigma market. Standard-rate threshold in seconds. */
|
|
26
|
+
hedgerFeeCloseStandardThreshold?: number;
|
|
13
27
|
}
|
|
14
28
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/solvers/shared/resolvers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/solvers/shared/resolvers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6GAA6G;IAC7G,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6GAA6G;IAC7G,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qGAAqG;IACrG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uHAAuH;IACvH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gIAAgI;IAChI,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,0GAA0G;IAC1G,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,8GAA8G;IAC9G,+BAA+B,CAAC,EAAE,MAAM,CAAC;CAC1C"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The close-fee rates a lowcap (Enigma) market charges, as flat fields matching
|
|
3
|
+
* the `/symbols` wire names. Every {@link SolverSymbol} carries these, so a
|
|
4
|
+
* symbol can be passed straight to {@link getSolverCloseFeeRate} /
|
|
5
|
+
* {@link calculateSolverCloseFee}.
|
|
6
|
+
*
|
|
7
|
+
* The solver charges more to close a freshly opened position: the rate starts
|
|
8
|
+
* at `hedgerFeeCloseEarlyRate`, holds flat until `hedgerFeeCloseEarlyThreshold`
|
|
9
|
+
* seconds, then decays linearly to the standard `hedgerFeeClose` by
|
|
10
|
+
* `hedgerFeeCloseStandardThreshold`. A market with no decay (a non-Enigma
|
|
11
|
+
* solver, or one omitting the early fields) has `hedgerFeeCloseEarlyRate` equal
|
|
12
|
+
* to `hedgerFeeClose` and both thresholds `0`.
|
|
13
|
+
*/
|
|
14
|
+
export interface SolverCloseFeeRates {
|
|
15
|
+
/** Standard (floor) close-fee rate, decimal fraction string (e.g. `"0.0006"`). Wire: `hedger_fee_close`. */
|
|
16
|
+
hedgerFeeClose: string;
|
|
17
|
+
/** Early (peak) close-fee rate, decimal fraction string (e.g. `"0.0024"`). Wire: `hedger_fee_close_early_rate`. */
|
|
18
|
+
hedgerFeeCloseEarlyRate: string;
|
|
19
|
+
/** Seconds from open during which the early rate applies flat. Wire: `hedger_fee_close_early_threshold`. */
|
|
20
|
+
hedgerFeeCloseEarlyThreshold: number;
|
|
21
|
+
/** Seconds from open at/after which the standard rate applies; linear between the thresholds. Wire: `hedger_fee_close_standard_threshold`. */
|
|
22
|
+
hedgerFeeCloseStandardThreshold: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The solver close-fee **rate** for a lowcap position held `holdingSeconds`
|
|
26
|
+
* since it opened.
|
|
27
|
+
*
|
|
28
|
+
* Piecewise over the holding age `t`:
|
|
29
|
+
*
|
|
30
|
+
* - `t ≤ hedgerFeeCloseEarlyThreshold` → `hedgerFeeCloseEarlyRate` (flat peak);
|
|
31
|
+
* - `t ≥ hedgerFeeCloseStandardThreshold` → `hedgerFeeClose` (flat floor);
|
|
32
|
+
* - in between → linear interpolation from the early rate down to the floor.
|
|
33
|
+
*
|
|
34
|
+
* With the staging numbers (`hedgerFeeCloseEarlyRate: "0.0024"`,
|
|
35
|
+
* `hedgerFeeClose: "0.0006"`, thresholds `30` / `180`): a close at 30s pays
|
|
36
|
+
* `0.0024`, at 105s pays the midpoint `0.0015`, and at 180s pays `0.0006`. A
|
|
37
|
+
* negative `holdingSeconds` (clock skew on a just-opened position) is clamped
|
|
38
|
+
* to `0`, so it prices at the peak. When no decay is defined — an unusable
|
|
39
|
+
* early rate, or `hedgerFeeCloseStandardThreshold ≤ hedgerFeeCloseEarlyThreshold`
|
|
40
|
+
* — the rate steps from the early rate straight to the floor.
|
|
41
|
+
*
|
|
42
|
+
* A {@link SolverSymbol} satisfies the `fees` parameter, so call it directly:
|
|
43
|
+
* `getSolverCloseFeeRate(symbol, holdingSeconds)`.
|
|
44
|
+
*
|
|
45
|
+
* @returns The close-fee rate as a decimal fraction string.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getSolverCloseFeeRate(fees: SolverCloseFeeRates, holdingSeconds: number): string;
|
|
48
|
+
/**
|
|
49
|
+
* The solver close-fee **amount** for a lowcap position:
|
|
50
|
+
* `getSolverCloseFeeRate(fees, holdingSeconds) × notional`.
|
|
51
|
+
*
|
|
52
|
+
* Use this to price a close: with the position's `createTimestamp`, pass
|
|
53
|
+
* `holdingSeconds = now − createTimestamp` to get the fee the solver charges
|
|
54
|
+
* right now. Pass `holdingSeconds = 0` for the worst case (a just-opened
|
|
55
|
+
* position), which is what an open must provision.
|
|
56
|
+
*
|
|
57
|
+
* @returns The close fee as a decimal string; `"0"` when `notional` is
|
|
58
|
+
* NaN/absent or negative.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const fee = calculateSolverCloseFee(symbol, { notional: "1000", holdingSeconds: 0 });
|
|
63
|
+
* // "2.4" with staging hedgerFeeCloseEarlyRate 0.0024
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare function calculateSolverCloseFee(fees: SolverCloseFeeRates, params: {
|
|
67
|
+
notional: string;
|
|
68
|
+
holdingSeconds: number;
|
|
69
|
+
}): string;
|
|
70
|
+
/**
|
|
71
|
+
* Coerce a solver's whole-seconds threshold value (a wire string, a number, or
|
|
72
|
+
* absent) to a non-negative finite number, defaulting to `0`. Used when mapping
|
|
73
|
+
* raw `/symbols` rows onto {@link SolverCloseFeeRates}' threshold fields.
|
|
74
|
+
*/
|
|
75
|
+
export declare function toThresholdSeconds(value: string | number | undefined): number;
|
|
76
|
+
//# sourceMappingURL=solver-close-fee.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solver-close-fee.d.ts","sourceRoot":"","sources":["../../../src/solvers/shared/solver-close-fee.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,mBAAmB;IAClC,4GAA4G;IAC5G,cAAc,EAAE,MAAM,CAAC;IACvB,mHAAmH;IACnH,uBAAuB,EAAE,MAAM,CAAC;IAChC,4GAA4G;IAC5G,4BAA4B,EAAE,MAAM,CAAC;IACrC,8IAA8I;IAC9I,+BAA+B,EAAE,MAAM,CAAC;CACzC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAqB/F;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,mBAAmB,EACzB,MAAM,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GACnD,MAAM,CAMR;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAG7E"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { toDecimal as e } from "@symmio/utils/decimal";
|
|
2
|
+
//#region src/solvers/shared/solver-close-fee.ts
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
let r = e(t.hedgerFeeCloseEarlyRate), i = e(t.hedgerFeeClose), a = !r.isNaN() && !r.isNegative(), o = !i.isNaN() && !i.isNegative();
|
|
5
|
+
if (!a) return o ? i.toString() : "0";
|
|
6
|
+
if (!o) return r.toString();
|
|
7
|
+
let s = Math.max(0, n), c = t.hedgerFeeCloseEarlyThreshold, l = t.hedgerFeeCloseStandardThreshold;
|
|
8
|
+
if (s <= c) return r.toString();
|
|
9
|
+
if (l <= c || s >= l) return i.toString();
|
|
10
|
+
let u = e(s - c).div(l - c);
|
|
11
|
+
return r.plus(i.minus(r).times(u)).toString();
|
|
12
|
+
}
|
|
13
|
+
function n(n, r) {
|
|
14
|
+
let i = e(r.notional);
|
|
15
|
+
if (i.isNaN() || i.isNegative()) return "0";
|
|
16
|
+
let a = e(t(n, r.holdingSeconds));
|
|
17
|
+
return a.isNaN() ? "0" : i.times(a).toString();
|
|
18
|
+
}
|
|
19
|
+
function r(e) {
|
|
20
|
+
let t = typeof e == "number" ? e : Number(e);
|
|
21
|
+
return Number.isFinite(t) && t >= 0 ? t : 0;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { n as calculateSolverCloseFee, t as getSolverCloseFeeRate, r as toThresholdSeconds };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=solver-close-fee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solver-close-fee.js","names":[],"sources":["../../../src/solvers/shared/solver-close-fee.ts"],"sourcesContent":["import { toDecimal } from \"@symmio/utils/decimal\";\n\n/**\n * The close-fee rates a lowcap (Enigma) market charges, as flat fields matching\n * the `/symbols` wire names. Every {@link SolverSymbol} carries these, so a\n * symbol can be passed straight to {@link getSolverCloseFeeRate} /\n * {@link calculateSolverCloseFee}.\n *\n * The solver charges more to close a freshly opened position: the rate starts\n * at `hedgerFeeCloseEarlyRate`, holds flat until `hedgerFeeCloseEarlyThreshold`\n * seconds, then decays linearly to the standard `hedgerFeeClose` by\n * `hedgerFeeCloseStandardThreshold`. A market with no decay (a non-Enigma\n * solver, or one omitting the early fields) has `hedgerFeeCloseEarlyRate` equal\n * to `hedgerFeeClose` and both thresholds `0`.\n */\nexport interface SolverCloseFeeRates {\n /** Standard (floor) close-fee rate, decimal fraction string (e.g. `\"0.0006\"`). Wire: `hedger_fee_close`. */\n hedgerFeeClose: string;\n /** Early (peak) close-fee rate, decimal fraction string (e.g. `\"0.0024\"`). Wire: `hedger_fee_close_early_rate`. */\n hedgerFeeCloseEarlyRate: string;\n /** Seconds from open during which the early rate applies flat. Wire: `hedger_fee_close_early_threshold`. */\n hedgerFeeCloseEarlyThreshold: number;\n /** Seconds from open at/after which the standard rate applies; linear between the thresholds. Wire: `hedger_fee_close_standard_threshold`. */\n hedgerFeeCloseStandardThreshold: number;\n}\n\n/**\n * The solver close-fee **rate** for a lowcap position held `holdingSeconds`\n * since it opened.\n *\n * Piecewise over the holding age `t`:\n *\n * - `t ≤ hedgerFeeCloseEarlyThreshold` → `hedgerFeeCloseEarlyRate` (flat peak);\n * - `t ≥ hedgerFeeCloseStandardThreshold` → `hedgerFeeClose` (flat floor);\n * - in between → linear interpolation from the early rate down to the floor.\n *\n * With the staging numbers (`hedgerFeeCloseEarlyRate: \"0.0024\"`,\n * `hedgerFeeClose: \"0.0006\"`, thresholds `30` / `180`): a close at 30s pays\n * `0.0024`, at 105s pays the midpoint `0.0015`, and at 180s pays `0.0006`. A\n * negative `holdingSeconds` (clock skew on a just-opened position) is clamped\n * to `0`, so it prices at the peak. When no decay is defined — an unusable\n * early rate, or `hedgerFeeCloseStandardThreshold ≤ hedgerFeeCloseEarlyThreshold`\n * — the rate steps from the early rate straight to the floor.\n *\n * A {@link SolverSymbol} satisfies the `fees` parameter, so call it directly:\n * `getSolverCloseFeeRate(symbol, holdingSeconds)`.\n *\n * @returns The close-fee rate as a decimal fraction string.\n */\nexport function getSolverCloseFeeRate(fees: SolverCloseFeeRates, holdingSeconds: number): string {\n const early = toDecimal(fees.hedgerFeeCloseEarlyRate);\n const close = toDecimal(fees.hedgerFeeClose);\n const usableEarly = !early.isNaN() && !early.isNegative();\n const usableClose = !close.isNaN() && !close.isNegative();\n\n // No usable early rate → there is no decay to price; the standard rate stands\n // (and `\"0\"` only if that is unusable too, matching the pre-schedule default).\n if (!usableEarly) return usableClose ? close.toString() : \"0\";\n if (!usableClose) return early.toString();\n\n const t = Math.max(0, holdingSeconds);\n const earlyT = fees.hedgerFeeCloseEarlyThreshold;\n const standardT = fees.hedgerFeeCloseStandardThreshold;\n\n if (t <= earlyT) return early.toString();\n // Non-increasing thresholds leave no interpolation window: step to the floor.\n if (standardT <= earlyT || t >= standardT) return close.toString();\n\n const progress = toDecimal(t - earlyT).div(standardT - earlyT);\n return early.plus(close.minus(early).times(progress)).toString();\n}\n\n/**\n * The solver close-fee **amount** for a lowcap position:\n * `getSolverCloseFeeRate(fees, holdingSeconds) × notional`.\n *\n * Use this to price a close: with the position's `createTimestamp`, pass\n * `holdingSeconds = now − createTimestamp` to get the fee the solver charges\n * right now. Pass `holdingSeconds = 0` for the worst case (a just-opened\n * position), which is what an open must provision.\n *\n * @returns The close fee as a decimal string; `\"0\"` when `notional` is\n * NaN/absent or negative.\n *\n * @example\n * ```ts\n * const fee = calculateSolverCloseFee(symbol, { notional: \"1000\", holdingSeconds: 0 });\n * // \"2.4\" with staging hedgerFeeCloseEarlyRate 0.0024\n * ```\n */\nexport function calculateSolverCloseFee(\n fees: SolverCloseFeeRates,\n params: { notional: string; holdingSeconds: number },\n): string {\n const notional = toDecimal(params.notional);\n if (notional.isNaN() || notional.isNegative()) return \"0\";\n const rate = toDecimal(getSolverCloseFeeRate(fees, params.holdingSeconds));\n if (rate.isNaN()) return \"0\";\n return notional.times(rate).toString();\n}\n\n/**\n * Coerce a solver's whole-seconds threshold value (a wire string, a number, or\n * absent) to a non-negative finite number, defaulting to `0`. Used when mapping\n * raw `/symbols` rows onto {@link SolverCloseFeeRates}' threshold fields.\n */\nexport function toThresholdSeconds(value: string | number | undefined): number {\n const seconds = typeof value === \"number\" ? value : Number(value);\n return Number.isFinite(seconds) && seconds >= 0 ? seconds : 0;\n}\n"],"mappings":";;AAiDA,SAAgB,EAAsB,GAA2B,GAAgC;CAC/F,IAAM,IAAQ,EAAU,EAAK,uBAAuB,GAC9C,IAAQ,EAAU,EAAK,cAAc,GACrC,IAAc,CAAC,EAAM,MAAM,KAAK,CAAC,EAAM,WAAW,GAClD,IAAc,CAAC,EAAM,MAAM,KAAK,CAAC,EAAM,WAAW;CAIxD,IAAI,CAAC,GAAa,OAAO,IAAc,EAAM,SAAS,IAAI;CAC1D,IAAI,CAAC,GAAa,OAAO,EAAM,SAAS;CAExC,IAAM,IAAI,KAAK,IAAI,GAAG,CAAc,GAC9B,IAAS,EAAK,8BACd,IAAY,EAAK;CAEvB,IAAI,KAAK,GAAQ,OAAO,EAAM,SAAS;CAEvC,IAAI,KAAa,KAAU,KAAK,GAAW,OAAO,EAAM,SAAS;CAEjE,IAAM,IAAW,EAAU,IAAI,CAAM,EAAE,IAAI,IAAY,CAAM;CAC7D,OAAO,EAAM,KAAK,EAAM,MAAM,CAAK,EAAE,MAAM,CAAQ,CAAC,EAAE,SAAS;AACjE;AAoBA,SAAgB,EACd,GACA,GACQ;CACR,IAAM,IAAW,EAAU,EAAO,QAAQ;CAC1C,IAAI,EAAS,MAAM,KAAK,EAAS,WAAW,GAAG,OAAO;CACtD,IAAM,IAAO,EAAU,EAAsB,GAAM,EAAO,cAAc,CAAC;CAEzE,OADI,EAAK,MAAM,IAAU,MAClB,EAAS,MAAM,CAAI,EAAE,SAAS;AACvC;AAOA,SAAgB,EAAmB,GAA4C;CAC7E,IAAM,IAAU,OAAO,KAAU,WAAW,IAAQ,OAAO,CAAK;CAChE,OAAO,OAAO,SAAS,CAAO,KAAK,KAAW,IAAI,IAAU;AAC9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-solver-symbol.d.ts","sourceRoot":"","sources":["../../../src/solvers/symbols/to-solver-symbol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"to-solver-symbol.d.ts","sourceRoot":"","sources":["../../../src/solvers/symbols/to-solver-symbol.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAsB5C;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,GAAG,YAAY,EAAE,CAErF"}
|
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toThresholdSeconds as e } from "../shared/solver-close-fee.js";
|
|
2
|
+
import { toFiniteNumber as t } from "@symmio/utils/number";
|
|
2
3
|
//#region src/solvers/symbols/to-solver-symbol.ts
|
|
3
|
-
function
|
|
4
|
+
function n(e) {
|
|
4
5
|
return e.symbol_id !== void 0 && e.name !== void 0 && e.symbol !== void 0;
|
|
5
6
|
}
|
|
6
|
-
function
|
|
7
|
-
return e.filter(
|
|
7
|
+
function r(e) {
|
|
8
|
+
return e.filter(n).map(i);
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function i(n) {
|
|
10
11
|
return {
|
|
11
|
-
symbolId:
|
|
12
|
-
name:
|
|
13
|
-
symbol:
|
|
14
|
-
asset:
|
|
15
|
-
isValid:
|
|
16
|
-
pricePrecision:
|
|
17
|
-
quantityPrecision:
|
|
18
|
-
maxLeverage:
|
|
19
|
-
maxNotionalValue:
|
|
20
|
-
rfqAllowed:
|
|
21
|
-
tradingFee:
|
|
22
|
-
hedgerFeeOpen:
|
|
23
|
-
hedgerFeeClose:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
12
|
+
symbolId: n.symbol_id,
|
|
13
|
+
name: n.name,
|
|
14
|
+
symbol: n.symbol,
|
|
15
|
+
asset: n.asset ?? "",
|
|
16
|
+
isValid: n.is_valid ?? !1,
|
|
17
|
+
pricePrecision: n.price_precision ?? 0,
|
|
18
|
+
quantityPrecision: n.quantity_precision ?? 0,
|
|
19
|
+
maxLeverage: t(n.max_leverage),
|
|
20
|
+
maxNotionalValue: n.max_notional_value ?? 0,
|
|
21
|
+
rfqAllowed: n.rfq_allowed ?? !1,
|
|
22
|
+
tradingFee: n.trading_fee ?? "0",
|
|
23
|
+
hedgerFeeOpen: n.hedger_fee_open ?? "0",
|
|
24
|
+
hedgerFeeClose: n.hedger_fee_close ?? "0",
|
|
25
|
+
hedgerFeeCloseEarlyRate: n.hedger_fee_close_early_rate ?? n.hedger_fee_close ?? "0",
|
|
26
|
+
hedgerFeeCloseEarlyThreshold: e(n.hedger_fee_close_early_threshold),
|
|
27
|
+
hedgerFeeCloseStandardThreshold: e(n.hedger_fee_close_standard_threshold),
|
|
28
|
+
maxFundingRate: n.max_funding_rate ?? "0",
|
|
29
|
+
minNotionalValue: n.min_notional_value ?? "0",
|
|
30
|
+
maxQuantity: n.max_quantity ?? "0",
|
|
31
|
+
lotSize: n.lot_size ?? "0",
|
|
32
|
+
minAcceptableQuoteValue: n.min_acceptable_quote_value ?? "0",
|
|
33
|
+
minAcceptablePortionLf: n.min_acceptable_portion_lf ?? "0",
|
|
34
|
+
tokenAddress: n.token_address ?? "",
|
|
35
|
+
fundingRateEpochDuration: n.funding_rate_epoch_duration ?? "0",
|
|
36
|
+
fundingRateWindowTime: n.funding_rate_window_time ?? "0",
|
|
37
|
+
stateLong: n.state_long ?? 0,
|
|
38
|
+
stateShort: n.state_short ?? 0,
|
|
39
|
+
minOpenSolverFeeCap: n.min_open_solver_fee_cap ?? "0",
|
|
40
|
+
minCloseSolverFeeCap: n.min_close_solver_fee_cap ?? "0"
|
|
35
41
|
};
|
|
36
42
|
}
|
|
37
43
|
//#endregion
|
|
38
|
-
export {
|
|
44
|
+
export { r as toSolverSymbols };
|
|
39
45
|
|
|
40
46
|
//# sourceMappingURL=to-solver-symbol.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-solver-symbol.js","names":[],"sources":["../../../src/solvers/symbols/to-solver-symbol.ts"],"sourcesContent":["import { toFiniteNumber } from \"@symmio/utils/number\";\nimport type { ApiSymbolResponse } from \"../types/generated/enigma-solver\";\nimport type { SolverSymbol } from \"./types\";\n\n/**\n * An `ApiSymbolResponse` row with the identity fields present. Enigma marks\n * every field optional in its OpenAPI spec, so we narrow to rows carrying a\n * usable identity (`symbol_id` / `name` / `symbol`) before mapping — a row\n * without identity cannot be traded or displayed.\n */\ntype IdentifiedSymbol = ApiSymbolResponse & {\n symbol_id: number;\n name: string;\n symbol: string;\n};\n\n/**\n * Type guard: does a raw `/symbols` row carry the identity fields the SDK\n * requires? Rows failing this are dropped by {@link toSolverSymbols}.\n */\nfunction hasIdentity(symbol: ApiSymbolResponse): symbol is IdentifiedSymbol {\n return symbol.symbol_id !== undefined && symbol.name !== undefined && symbol.symbol !== undefined;\n}\n\n/**\n * Normalize raw Enigma `/symbols` rows to {@link SolverSymbol}. Rows missing an\n * identity field are skipped; every other solver-optional field is filled with a\n * neutral default so the normalized shape has no optional noise.\n *\n * @param symbols - Raw `ApiSymbolResponse` rows from the solver.\n */\nexport function toSolverSymbols(symbols: readonly ApiSymbolResponse[]): SolverSymbol[] {\n return symbols.filter(hasIdentity).map(toSolverSymbol);\n}\n\nfunction toSolverSymbol(symbol: IdentifiedSymbol): SolverSymbol {\n return {\n symbolId: symbol.symbol_id,\n name: symbol.name,\n symbol: symbol.symbol,\n asset: symbol.asset ?? \"\",\n isValid: symbol.is_valid ?? false,\n pricePrecision: symbol.price_precision ?? 0,\n quantityPrecision: symbol.quantity_precision ?? 0,\n maxLeverage: toFiniteNumber(symbol.max_leverage),\n maxNotionalValue: symbol.max_notional_value ?? 0,\n rfqAllowed: symbol.rfq_allowed ?? false,\n tradingFee: symbol.trading_fee ?? \"0\",\n hedgerFeeOpen: symbol.hedger_fee_open ?? \"0\",\n hedgerFeeClose: symbol.hedger_fee_close ?? \"0\",\n maxFundingRate: symbol.max_funding_rate ?? \"0\",\n minNotionalValue: symbol.min_notional_value ?? \"0\",\n maxQuantity: symbol.max_quantity ?? \"0\",\n lotSize: symbol.lot_size ?? \"0\",\n minAcceptableQuoteValue: symbol.min_acceptable_quote_value ?? \"0\",\n minAcceptablePortionLf: symbol.min_acceptable_portion_lf ?? \"0\",\n tokenAddress: symbol.token_address ?? \"\",\n fundingRateEpochDuration: symbol.funding_rate_epoch_duration ?? \"0\",\n fundingRateWindowTime: symbol.funding_rate_window_time ?? \"0\",\n stateLong: symbol.state_long ?? 0,\n stateShort: symbol.state_short ?? 0,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"to-solver-symbol.js","names":[],"sources":["../../../src/solvers/symbols/to-solver-symbol.ts"],"sourcesContent":["import { toFiniteNumber } from \"@symmio/utils/number\";\nimport { toThresholdSeconds } from \"../shared/solver-close-fee\";\nimport type { ApiSymbolResponse } from \"../types/generated/enigma-solver\";\nimport type { SolverSymbol } from \"./types\";\n\n/**\n * An `ApiSymbolResponse` row with the identity fields present. Enigma marks\n * every field optional in its OpenAPI spec, so we narrow to rows carrying a\n * usable identity (`symbol_id` / `name` / `symbol`) before mapping — a row\n * without identity cannot be traded or displayed.\n */\ntype IdentifiedSymbol = ApiSymbolResponse & {\n symbol_id: number;\n name: string;\n symbol: string;\n};\n\n/**\n * Type guard: does a raw `/symbols` row carry the identity fields the SDK\n * requires? Rows failing this are dropped by {@link toSolverSymbols}.\n */\nfunction hasIdentity(symbol: ApiSymbolResponse): symbol is IdentifiedSymbol {\n return symbol.symbol_id !== undefined && symbol.name !== undefined && symbol.symbol !== undefined;\n}\n\n/**\n * Normalize raw Enigma `/symbols` rows to {@link SolverSymbol}. Rows missing an\n * identity field are skipped; every other solver-optional field is filled with a\n * neutral default so the normalized shape has no optional noise.\n *\n * @param symbols - Raw `ApiSymbolResponse` rows from the solver.\n */\nexport function toSolverSymbols(symbols: readonly ApiSymbolResponse[]): SolverSymbol[] {\n return symbols.filter(hasIdentity).map(toSolverSymbol);\n}\n\nfunction toSolverSymbol(symbol: IdentifiedSymbol): SolverSymbol {\n return {\n symbolId: symbol.symbol_id,\n name: symbol.name,\n symbol: symbol.symbol,\n asset: symbol.asset ?? \"\",\n isValid: symbol.is_valid ?? false,\n pricePrecision: symbol.price_precision ?? 0,\n quantityPrecision: symbol.quantity_precision ?? 0,\n maxLeverage: toFiniteNumber(symbol.max_leverage),\n maxNotionalValue: symbol.max_notional_value ?? 0,\n rfqAllowed: symbol.rfq_allowed ?? false,\n tradingFee: symbol.trading_fee ?? \"0\",\n hedgerFeeOpen: symbol.hedger_fee_open ?? \"0\",\n hedgerFeeClose: symbol.hedger_fee_close ?? \"0\",\n // No early rate published → no decay: the early rate collapses to the standard rate.\n hedgerFeeCloseEarlyRate: symbol.hedger_fee_close_early_rate ?? symbol.hedger_fee_close ?? \"0\",\n hedgerFeeCloseEarlyThreshold: toThresholdSeconds(symbol.hedger_fee_close_early_threshold),\n hedgerFeeCloseStandardThreshold: toThresholdSeconds(symbol.hedger_fee_close_standard_threshold),\n maxFundingRate: symbol.max_funding_rate ?? \"0\",\n minNotionalValue: symbol.min_notional_value ?? \"0\",\n maxQuantity: symbol.max_quantity ?? \"0\",\n lotSize: symbol.lot_size ?? \"0\",\n minAcceptableQuoteValue: symbol.min_acceptable_quote_value ?? \"0\",\n minAcceptablePortionLf: symbol.min_acceptable_portion_lf ?? \"0\",\n tokenAddress: symbol.token_address ?? \"\",\n fundingRateEpochDuration: symbol.funding_rate_epoch_duration ?? \"0\",\n fundingRateWindowTime: symbol.funding_rate_window_time ?? \"0\",\n stateLong: symbol.state_long ?? 0,\n stateShort: symbol.state_short ?? 0,\n minOpenSolverFeeCap: symbol.min_open_solver_fee_cap ?? \"0\",\n minCloseSolverFeeCap: symbol.min_close_solver_fee_cap ?? \"0\",\n };\n}\n"],"mappings":";;;AAqBA,SAAS,EAAY,GAAuD;CAC1E,OAAO,EAAO,cAAc,KAAA,KAAa,EAAO,SAAS,KAAA,KAAa,EAAO,WAAW,KAAA;AAC1F;AASA,SAAgB,EAAgB,GAAuD;CACrF,OAAO,EAAQ,OAAO,CAAW,EAAE,IAAI,CAAc;AACvD;AAEA,SAAS,EAAe,GAAwC;CAC9D,OAAO;EACL,UAAU,EAAO;EACjB,MAAM,EAAO;EACb,QAAQ,EAAO;EACf,OAAO,EAAO,SAAS;EACvB,SAAS,EAAO,YAAY;EAC5B,gBAAgB,EAAO,mBAAmB;EAC1C,mBAAmB,EAAO,sBAAsB;EAChD,aAAa,EAAe,EAAO,YAAY;EAC/C,kBAAkB,EAAO,sBAAsB;EAC/C,YAAY,EAAO,eAAe;EAClC,YAAY,EAAO,eAAe;EAClC,eAAe,EAAO,mBAAmB;EACzC,gBAAgB,EAAO,oBAAoB;EAE3C,yBAAyB,EAAO,+BAA+B,EAAO,oBAAoB;EAC1F,8BAA8B,EAAmB,EAAO,gCAAgC;EACxF,iCAAiC,EAAmB,EAAO,mCAAmC;EAC9F,gBAAgB,EAAO,oBAAoB;EAC3C,kBAAkB,EAAO,sBAAsB;EAC/C,aAAa,EAAO,gBAAgB;EACpC,SAAS,EAAO,YAAY;EAC5B,yBAAyB,EAAO,8BAA8B;EAC9D,wBAAwB,EAAO,6BAA6B;EAC5D,cAAc,EAAO,iBAAiB;EACtC,0BAA0B,EAAO,+BAA+B;EAChE,uBAAuB,EAAO,4BAA4B;EAC1D,WAAW,EAAO,cAAc;EAChC,YAAY,EAAO,eAAe;EAClC,qBAAqB,EAAO,2BAA2B;EACvD,sBAAsB,EAAO,4BAA4B;CAC3D;AACF"}
|
|
@@ -43,8 +43,25 @@ export interface SolverSymbol {
|
|
|
43
43
|
tradingFee: string;
|
|
44
44
|
/** Hedger fee charged on open, as a decimal string. */
|
|
45
45
|
hedgerFeeOpen: string;
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Hedger fee charged on close, as a decimal string. This is the **standard**
|
|
48
|
+
* (floor) rate; a freshly opened position pays more — see
|
|
49
|
+
* {@link SolverSymbol.hedgerFeeCloseEarlyRate}. Pass the symbol to
|
|
50
|
+
* `getSolverCloseFeeRate` / `calculateSolverCloseFee` to price a close by
|
|
51
|
+
* holding time.
|
|
52
|
+
*/
|
|
47
53
|
hedgerFeeClose: string;
|
|
54
|
+
/**
|
|
55
|
+
* Early (peak) close-fee rate charged flat until
|
|
56
|
+
* {@link SolverSymbol.hedgerFeeCloseEarlyThreshold} seconds, then decaying to
|
|
57
|
+
* {@link SolverSymbol.hedgerFeeClose}. Decimal string. Equals `hedgerFeeClose`
|
|
58
|
+
* when the solver publishes no decay.
|
|
59
|
+
*/
|
|
60
|
+
hedgerFeeCloseEarlyRate: string;
|
|
61
|
+
/** Seconds from open during which `hedgerFeeCloseEarlyRate` applies flat. `0` when the solver publishes no decay. */
|
|
62
|
+
hedgerFeeCloseEarlyThreshold: number;
|
|
63
|
+
/** Seconds from open at/after which `hedgerFeeClose` applies; the rate decays linearly between the two thresholds. */
|
|
64
|
+
hedgerFeeCloseStandardThreshold: number;
|
|
48
65
|
/** Maximum funding rate, as a decimal string. */
|
|
49
66
|
maxFundingRate: string;
|
|
50
67
|
/** Minimum notional position value, as a decimal string. */
|
|
@@ -67,5 +84,9 @@ export interface SolverSymbol {
|
|
|
67
84
|
stateLong: number;
|
|
68
85
|
/** Short-side trading state: `0` Disabled, `1` Close only, `2` Open only, `3` Fully enabled. */
|
|
69
86
|
stateShort: number;
|
|
87
|
+
/** Minimum solver-fee cap a quote must allow on open, as a decimal string (perps-core v0.8.6 solver fees). */
|
|
88
|
+
minOpenSolverFeeCap: string;
|
|
89
|
+
/** Minimum solver-fee cap a quote must allow on close, as a decimal string (perps-core v0.8.6 solver fees). */
|
|
90
|
+
minCloseSolverFeeCap: string;
|
|
70
91
|
}
|
|
71
92
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/solvers/symbols/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,gBAAgB,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/solvers/symbols/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAEpF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,gBAAgB,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC,qHAAqH;IACrH,4BAA4B,EAAE,MAAM,CAAC;IACrC,sHAAsH;IACtH,+BAA+B,EAAE,MAAM,CAAC;IACxC,iDAAiD;IACjD,cAAc,EAAE,MAAM,CAAC;IACvB,4DAA4D;IAC5D,gBAAgB,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,uBAAuB,EAAE,MAAM,CAAC;IAChC,8EAA8E;IAC9E,sBAAsB,EAAE,MAAM,CAAC;IAC/B,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,wBAAwB,EAAE,MAAM,CAAC;IACjC,gEAAgE;IAChE,qBAAqB,EAAE,MAAM,CAAC;IAC9B,+FAA+F;IAC/F,SAAS,EAAE,MAAM,CAAC;IAClB,gGAAgG;IAChG,UAAU,EAAE,MAAM,CAAC;IACnB,8GAA8G;IAC9G,mBAAmB,EAAE,MAAM,CAAC;IAC5B,+GAA+G;IAC/G,oBAAoB,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -16,7 +16,9 @@ export interface ApiContractSymbol {
|
|
|
16
16
|
max_quantity?: string;
|
|
17
17
|
min_acceptable_portion_lf?: string;
|
|
18
18
|
min_acceptable_quote_value?: string;
|
|
19
|
+
min_close_solver_fee_cap?: string;
|
|
19
20
|
min_notional_value?: string;
|
|
21
|
+
min_open_solver_fee_cap?: string;
|
|
20
22
|
name?: string;
|
|
21
23
|
price_precision?: number;
|
|
22
24
|
quantity_precision?: number;
|
|
@@ -271,21 +273,6 @@ export interface ApiPostInstantOpenResponse {
|
|
|
271
273
|
partyBmm?: string;
|
|
272
274
|
temp_quote_id?: number;
|
|
273
275
|
}
|
|
274
|
-
export interface ApiRevenueBySymbolItem {
|
|
275
|
-
funding_revenue?: string;
|
|
276
|
-
hedger_fee_revenue?: string;
|
|
277
|
-
record_count?: number;
|
|
278
|
-
symbol?: string;
|
|
279
|
-
symbol_id?: number;
|
|
280
|
-
total_revenue?: string;
|
|
281
|
-
}
|
|
282
|
-
export interface ApiRevenueBatchPerSymbolResponse {
|
|
283
|
-
funding_revenue?: string;
|
|
284
|
-
hedger_fee_revenue?: string;
|
|
285
|
-
record_count?: number;
|
|
286
|
-
symbols?: ApiRevenueBySymbolItem[];
|
|
287
|
-
total_revenue?: string;
|
|
288
|
-
}
|
|
289
276
|
export interface ApiRevenueRecordItem {
|
|
290
277
|
amount?: string;
|
|
291
278
|
created_at?: string;
|
|
@@ -319,7 +306,9 @@ export interface ApiSymbolResponse {
|
|
|
319
306
|
max_quantity?: string;
|
|
320
307
|
min_acceptable_portion_lf?: string;
|
|
321
308
|
min_acceptable_quote_value?: string;
|
|
309
|
+
min_close_solver_fee_cap?: string;
|
|
322
310
|
min_notional_value?: string;
|
|
311
|
+
min_open_solver_fee_cap?: string;
|
|
323
312
|
name?: string;
|
|
324
313
|
price_precision?: number;
|
|
325
314
|
quantity_precision?: number;
|
|
@@ -460,71 +449,9 @@ export type GetQuotesParams = {
|
|
|
460
449
|
*/
|
|
461
450
|
offset?: number;
|
|
462
451
|
};
|
|
463
|
-
export type GetRevenueParams = {
|
|
464
|
-
/**
|
|
465
|
-
* Preset range (1h, 24h, 7d, 30d, lifetime)
|
|
466
|
-
*/
|
|
467
|
-
time_range?: string;
|
|
468
|
-
/**
|
|
469
|
-
* Revenue type filter (HedgerFee, FundingRate)
|
|
470
|
-
*/
|
|
471
|
-
type?: string;
|
|
472
|
-
/**
|
|
473
|
-
* Unix timestamp start (overrides time_range)
|
|
474
|
-
*/
|
|
475
|
-
start_time?: number;
|
|
476
|
-
/**
|
|
477
|
-
* Unix timestamp end
|
|
478
|
-
*/
|
|
479
|
-
end_time?: number;
|
|
480
|
-
};
|
|
481
|
-
export type GetRevenueBatchParams = {
|
|
482
|
-
/**
|
|
483
|
-
* Symbol IDs (max 100)
|
|
484
|
-
*/
|
|
485
|
-
symbol_ids: number[];
|
|
486
|
-
/**
|
|
487
|
-
* Preset range (1h, 24h, 7d, 30d, lifetime)
|
|
488
|
-
*/
|
|
489
|
-
time_range?: string;
|
|
490
|
-
/**
|
|
491
|
-
* Revenue type filter (HedgerFee, FundingRate)
|
|
492
|
-
*/
|
|
493
|
-
type?: string;
|
|
494
|
-
/**
|
|
495
|
-
* Unix timestamp start (overrides time_range)
|
|
496
|
-
*/
|
|
497
|
-
start_time?: number;
|
|
498
|
-
/**
|
|
499
|
-
* Unix timestamp end
|
|
500
|
-
*/
|
|
501
|
-
end_time?: number;
|
|
502
|
-
};
|
|
503
|
-
export type GetRevenuePerSymbolParams = {
|
|
504
|
-
/**
|
|
505
|
-
* Symbol IDs (max 100)
|
|
506
|
-
*/
|
|
507
|
-
symbol_ids: number[];
|
|
508
|
-
/**
|
|
509
|
-
* Preset range (1h, 24h, 7d, 30d, lifetime)
|
|
510
|
-
*/
|
|
511
|
-
time_range?: string;
|
|
512
|
-
/**
|
|
513
|
-
* Revenue type filter (HedgerFee, FundingRate)
|
|
514
|
-
*/
|
|
515
|
-
type?: string;
|
|
516
|
-
/**
|
|
517
|
-
* Unix timestamp start (overrides time_range)
|
|
518
|
-
*/
|
|
519
|
-
start_time?: number;
|
|
520
|
-
/**
|
|
521
|
-
* Unix timestamp end
|
|
522
|
-
*/
|
|
523
|
-
end_time?: number;
|
|
524
|
-
};
|
|
525
452
|
export type GetRevenueRecordsParams = {
|
|
526
453
|
/**
|
|
527
|
-
* Last seen
|
|
454
|
+
* Last seen income-history record ID
|
|
528
455
|
*/
|
|
529
456
|
id?: number;
|
|
530
457
|
/**
|
|
@@ -666,7 +593,7 @@ export declare const getInstantTradeEip712Config: (options?: AxiosRequestConfig)
|
|
|
666
593
|
* - `remove_margin` — withdraw allocated margin from an existing VirtualAccount via AccountLayer.removeMargin. Requires `operation`.
|
|
667
594
|
* - `delegate_access_for_session_key` — grant a delegate signer access for one or more allowlisted selectors via InstantLayer.grantBatchDelegationBySig. Requires `delegation`.
|
|
668
595
|
*
|
|
669
|
-
* Exactly one of `operation` or `delegation` must be present per request. Delegation selectors are restricted to: `
|
|
596
|
+
* Exactly one of `operation` or `delegation` must be present per request. Delegation selectors are restricted to: `sendQuote`, `requestToClosePosition`, `addMarginToNextVA`, `addMargin`, `removeMargin`, `allocate`, `deallocate`, `safeDeallocate`, `initiateWithdraw`, `finalizeWithdrawRequest`, `requestCancelWithdraw`.
|
|
670
597
|
*
|
|
671
598
|
* Each PartyA is limited to `GASLESS_DAILY_MAX` accepted attempts per UTC day (default 5). The counter is consumed on every attempt past basic validation, regardless of downstream success or failure; the `dailyRemaining` field in the response reports the user's remaining quota.
|
|
672
599
|
* @summary Submit a gasless operation
|
|
@@ -705,27 +632,12 @@ export declare const getNotionalCapSymbolId: (symbolId: number, options?: AxiosR
|
|
|
705
632
|
*/
|
|
706
633
|
export declare const getQuotes: (params?: GetQuotesParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiGetQuotesResponse>>;
|
|
707
634
|
/**
|
|
708
|
-
* Returns
|
|
709
|
-
* @summary Get aggregated revenue for all symbols
|
|
710
|
-
*/
|
|
711
|
-
export declare const getRevenue: (params?: GetRevenueParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiRevenueResponse>>;
|
|
712
|
-
/**
|
|
713
|
-
* Returns total, hedger-fee, and funding-rate revenue for a set of symbols. Pass symbol_ids as a comma-separated list or repeated query params (max 100).
|
|
714
|
-
* @summary Get aggregated revenue for multiple symbols
|
|
715
|
-
*/
|
|
716
|
-
export declare const getRevenueBatch: (params: GetRevenueBatchParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiRevenueResponse>>;
|
|
717
|
-
/**
|
|
718
|
-
* Returns aggregated revenue totals AND a per-symbol breakdown for the requested symbol_ids. Each item in `symbols` carries symbol_id, symbol name, and the same revenue dimensions returned at the top level. Symbols with no rows in the filter window are omitted; entries follow the request's symbol_ids order. Pass symbol_ids as a comma-separated list or repeated query params (max 100).
|
|
719
|
-
* @summary Get aggregated revenue plus per-symbol breakdown
|
|
720
|
-
*/
|
|
721
|
-
export declare const getRevenuePerSymbol: (params: GetRevenuePerSymbolParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiRevenueBatchPerSymbolResponse>>;
|
|
722
|
-
/**
|
|
723
|
-
* Returns revenue rows with id greater than the supplied last-seen id. Results are ordered by id ascending before offset/limit pagination. `count` is the total matching record count before pagination. Pass symbolIds as a comma-separated list or repeated query params to filter by symbol; omit it or pass it empty to disable symbol filtering.
|
|
635
|
+
* Returns revenue-bearing income-history rows with id greater than the supplied last-seen income_history id. Results use block time as created_at and are ordered by id ascending before offset/limit pagination. `count` is the total matching record count before pagination. Pass symbolIds as a comma-separated list or repeated query params to filter by symbol; omit it or pass it empty to disable symbol filtering.
|
|
724
636
|
* @summary Get incremental revenue records
|
|
725
637
|
*/
|
|
726
638
|
export declare const getRevenueRecords: (params?: GetRevenueRecordsParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiRevenueRecordsResponse>>;
|
|
727
639
|
/**
|
|
728
|
-
* Returns
|
|
640
|
+
* Returns income-history open/close solver fees and funding fees for one symbol using block timestamps. Filterable by time_range or custom timestamps.
|
|
729
641
|
* @summary Get aggregated revenue for a specific symbol
|
|
730
642
|
*/
|
|
731
643
|
export declare const getRevenueSymbolId: (symbolId: number, params?: GetRevenueSymbolIdParams, options?: AxiosRequestConfig) => Promise<AxiosResponse<ApiRevenueResponse>>;
|
|
@@ -768,9 +680,6 @@ export type GetNotionalCapResult = AxiosResponse<ApiNotionalCapAllSymbolsRespons
|
|
|
768
680
|
export type GetNotionalCapBatchResult = AxiosResponse<ApiNotionalCapAllSymbolsResponse>;
|
|
769
681
|
export type GetNotionalCapSymbolIdResult = AxiosResponse<ApiNotionalCapBySymbolResponse>;
|
|
770
682
|
export type GetQuotesResult = AxiosResponse<ApiGetQuotesResponse>;
|
|
771
|
-
export type GetRevenueResult = AxiosResponse<ApiRevenueResponse>;
|
|
772
|
-
export type GetRevenueBatchResult = AxiosResponse<ApiRevenueResponse>;
|
|
773
|
-
export type GetRevenuePerSymbolResult = AxiosResponse<ApiRevenueBatchPerSymbolResponse>;
|
|
774
683
|
export type GetRevenueRecordsResult = AxiosResponse<ApiRevenueRecordsResponse>;
|
|
775
684
|
export type GetRevenueSymbolIdResult = AxiosResponse<ApiRevenueResponse>;
|
|
776
685
|
export type GetStatsResult = AxiosResponse<ApiGetStatsResponse>;
|