Module 18: SDK Reference

Flat lookup table for the SDK: signatures, parameters, return types, and which action module has the full context.

This reference describes the SDK release built for the current contract set (several mains, presale, the staking vault, tranche markets, one Up/Down contract). Earlier SDK versions target the previous contracts and cannot be used with this deployment.

Which version these docs describe. They describe the contract set published at /contracts.json (network, chainId, deploymentBlock) and the SDK and MCP releases that ship with it. Install the SDK-TS, SDK-PY and MCP-TS versions named in the release notes of that deployment. An older SDK stops at start-up with an address-mismatch error against /contracts.json: that error means 'upgrade'.

This is the "what is the signature for extendLoan()" reference. No strategy, no examples: just the API surface. For usage patterns, errors, and worked examples, follow the Action Module pointer. Every row names the contract call the method makes; the wrapper names follow the SDK release and may still change, the contract calls do not.

Examples name STASIS and USDG as "the default main and its pair asset". Every main has its own on-chain name and symbol and its own pair asset: read them, never assume them.

→ See Module 02 for getting started
→ Contract addresses: GET /contracts.json on the deployment you use (Module 17 explains the keys)
→ See Module 10 for all read/query patterns


Section 1: Overview & Installation

JavaScript

npm install github:Launch-On-Basis/SDK-TS

Python

pip install git+https://github.com/Launch-On-Basis/SDK-PY.git

Initialization

const client = await BasisClient.create({ privateKey?, apiKey?, rpcUrl?, chainId?, apiDomain?, addresses? })

On start the client reads GET {apiDomain}/contracts.json: one address per contract, the chainId, and a mains list (main, pairAsset, vault, pairSymbol, pairDecimals). addresses overrides that set. The mains can also be read on chain: SWAP.pairCount(), pairList(i), pairs(main) → (pairAsset, staking, active). An address that is zero in that file is not deployed on that network: the client refuses to send a transaction to it. rpcUrl is optional: when it is left out the SDK uses the default public RPC of the chain named in /contracts.json; pass your own for anything beyond light use.

Client Modes

ModeConfigCapability
Read-only{ rpcUrl? }: no keyOn-chain reads only
API-key{ apiKey, rpcUrl? }Off-chain API reads, no writes
Full{ privateKey, rpcUrl? }All reads and writes

Token Amounts

Tokens minted by BASIS (every main, factory token, market token, outcome share and Up/Down pool token) are 18-decimal wei. An amount of a main's pair asset uses that asset's decimals: read PAIR_UNIT() on the main, decimals() on the asset, or pairDecimals in /contracts.json. Resolver bonds use BOND_UNIT() of BOND_TOKEN(). parseUnits("5", 18) is 5 units only of an 18-decimal asset; USDG, the default main's pair asset, has 6 decimals, so 5 USDG is parseUnits("5", 6). Return values are bigint in the unit of the asset they measure.

Approvals and msg.value

Approve the exact amount of the token a call pulls, to the contract that pulls it. The vault itself is not a token and has no approve.

CallToken pulledSpender
buy, leverageBuy, mixedBuypath[0]SWAP
sellthe token sold (path[0])SWAP
swapCrosspath[0] (nothing when the native coin is sent as msg.value)SWAP
vault stakethe mainthe vault
vault repay, paid extendLoanthe main's pair assetthe vault
hub takeLoan, increaseLoanthe collateral tokenthe loan hub
hub repayLoan, extendLoan with payInStablethe ecosystem's stable (the main's pair asset)the loan hub
leverage repay through SWAP (repayWith)the token you pay with (the pair asset or another)SWAP
leverage repay or paid extension by contract callthe pair assetthe address you call (the SDK sets the approval)
resolver propose, dispute, vetoBOND_TOKENthe resolver
market buythe input tokenthe market's host
order fill (buyOrder)the market's pair assetthe market's host
market seed (createMarket)the main's pair assetthe host
Up/Down betthe input tokenMultiPrediction
vesting create, add tokensthe vested tokenthe vesting contract
vesting repayLoanOnVesting, repayExtendAndReborrowthe pair asset of the vesting's main (the loan's full amount)the vesting contract

Payable calls: token creation and market creation need msg.value equal to the fee exactly; vesting creation needs at least its fee when that fee is on (the surplus is refunded).


Section 2: Methods by Module


client (core)

MethodParamsReturnsDescriptionAction Module
BasisClient.create(config){ privateKey?, apiKey?, rpcUrl?, chainId?, apiDomain?, addresses? }BasisClientInitialize client02
client.authenticate()-sessionSIWE auth03
client.ensureApiKey()-apiKeyProvision API key03
client.getSession()-sessionCheck session03
client.logout()-voidEnd session03
client.writeContract(params)ContractWriteParamstx+syncExecute, then index the transaction (every event)10

client.trading

Each main trades against its own pair asset and each factory token against its main. pairAsset below is SWAP.pairs(main).pairAsset; a token's main is token.quoteToken(). A factory token paired straight with the pair asset is refused (Bad pair).

MethodParamsReturnsDescriptionAction Module
buy(tokenAddress, amountIn, minOut?)address, bigint, bigint?txBuy a token with its main's pair asset. Calls ASwap.buyTokens(amountIn, minOut, [pairAsset, main, token], false) ([pairAsset, main] when the token is a main). amountIn is in the pair asset's decimals.04
sell(tokenAddress, tokenAmount, minOut?)address, bigint, bigint?txSell a token for its main's pair asset: ASwap.sellTokens(tokenAmount, minOut, [token, main, pairAsset], false).04
sellPercentage(tokenAddress, percentage)address, numbertxSell % of balance04
leverageBuy(tokenAddress, amountIn, days, minOut?)address, bigint, number, bigint?txOpen a leveraged position: ASwap.leverageBuy(amountIn, minOut, path, numberOfDays). path[0] must be the pair asset of path[1] (the main), else wrong path. minOut is checked against the whole leveraged collateral (simulateLeverageLocked(…).totalColleteral). Leverage reaches up to about 37x, depending on the token and the size of the buy; the position must be more than 2x (Under 2x). One open position per token: with one already open, a leverage buy adds to it and keeps its end date, priced for the days left (Extend first when fewer than the minimum days are left).04
mixedBuy(tokenAddress, amountIn, days, percentageLeverage, minOutLev?)address, bigint, number, number, bigint?txOne leverage position at a lower leverage: ASwap.mixedBuy(amount, minOutLev, path, numberOfDays, percentageLeverage). The whole amount goes into the position, and only percentageLeverage % (1 to 99, else Range) of the first buy is borrowed against; the rest stays in the position as collateral with no debt. Nothing goes to the wallet. minOutLev is the minimum tokens in the position (simulateLeverageLocked or simulateLeverageFactoryLocked with that percentage, .totalColleteral). Same fees, the same 2x minimum and the same one-position-per-token rule as leverageBuy.04
buyTokens(amountIn, path, minOut?, wrapTokens?)bigint, address[], bigint?, boolean?txRaw buy: ASwap.buyTokens(amount, minOut, path, wrapTokens). Paths: [pairAsset, main], [main, token] (the amount and the tax are then in the main) or [pairAsset, main, token]. wrapTokens = true stakes a bought main in that main's vault. SWAP picks presale or AMM itself.04
sellTokens(amountIn, path, minOut?)bigint, address[], bigint?txRaw sell: ASwap.sellTokens(amount, minOut, path, false). The fourth contract argument must be false (true reverts use swapCross). Paths are the reverses of the buy paths.04
swapCross(path, amountIn, minOut, opts?)address[], bigint, bigint, { recipient?, deadline?, unwrapNative? }txSwap across two mains, or to and from an outside token, in one transaction: ASwap.swapCross(path, amountIn, minOut, recipient, deadline, unwrapNative). Payable: send the native coin with path[0] = the wrapped native token.04
quoteCross(path, amountIn, wallet)address[], bigint, addressbigintWhat a trade pays after wallet's tax, for plain and cross-pair paths. The contract function is nonpayable, so it is called with eth_call. Reverts autovest presale for a token in an auto-vest presale. Use it to set minOut.04,32
getAmountsOut(amountIn, path)bigint, address[]bigintQuote before tax: one uint256 for 2-hop and 3-hop paths. A buy takes the tax off the input and a sell takes it off the output, so the trade pays less than this.04,32
getTokenPrice(tokenAddress)addressbigintPrice × 1e18 in main units. For a main it is the price in its pair asset.04,10
getPairPrice(tokenAddress)addressbigintPrice in the main's pair-asset units (token price × the main's price). A USD price only when the pair asset is a USD stable.04,10
getLeverageCount(wallet, main?)address, address?bigintLeverage positions the wallet has opened on that main (default: the default main). Reads main.leverageCount(wallet); ids run 1 to count. Each position is recorded on its token's main: loop over every main to see them all. MainLens.getLeverageCountForUserAndToken(main, wallet, token) counts the positions ever opened on one token; at most one is open at a time (main.openLeverageOf(wallet, token)).04,10
getLeveragePosition(wallet, index, main?)address, bigint, address?LeveragePosition (13 values)main.leverages(wallet, index). Order: user, token, collateralAmount, liquidatedAmount, fullAmount, borrowedAmount, liquidationTime, liquidationClaim, isLiquidated, active, creationTime, timeOfClosure, (leverageBuyAmount, cashedOut). 1-indexed: index 0 is always empty.04,10
getPartialLoanSellAmounts(positionId, wallet, percentage, isLeverage, main?)bigint, address, number, boolean, address?{ residualTokens }MainLens.getPartialLoanSellAmounts(main, loanId, user, percentage, isLeverage) (the main is the first argument). Use only residualTokens: the part of your collateral left to sell. Read it before a partial sell to set minOut; the other return values are internal. Reverts Already liquidated on a liquidated position.04
partialLoanSellFor(main, positionId, percentage, isLeverage, minOut)address, bigint, bigint, boolean, biginttxSell down or close a leverage position; 100 = full close. Percentage 10 to 100 in steps of 10 (% by 10, % range). ASwap.partialLoanSellFor(main, loanId, percentage, isLeverage, minOut) on the main the position lives on. Only the position's own wallet may call (Not user). The exit pays 3% of the proceeds above the initial buy. Slippage revert: Min out not met. Naming the wrong main reverts Not user, or sells that main's position with the same id.04
extendLeverage(positionId, days, payInMainPair, refinance, main?)bigint, number, boolean, boolean, address?txExtend a leverage position. The position is recorded on the token's main; extend it there: main.extendLoan(positionId, days, true, payInMainPair, refinance). Works until a keeper liquidates the position.04
repayLeverage(positionId, main?)bigint, address?txRepay with the pair asset, nothing sold. The position is recorded on the token's main; repay it there: main.repayLoan(positionId, amount, true). An amount at or above the debt closes the position and returns all the collateral (send type(uint256).max to close). A smaller amount repays that part and returns the same share of the collateral; what is left must stay at least minimumLoan (Repay in full). Approve the pair asset to the address you call. Or repay through SWAP: ASwap.repayWith(main, positionId, tokenIn, amountIn, minPairOut, close, deadline) takes the pair asset itself or another token (converted to the pair asset first), refunds the leftover, and needs the approval on SWAP only.04
claimLeverageLiquidation(positionId, main?)bigint, address?txAfter a keeper liquidated the position: main.claimLiquidation(positionId, true) pays what is left after the debt, less the 10% liquidation fee. Claim within 365 days of the liquidation; after that the leftover may no longer be claimable.04

ASwap.convertToNative(marketToken, inputToken, inputAmount, sell) converts the pair asset or the main to and from a market token, not outcome shares. Only registered prediction hosts may call it (hosts only); no wallet can. The SDK has no wrapper.

After liquidationTime a keeper liquidates the position. Assume it can happen in the first block after the deadline. Until that transaction lands a repay or a paid extension still goes through; do not plan on the gap.


client.factory

MethodParamsReturnsDescriptionAction Module
createTokenWithMetadata(params)CreateTokenParamstxCreate a token and its IPFS metadata. Sends msg.value = feeWhitelist(wallet) ? 0 : feeAmount() exactly; any other value reverts Wrong fee. presaleTokens is a count of whole tokens sold in the presale (0 = no presale), not a pair-asset amount. Calls createTokenFor(CreateParams), or createReversedTokenFor when reversed: true. Bounds: hybridMultiplier 1–100 (100 = Stable+, 50 to 99 = Utility+, 1 to 49 = Floor+; reversed: 1 to 50 Meme+, 51 to 99 Yolo+, 100 Yolo), startLP 1,000 to 100,000, autoVestDuration 1–990 days, frozen needs a presale, supplyMultiplier at most the main's MAX_SUPPLY_MULTIPLIER().07
createTokenFor(params)CreateParamstxThe same creation without metadata: picks the main, supplyMultiplier and rewardsEnabled.07
createReversedToken(params)CreateParamstxCreate a reversed token, Meme+, Yolo+ or Yolo (reversed() is true): createReversedTokenFor. The presale is at most half the launch supply.07
disableFreeze(tokenAddress)addresstxtoken.disableFreeze(), called on the token. Irreversible.07
setWhitelistedWallet(tokenAddress, wallets, amount, tag)address, address[], bigint, stringtxtoken.setWhitelistedWallet(wallets, amount, tag). amount caps the tokens each wallet may buy during a frozen presale.07
removeWhitelist(tokenAddress, wallet)address, addresstxtoken.removeWhitelist(wallet)07
claimRewards(tokenAddress)addresstxClaim holder rewards: token.claimRewards(). Only tokens created with rewardsEnabled pay; rewards are paid in the main's pair asset. It never pays a creator.07
getTokenState(tokenAddress)addressTokenStatefrozen, presaleComplete, presaleSold, presaleTarget, reversed, rewardsEnabled, hybridMultiplier, totalSupply, the price in main units (getTokenPrice) and in pair-asset units (getPairPrice), main, pairAsset.07,10
isEcosystemToken(tokenAddress)addressbooleanVerify token is legit10
getTokensByCreator(wallet)addressaddress[]Factory tokens whose factory caller was the wallet. A market token is created by its host, so a wallet's markets are not in this list.07,10
getFeeAmount()-bigintCreation fee in ETH: feeAmount()07
isFeeWhitelisted(wallet)addressbooleanfeeWhitelist(wallet): such a wallet sends 007
getClaimableRewards(tokenAddress, wallet)address, addressbiginttoken.getClaimableRewards(wallet); 0 on a token without rewards07,10
getFloorPrice(tokenAddress)addressbigintThe floor in pair-asset units: calculateFloor(). calculateTokenFloor() gives it in main units.04,10

client.loans

⚠️ These methods act on HUB LOANS only. SWAP opens and closes leverage positions, and each one is recorded on its token's main. The hub methods (repayLoan, extendLoan, increaseLoan, claimLiquidation, hubPartialLoanSell) take a hub id and never reach a leverage position. For leverage use client.trading: partialLoanSellFor(main, positionId, pct, true, minOut) to sell down or close, extendLeverage, repayLeverage, and claimLeverageLiquidation after a keeper liquidation.

MethodParamsReturnsDescriptionAction Module
takeLoan(main, collateral, amount, days)address, address, bigint, numbertxBorrow the main's pair asset against amount of collateral: ALOAN_HUB.takeLoan(ecosystem, collateral, amount, daysCount). ecosystem is the main: the collateral itself when it is a main, else its quoteToken(). 10 to 1000 days. The fee, 2% + 0.005% per day, is taken up front. The loan value must reach the main's minimumLoan. One open loan per wallet, main and collateral token: add to it with increaseLoan (Open loan: increase it). Returns a hub id; ids start at 1.05
repayLoan(hubId)numbertxALOAN_HUB.repayLoan(hubId, amount); nothing is sold. An amount at or above the debt closes the loan and returns all the collateral (send type(uint256).max). A smaller amount repays that part and returns the same share of the collateral; what is left must stay at least the main's minimumLoan (Repay in full). To repay with another token: repayLoanWith(hubId, tokenIn, amountIn, minStableOut, close, deadline). Works until a keeper liquidates the loan, even after the term.05
extendLoan(hubId, days, payInStable?, refinance?)number, number, boolean?, boolean?txALOAN_HUB.extendLoan(hubId, addDays, payInStable, refinance). The two flags are exclusive (Pay in stable or refinance, not both). days = 0 needs refinance.05
increaseLoan(hubId, amountToAdd)number, biginttxAdd collateral to the loan: ALOAN_HUB.increaseLoan(hubId, amountToAdd)05
claimLiquidation(hubId)numbertxAfter a keeper liquidated the loan: claim the remainder (the collateral left after the debt, less the 10% liquidation fee). Claim within 365 days of the liquidation; after that the leftover may no longer be claimable.05
hubPartialLoanSell(hubId, percentage, minOut)number, number, biginttxPartial sell of a hub loan: ALOAN_HUB.hubPartialLoanSell(hubId, percentage, minOut), in 10% steps (10 to 100). Pays the pair asset, and the residual sold pays the token's normal sell rate (base + creator + rewards fee, no referral). There is no leverage flag: the hub only sells hub loans. For leverage use client.trading.partialLoanSellFor().05
getUserLoanDetails(wallet, hubId)address, numberFullLoanDetails (14 fields)Loan state by hub id. An unknown id reverts Loan does not exist.05,10
getUserLoanCount(wallet)addressnumberuserLoanCount(wallet): loans the wallet ever opened on the hub. Ids are 1 to count: loop from 1.05,10

A vault loan is owned by the vault in the hub: these methods fail for it (use client.vault). After liquidationTime a keeper liquidates the loan. Assume it can happen in the first block after the deadline. Until that transaction lands a repay or a paid extension still goes through; do not plan on the gap.


client.vault(main?)

One vault contract serves every main (SWAP.pairs(main).staking names it). Each main has its own pool, and every contract call names the main first; every SDK method takes an optional main (default: the default main). A stake is not a token: it cannot be transferred or approved, and the vault has no balanceOf: the stake is positions(main, wallet).staked. Rewards: 10% of the base part of every fee on that main's tokens, bought into the main and paid to that main's stakers only. A liquidation settles the vault position in the same transaction: there is no settle call.

MethodParamsReturnsDescriptionAction Module
stake(amount)biginttxStake the main 1:1: AStasisVault.stake(main, amount). Minimum minStake(). Approve the main to the vault.06
unstake(amount, toMainPair?, minMainPair?)bigint, boolean?, bigint?txunstake(main, amount, toMainPair, minMainPair). At most freeToUnstake(main, wallet): the pledged part stays. With toMainPair the main is sold for the pair asset at the wallet's own tax; minMainPair is the floor.06
claim()-txclaim(main): pay out the earned rewards, in the main. With a loan open, only the part not needed as collateral.06
compound()-txcompound(main): add the earned rewards to the stake06
borrow(mainAmount, days)bigint, numbertxPledge mainAmount of the staked main and borrow its pair asset: borrow(main, stasisAmount, days). The first argument is an amount of the main, not of the pair asset. One loan per position; the pledged part keeps earning.06
addToLoan(additionalMain)biginttxPledge more staked main and borrow more: addToLoan(main, additionalStasis). Needs more than 10 days left on the loan (Duration too short).06
repay()-txrepay(main): repay the vault loan in full. Approve the pair asset to the vault.06
extendLoan(daysToAdd, payInMainPair, refinance)number, boolean, booleantxextendLoan(main, daysToAdd, payInMainPair, refinance): extend the vault loan. daysToAdd = 0 needs refinance = true and payInMainPair = false.06
earned(wallet)addressbigintearned(main, wallet): rewards earned and not yet claimed, in the main06,10
getPosition(wallet)addressVaultPositionpositions(main, wallet) = (staked, pledged, hubId, checkpoint, pending, hub) (a loan is open when hub is set), plus earned(main, wallet), collateralOf(main, wallet) and freeToUnstake(main, wallet)06,10
getAvailableStasis(wallet)addressbigintgetAvailableStasis(main, wallet): stake plus unclaimed rewards the wallet can still pledge06,10
getVaultLoan(wallet)addressLoanDetails | nullThe wallet's vault loan, read from positions(main, wallet).hub and .hubId. The borrower of record on the hub is the vault, not the wallet.06,10
getTotals()-{ totalStaked, totalPledged, rewardsHeld }pools(main) = (totalStaked, totalPledged, rewardsHeld, accRewardPerStake): that main's pool, in the main06,10

client.vesting

MethodParamsReturnsDescriptionAction Module
createGradualVesting(beneficiary, token, totalAmount, startTime, durationInDays, timeUnit, memo, ecosystem, renounceOnCreation?)address, address, bigint, number, number, number, string, address, boolean?txLinear vesting. beneficiary cannot be the zero address (Invalid beneficiary address). startTime may be at most 7 days ahead (Start too far); a past time means now. ecosystem is the token's main (the token must be that main or one of its tokens). Payable only when the vesting fee is on and the wallet is not fee-whitelisted (off by default; the surplus is refunded).09
createCliffVesting(beneficiary, token, totalAmount, unlockTime, memo, ecosystem, renounceOnCreation?)address, address, bigint, number, string, address, boolean?txCliff vesting; same beneficiary, ecosystem and fee rules09
batchCreateGradualVesting(beneficiaries[], token, totalAmounts[], memos[], startTime, durationInDays, timeUnit, ecosystem, renounceOnCreation?)parallel arrays + one shared token, schedule and maintxBatch gradual09
batchCreateCliffVesting(beneficiaries[], token, totalAmounts[], unlockTime, memos[], ecosystem, renounceOnCreation?)parallel arrays + one shared token, unlock time and maintxBatch cliff09
claimTokens(vestingId)numbertxClaim unlocked09
takeLoanOnVesting(vestingId)numbertxBorrow against the vesting. No days argument: the term is the schedule's remaining days plus loanBuffer (10). Pledges every unclaimed token; the beneficiary receives the loan in the main's pair asset.09
repayLoanOnVesting(vestingId)numbertxRepay the vesting loan in full; also settles a loan a keeper liquidated. The beneficiary may call it, and so may the creator while the vesting is not renounced (the caller pays).09
repayExtendAndReborrow(vestingId, additionalDays)number, numbertxRepay, extend the schedule and borrow again in one transaction09
renounceVesting(vestingId)numbertxAfter it the creator can no longer change the beneficiary, extend the schedule or repay its loan. Adding tokens and handing on the creator role still work.09
changeBeneficiary(vestingId, newBeneficiary)number, addresstxChange recipient (not on a renounced vesting)09
extendVestingPeriod(vestingId, additionalDays)number, numbertxExtend, in days. Creator or beneficiary. Reverts Loan open: repay first while a loan is linked.09
addTokensToVesting(vestingId, amount)number, biginttxAdd tokens (same loan guard)09
transferCreatorRole(vestingId, newCreator)number, addresstxTransfer creator09
getVestingDetails(vestingId)numberVestingDetails (14 fields)Schedule details; ecosystem is field 3 and renounced is last09,10
getClaimableAmount(vestingId)numberbigintClaimable now09,10
getVestedAmount(vestingId)numberbigintTotal vested09,10
getEffectiveTotalAmount(vestingId) / getEffectiveVestedAmount(vestingId)numberbiginteffectiveTotalAmount / effectiveVestedAmount: totals after a liquidation reduced the vesting09,10
getVestingsByBeneficiary(wallet)addressvestingId[]My vestings09,10
getVestingsByCreator(wallet)addressvestingId[]Created vestings09,10
getActiveLoan(vestingId)numberbigintThe hub id of the linked loan; 0 = none09,10
getLoanHubOf(vestingId)numberaddressloanHubOf(vestingId): the hub that holds this vesting's loan09
getTokenVestingIds(tokenAddress, startIndex, endIndex)address, number, numbervestingId[]Vestings of a token, paged09
getVestingDetailsBatch(vestingIds[])number[]VestingDetails[]Batch read09,10
getVestingCount()-numbervestingCount(); ids start at 009

client.predictionMarkets

Public markets live on the marketTrading host (ATrancheMarket). Sizes are set per main: read TrancheReader.sizesFor(host, main, n) → (unit, seedStep, minBet, perOutcome, totalPool). The seed floor is minSeed() × unit, in steps of seedStep. The outcome limit is MAX_OUTCOMES(), read live.

MethodParamsReturnsDescriptionAction Module
createMarketWithMetadata(params)CreateMarketParamstxCreate a public market: ATrancheMarket.createMarket(CreateParams, deadline, approvalSignature) with the moderator approval (POST /api/v1/markets/approve) and exactly the signed name, symbol, end time and outcomes. CreateParams = { marketName, symbol, endTime, optionNames, trancheBP, maintoken, frozen, bonding, seedAmount }. endTime: 0 for an open-ended market, else at least 1 minute ahead. The end time is part of the moderator approval: an approval is only valid for the end time it was signed for, and the approval step refuses end times too far out. trancheBP: 1 to 10 slices that sum to 10000 ([10000] = winner takes all). seedAmount: raw pair-asset amount, at least minSeed() × sizesFor.unit and a multiple of seedStep. Approve the seed of the pair asset to the host. msg.value = the factory fee for the host, exactly.08
buy(marketAddress, outcomeId, inputToken, inputAmount, minTokens, minShares)address, number, address, bigint, bigint, biginttxbuy(marketToken, outcomeId, inputToken, inputAmount, minUsdc, minShares, deadline); after deadline it reverts Deadline. inputToken is the market token, the pair asset, the market's main or another BASIS token (an outside token only where a route exists). minTokens (contract name minUsdc) is the smallest net market-token amount accepted; minShares comes from marketReader.quoteShares. Never pass 0. AMM bets stop once an outcome is proposed.08
redeem(marketAddress, opts?)address, { fractionBps?, slices?, minOut? }txredeem(marketToken, fractionBps, slices, minOut); default (10000, 1, …). The payout is held in market tokens and sold to the pair asset here.08
buyOrdersAndContract(marketAddress, outcomeId, orderIds[], inputToken, totalInput, minShares)address, number, number[], address, bigint, biginttxCombined order book + AMM. Takes only the pair asset as inputToken.08
getMarketData(marketAddress)addressMarketData12 fields. finalOutcome: 254 = INVALID, 255 = unresolved. usdc is the market's pair asset. generalPot always reads 0: do not use it.08,10
getOutcome(marketAddress, outcomeId)address, numberOutcomeDataOutcome details08,10
getUserShares(marketAddress, wallet, outcomeId)address, address, numberbigintShare balance08,10
getNumOutcomes(marketAddress)addressnumberOutcome count08
getOptionNames(marketAddress)addressstring[]Outcome names08
hasBettedOnMarket(marketAddress, wallet)address, addressbooleanHas bet08,10
getTrancheBP(marketAddress)addressnumber[]The payout split08
getFinalRanking(marketAddress)addressnumber[]The resolved ranking08
isValidRanking(marketAddress, ranking[], tieMask)address, number[], bigintbooleanCheck a ranking before proposing or voting08,14
quoteScenario(marketAddress, ranking[], tieMask, wallet)address, number[], bigint, addressbigintPayout in market tokens if that ranking wins08,32
quoteRedeem(marketAddress, wallet)address, addressbigintPayout in market tokens after resolution08,32
getPendingPayout(marketAddress, wallet)address, addressbigintpendingPayout(market, wallet): market tokens still to redeem after a partial redeem08
getMarketSizes(main, numOutcomes)address, number{ unit, seedStep, minBet, perOutcome, totalPool }TrancheReader.sizesFor(host, main, n): the sizes in force. minBet is in 18-decimal market tokens, after conversion and before the fee.08

Total pot: there is no getter. It is the sum of totalCost over marketReader.getAllOutcomes(host, market), in market tokens; marketReader.valueInUsdb(host, market, amount) gives its pair-asset value.


client.orderBook

Every call goes to the market's own host (public or private).

MethodParamsReturnsDescriptionAction Module
listOrder(marketAddress, outcomeId, amount, pricePerShare)address, number, bigint, biginttxCreate a limit sell. pricePerShare is the odds × 1e18, from 0.001 (1e15) to 0.999 (999e15), or 0 to sell at the live AMM price.08
cancelOrder(marketAddress, orderId)address, numbertxCancel order08
buyOrder(marketAddress, orderId, fill, maxCost)address, number, bigint, biginttxFill an order (not your own). fill is a share count; maxCost caps the total cost in the market's pair asset.08
getBuyOrderCost(marketAddress, orderId, fill)address, number, bigint{ baseUsdc, buyerTax, totalCostToBuyer, netToSeller }Cost of a fill08
getBuyOrderAmountsOut(marketAddress, orderId, amount)address, number, bigint{ fill, baseUsdc, buyerTax, totalCostToBuyer }Shares a pair-asset amount buys from that order08

To sweep several orders use buyOrdersAndContract with the order ids.


client.resolver

Every tranche market registers with the resolver when it is created and is ranked. The single-outcome contract entry points (one uint8 outcome) revert Ranked market: use the *Ranked entrypoints. Only wallets on the voter panel (authorizedVoter) vote: no stake, no lock. Bonds are paid in BOND_TOKEN: 5 units, doubled after each EARLY reset, at most 8 doublings (1,280 units), never above BOND_MAX() (8,000 units). Read requiredBond(market, wallet). The winner gets their own bond back, plus the loser's bond up to twice the winner's own bond (so at most three times their own bond in total). Anything above that goes to insurance. If neither key wins, both bonds go to insurance. When an EARLY dispute wins, the disputer gets their own bond back plus half the proposer's bond; the other half goes to insurance.

MethodParamsReturnsDescriptionAction Module
propose(marketAddress, ranking[], tieMask?)address, number[], bigint?txproposeRanked(marketToken, ranking, tieMask). [outcome] for a winner-take-all market; an empty ranking = INVALID. Bond: requiredBond(market, wallet) in BOND_TOKEN. The creator may propose at endTime, everyone else 15 minutes later.08,14
dispute(marketAddress, ranking[], tieMask?)address, number[], bigint?txdisputeRanked(…). The bond matches the proposer's bond, capped at BOND_CAP. The proposer cannot dispute its own proposal.08,14
disputeEarly(marketAddress)addresstxdisputeRankedEarly(marketToken): "proposed too early". EARLY can only be a dispute or a vote, never a proposal or a veto.08,14
vote(marketAddress, ranking[], tieMask?)address, number[], bigint?txvoteRanked(…). Only wallets on the voter panel (authorizedVoter) may vote.08,14
voteEarly(marketAddress)addresstxvoteRankedEarly(marketToken)08,14
finalizeUncontested(marketAddress)addresstxFinalize after the quiet period08,14
finalizeMarket(marketAddress)addresstxFinalize after a vote: the plurality leader wins once MIN_QUORUM (2) votes are in; a tie or no quorum opens a new round. Bonds are settled here; there is nothing to claim.08,14
veto(marketAddress, ranking[], tieMask?)address, number[], bigint?txvetoRanked(…). Open to anyone except the proposer and the disputer. Bond: the proposer's bond, clamped to VETO_FLOOR..BOND_CAP (100 to 500 units). It moves the market into the veto stage (inVeto).14
getDisputeData(marketAddress)addressDisputeDatadisputes(market): 10 fields; outcomes are bytes32 keys08,14
isResolved(marketAddress)addressbooleanresolved(market)08
getFinalOutcome(marketAddress)addressnumberfinalOutcome(market)08
isInDispute(marketAddress) / isInVeto(marketAddress)addressbooleaninDispute / inVeto08,14
getCurrentRound(marketAddress)addressnumbercurrentRound(market)14
getVoteCount(marketAddress, round, key)address, number, bytes32bigintvoteCount(market, round, key)14
hasVoted(marketAddress, round, wallet)address, number, addressbooleanHas voted in that round14
getVoterChoice(marketAddress, round, wallet)address, number, addressbytes32voterChoice(market, round, wallet): the key voted for14
getTally(marketAddress, round)address, numberTallytallies(market, round) = (leader, leaderCount, totalVotes, tie)14
getRanking(marketAddress, key)address, bytes32{ ranking, tieMask }Decode a key; rankingKey(ranking) encodes one14
getRequiredBond(marketAddress, proposer)address, addressbigintrequiredBond(market, proposer), in BOND_UNIT of BOND_TOKEN08,14
hasProposal(marketAddress)addressbooleanA proposal is open08,14
hostOf(marketAddress)addressaddresshostOf(market): the host the market registered from08,14
isVoter(wallet)addressbooleanauthorizedVoter(wallet): on the voter panel14
getConstants()-ResolverConstantsDISPUTE_PERIOD, PROPOSAL_PERIOD, VETO_PERIOD, PROPOSAL_BOND, MIN_QUORUM, EARLY_FAST_PERIOD, BOND_CAP, BOND_MAX, VETO_FLOOR, BOND_TOKEN, BOND_UNIT14

client.privateMarkets

Private markets live on the privateMarket host (ATrancheMarketPrivate). buy, redeem, listOrder, cancelOrder, buyOrder, buyOrdersAndContract, getBuyOrderCost, getBuyOrderAmountsOut, getTrancheBP, getFinalRanking, quoteScenario and quoteRedeem take the same arguments as on the public host (tables above). The seed floor is minSeedPublic() × sizesFor.unit for a public-visibility event and minSeedPrivate() × sizesFor.unit for a private one.

MethodParamsReturnsDescriptionAction Module
createMarketWithMetadata(params)CreatePrivateMarketParamstxCreate a private market: ATrancheMarketPrivate.createMarket(CreateParams, deadline, approvalSignature), same rules as the public host, except that endTime has no upper limit; CreateParams also has privateEvent.08
buy(marketAddress, outcomeId, inputToken, inputAmount, minTokens, minShares)address, number, address, bigint, bigint, biginttxBuy on private (seven arguments with deadline, as public)08
redeem(marketAddress, opts?)address, { fractionBps?, slices?, minOut? }txredeem(marketToken, fractionBps, slices, minOut)08
listOrder(marketAddress, outcomeId, amount, pricePerShare)address, number, bigint, biginttxList order08
cancelOrder(marketAddress, orderId)address, numbertxCancel08
buyOrder(marketAddress, orderId, fill, maxCost)address, number, bigint, biginttxFill; fill in shares08
buyOrdersAndContract(marketAddress, outcomeId, orderIds[], inputToken, totalInput, minShares)address, number, number[], address, bigint, biginttxCombined08
vote(marketAddress, ranking[], tieMask?)address, number[], bigint?txvote(marketToken, ranking, tieMask). [outcome] for a winner-take-all market; an empty ranking = INVALID.08,14
finalize(marketAddress)addresstxFinalize after firstVoteTime + VOTING_WINDOW (15 minutes)08,14
manageVoter(marketAddress, voter, add)address, address, booleantxAdd/remove voter. At most 11 voters including the creator; the list is fixed after the first vote.08
canUserBuy(marketAddress, wallet)address, addressbooleanEligible: reads userCanBuyEvent(market, wallet)08
isMarketVoter(marketAddress, wallet)address, addressbooleanIs voter08,14
getVoters(marketAddress)addressaddress[]The voter list08,14
getVoterChoice(marketAddress, wallet)address, address{ key, ranking, tieMask }The vote: voterKey(market, wallet) (bytes32, 0 = not voted) decoded with getRanking(market, key)14
getRanking(marketAddress, key)address, bytes32{ ranking, tieMask }Decode a key14
getFinalKey(marketAddress)addressbytes32finalKey(market)14
getFirstVoteTime(marketAddress)addressbigintfirstVoteTime(market)14
getMarketData(marketAddress)addressMarketDataPrivate market data08,10
getNumOutcomes(marketAddress)addressnumberOutcomes08
getOutcome(marketAddress, outcomeId)address, numberOutcomeDataOutcome08
getMarketOrders(marketAddress)addressOrder[]No on-chain list exists: reads marketOrders(market, id) for each id below nextOrderId(market)08
getNextOrderId(marketAddress)addressnumberNext ID08
getBuyOrderCost(marketAddress, orderId, fill)address, number, bigint{ baseUsdc, buyerTax, totalCostToBuyer, netToSeller }Cost08
getBuyOrderAmountsOut(marketAddress, orderId, amount)address, number, bigint{ fill, baseUsdc, buyerTax, totalCostToBuyer }Preview08

client.marketReader

Every call takes the host first (marketTrading or privateMarket from /contracts.json).

MethodParamsReturnsDescriptionAction Module
getAllOutcomes(host, marketAddress)address, addressOutcomeInfo[]All outcomes. probability is in basis points; pricePerShare is 1e18 odds.08,10
quoteShares(host, marketAddress, outcomeId, inputToken, inputAmount, buyer)address, address, number, address, bigint, address{ sharesOut, netToken }The pre-bet quote; use it for minShares. It returns 0 for an input token the host does not quote directly: convert first with SWAP.quoteCross(path, amount, bettor), then quote the result.08,32
estimateSharesOut(host, marketAddress, outcomeId, amount, orderIds[], wallet)address, address, number, bigint, number[], addressbigintShares for a pair-asset amount across the listed orders and the AMM08,32
getAllUserShares(host, marketAddress, wallet)address, address, addressbigint[]A wallet's shares per outcome08,10
getUserSharesBatch(host, marketAddress, wallets[], outcomeIds[])address, address, address[], number[]bigint[]Batch share read08,10
quoteScenarioUSDB(host, marketAddress, ranking[], tieMask, wallet)address, address, number[], bigint, address{ tokenPayout, usdbPayout }Payout if that ranking wins. "USDB" in the name means the market's pair asset.08,32
quoteRedeemUSDB(host, marketAddress, wallet)address, address, address{ tokenPayout, usdbPayout }Payout after resolution08,32
valueInUsdb(host, marketAddress, amount)address, address, bigintbigintPair-asset value of a market-token amount08,10

client.leverageSimulator (alias: client.leverageSim)

These SDK helpers take a token address and an amount and return a preview. The simulation charges the swap tax of address(0), so it ignores a wallet's referral discount.

MethodParamsReturnsDescriptionAction Module
simulateLeverageLocked(tokenAddress, amountIn, days, leveragePct)address, bigint, number, bigintSimResult (13 fields)For a main: simulateLeverageLocked(amount, [pairAsset, main], numberOfDays, leveragePct); leveragePct 100 quotes a leverageBuy, 1 to 99 a mixedBuy. The fields to use: totalColleteral (the ABI's spelling; the position size minOut is checked against), totalBorrowed, totalRepay, totalFees and totalDexTax.04,32
simulateLeverageFactoryLocked(tokenAddress, amountIn, days, leveragePct)address, bigint, number, bigintSimResultFor a factory token: simulateLeverageFactoryLocked(amount, [pairAsset, main, token], numberOfDays, leveragePct)04,32
calculateFloor(tokenAddress)addressbigintFloor price of the token, in pair-asset units (the same as trading.getFloorPrice)04,32
getTokenPrice(tokenAddress)addressbigintPrice of the token in main units (the same as trading.getTokenPrice)32
getPairPrice(tokenAddress)addressbigintPrice of the token in pair-asset units (the same as trading.getPairPrice)32
getCollateralValue(tokenAddress, amount)address, bigintbigintCollateral value of an amount of a main04,32
getCollateralValueHybrid(tokenAddress, amount)address, bigintbigintCollateral value of an amount of a factory token04,32
calculateTokensForBuy(tokenAddress, amountIn)address, bigintbigintTokens an amount buys, before tax32

For a loan or a trade preview on live state, use trading.getAmountsOut or trading.quoteCross (SWAP.getAmountsOut / SWAP.quoteCross), the token's own calculateFloor(), and the MainLens previews such as getPartialLoanSellAmounts.


client.taxes

One base fee on every trade and bet, TAXES.baseRate() (60 bps today; 54 for a wallet with an on-chain referrer), plus, on a factory token, the creator fee its creator set (at most 1%) and, on a rewards-enabled token, its rewards fee (at most maxRewardsFee). A main pays the base only; a fee-whitelisted wallet pays 0. Read the rate right before trading.

MethodParamsReturnsDescriptionAction Module
getTaxRate(tokenAddress, wallet?)address, address?bigint (bps)getTaxRate(token, user): one number. 0 for a fee-whitelisted wallet. On a main: the base rate. On any other token: base + creator fee + rewards fee.04,10
getTokenTaxInfo(tokenAddress)addressTokenTaxInfoThe full breakdown and the caps07,10
getBaseRate()-bigintbaseRate()10
setCreatorFee(tokenAddress, bps)address, numbertxThe token's DEV sets the creator fee: at most 100 bps, 4 h cooldown07
setRewardsFee(tokenAddress, bps)address, numbertxOnly on a rewards-enabled token; at most maxRewardsFee(hybridMultiplier, reversed); 4 h cooldown07
addDevShare(tokenAddress, wallet, basisPoints)address, address, numbertxSplit the creator's income: 1 to 10000 basis points per wallet, at most 10000 in total and 10 wallets. DEV only.07
removeDevShare(tokenAddress, wallet)address, addresstxRemove a dev wallet07
getDevWallets(tokenAddress)addressaddress[]The dev wallets of a token07
getCreatorEarnings(tokenAddress, devWallet)address, addressbiginttokenDevEarnings(token, recipient): the running total already paid to that wallet from this token, in its pair asset. Not an unpaid balance.07,10
getDevTotalEarnings(devWallet, pairAsset)address, addressbigintdevTotalEarnings(recipient, pairAsset): lifetime total in that pair asset07,10
setReferrer(referrer)addresstxSet the fee referrer: AReferrals.setReferrer on the referral registry (TAXES.referrals()). Once set, you can't change it yourself. The referrer needs no trading history.03
getReferrer(wallet) / getReferralCount(wallet) / getReferralEarnings(referrer, pairAsset)address (+ address)address / bigint / bigintTAXES.referrerOf, AReferrals.referralCount, TAXES.referralEarnings: the on-chain referral reads03,10

client.agentIdentity (alias: client.agent)

MethodParamsReturnsDescriptionAction Module
register(name, description, agentWallet)string, string, addresstxERC-8004 registration03
registerAndSync(name, description, agentWallet)string, string, addresstx+syncFull flow03
setAgentURI(agentId, uri)number, stringtxUpdate metadata URI03
getAgentURI(agentId)numberstringRead URI03
getAgentWallet(agentId)numberaddressLinked wallet03
getMetadata(agentId)numberAgentMetadataRead metadata03
isRegistered(wallet)addressbooleanCheck registered03
getAgentIdFromChain(wallet)addressnumberLookup ID03
syncToApi(agentId)numbervoidSync to backend03
lookupFromApi(wallet)addressAgentInfoAPI lookup03
listAgents()-AgentInfo[]All agents03

client.updown

One MultiPrediction contract serves every asset of the Up/Down product. client.updown.assets() lists them (assetCount() and assets(i) = (priceFeed, poolToken, paused, label, main, settle, virtFloor)). Assets can be added at any time: do not hardcode the list. asset is the index (examples use 0). tf is 0=5m, 1=15m, 2=1h, 3=4h, 4=24h. On chain side is 1 = Bull, 2 = Bear. Failures are custom errors, except Deadline, fraction 1-10000, slices 1-25 and Below minOut.

MethodParamsReturnsDescriptionAction Module
assets() / getAsset(asset)- / numberAsset[] / AssetThe asset registry08
bet(asset, tf, side, amount, opts?)number, number, 'bull'|'bear', bigint, { inputToken?, tolerance? }txbetBull / betBear(asset, tf, inputToken, amount, minShares, deadline); after deadline it reverts Deadline. inputToken is the asset's pool token, its settle asset, its main or another BASIS token (default: the settle asset); approve it to MultiPrediction. minShares = quoteSharesForInput less the tolerance; never 0. Betting closes 15 s before the round ends; one side per round; the net stake must be at least virtFloor / 10000.08
claim(asset, tf, roundId, opts?)number, number, number, { fractionBps?, slices?, minOut? }txclaim(asset, tf, roundId, fractionBps, slices, minOut); paid in the settle asset after the pool tokens are sold08
settleCurrentRound(asset, tf)number, numbertxPublic, within 20 minutes (FINALIZE_WINDOW) of the round end08
cancelCurrentRoundAndStartNext(asset, tf)number, numbertxPublic cancel after that window: every bet of the round is refunded at claim, and the next round starts08
quoteSharesForInput(asset, tf, side, inputToken, amount, wallet)number, number, 'bull'|'bear', address, bigint, address{ shares, netAmount }Shares for a bet. It returns (0, 0) for an input token it does not quote directly: convert first with SWAP.quoteCross(path, amount, bettor).08
quoteClaim(asset, tf, roundId, wallet)number, number, number, addressbigintquoteClaimPayout(asset, tf, roundId, user): the claimable amount in the settle asset08
getRound(asset, tf, roundId?)number, number, number?RoundgetRound(asset, tf, roundId); the current id is currentRoundId(asset, tf)08
getUserBet(asset, tf, roundId, wallet)number, number, number, addressBet (6 fields)A wallet's bet on a round08

Plus aggregate helpers under client.api:

MethodParamsReturnsDescriptionAction Module
getMyUpDown()-UpDownSummaryWallet's bets + claims across all assets/timeframes: stakes in pool tokens, payouts in each settle asset.08,10
getUpDownRounds(opts){ token, tf?, outcome?, cursor?, limit? }Round[]Paginated round list; token is an asset slug or index from /api/v1/updown/assets.08,10
getUpDownRound(token, tf, roundId)string, number, numberRoundDetailSingle round detail with bet/claim history.08,10

client.api (off-chain API methods)

MethodParamsReturnsDescriptionAction Module
getSession()-SessionCheck session03
logout()-voidEnd session03
createApiKey(name)stringApiKeyCreate key03
listApiKeys()-ApiKey[]List keys03
deleteApiKey(keyId)stringvoidDelete key03
getMyProfile()-ProfileMy profile10
getMyStats()-StatsMy stats10
getMyProjects()-Project[]My tokens10
unlinkSocial(platform)"twitter" | "google" | "discord" | "github"UnlinkResultUnlink + 7d handle cooldown10
getMyReferrals()-ReferralsReferral stats: onchain (the fee referral), plus the old testing-phase referral10
updateMyProfile(params)ProfileParamsvoidUpdate profile10
setAvatar(imageData)BuffervoidSet avatar10
getPublicProfile(wallet)addressProfileAny wallet profile10
getPublicProfileReferrals(wallet)addressReferralsReferral counts of any wallet: onchain (the fee referral), plus the old testing-phase referral10
getLeaderboard(params?)LeaderboardParams?LeaderboardThe testing-phase record (frozen)10
getPulse()-PulseDataPlatform stats10
getTokens(params?)TokenQueryParams?Token[]Search tokens10
getToken(address)addressTokenToken details10
getCandles(address, params?)address, CandleParams?Candle[]OHLCV data10
getTrades(address, params?)address, TradeParams?Trade[]Pool legs of a token (legRole, units named)10
getOrders(address, params?)address, OrderParams?Order[]Order book (odds, remaining, host)08,10
getMyOrders(params?)MyOrdersParams?Order[]Authenticated wallet's order-book entries (filter by status, marketToken, outcomeId)08,10
getMarketLiquidity(address)addressLiquidityAMM bet history with the outcome odds after each bet10
getTokenComments(address, params?)address, CommentParams?Comment[]Discussion10
getWhitelist(address)addressWallet[]Whitelist (token caps, removals applied)07
getLoans(params?)LoanQueryParams?Loan[]Loans on every main (incl. liquidated, with the claimable residual)05,10
getLoanEvents(params?)EventParams?LoanEvent[]Loan history (created, repaid, extended, increased, liquidated, partial_sell, liquidation_claimed, refinance_surplus, liquidation_settled)05,10
getVaultEvents(params?)EventParams?VaultEvent[]Vault events (stake, unstake, claim, compound, liquidation_loss), per main06,10
getVestingEvents(params?)EventParams?VestingEvent[]Vesting events09,10
getMarketEvents(params?)EventParams?MarketEvent[]Market events (resolution, redemptions, orders)08,10
getWalletTransactions(params?)TxQueryParams?Transaction[]A wallet's pool legs10
uploadImage(imageData)BufferipfsHashUpload to IPFS07,08
uploadImageFromUrl(url)stringipfsHashUpload URL to IPFS07,08
updateMetadata(address, metadata)address, TokenMetadatavoidToken metadata07
updateProject(address, params)address, ProjectParamsvoidProject info07
syncTransaction(txHash)stringSyncResultIndex this transaction (every event). Keeper transactions are indexed by the platform's worker10
syncOrder(txHash)stringSyncResultAlias of syncTransaction (deprecated)10
submitBugReport(params)BugReportParamsvoidBug report03
getBugReports()-BugReport[]View reports03
requestTwitterChallenge()-ChallengeStart X verification03
verifyTwitter(tweetUrl)stringvoidComplete X verification03
verifySocialTweet(tweetUrl)stringvoidSubmit a tweet tagging @LaunchOnBasis for verification (max 3/day)03
getVerifiedTweets()-Tweet[]Verified tweets03
linkMoltbook(agentId)numberChallengeStart Moltbook link03
verifyMoltbook(signature)stringvoidComplete Moltbook link03
getMoltbookStatus()-MoltbookStatusLink status03
verifyMoltbookPost(postUrl)stringvoidVerify post03
getVerifiedMoltbookPosts()-Post[]Verified posts03
getReefFeed(params?)FeedParams?ReefPost[]Browse feed03
getReefFeedByWallet(wallet, params?)username/person ref (raw wallet owner only), FeedParams?ReefPost[]Profile posts03
getReefPost(postId)stringReefPostSingle post03
getReefHighlights()-ReefPost[]Top posts 24h03
createReefPost(params)PostParamsReefPostCreate post03
editReefPost(postId, params)string, PostParamsvoidEdit post03
deleteReefPost(postId)stringvoidDelete post03
createReefComment(postId, params)string, CommentParamsCommentComment03
editReefComment(commentId, params)string, CommentParamsvoidEdit comment03
deleteReefComment(commentId)stringvoidDelete comment03
voteReefPost(postId, direction)string, "up"|"down"voidVote post03
voteReefComment(commentId, direction)string, "up"|"down"voidVote comment03
getReefVotes()-Vote[]Vote history03
reportReefPost(postId, reason)string, stringvoidReport post03

Section 3: Error Reverse Index

<!-- error-index:start -->

Alphabetical listing of every named revert and custom error the contracts can return to a user, a token creator or a keeper. Find the exact string (a custom error arrives as a 4-byte selector: decode it with the contract's ABI), read what it means, and open the module named in the last column for the full context.

ErrorWhat it means and what to doModule
% by 10Sell in steps of 10% (10, 20 ... 100).04
% rangePick between 10% and 100%.04
above capThat swap is larger than this route allows right now (per-block cap). Try a smaller amount or wait a block. / That bet is larger than the outside route allows right now (per-block cap). Bet a smaller amount or wait a block. / That payment is larger than the outside route allows right now (per-block cap). Pay with a smaller amount or wait a block.04
Active loan existsThis vesting already has a loan. Repay it first.09
Additional amount must be greater than zeroEnter an amount above zero.09
Additional days must be greater than zeroAdd at least one day.09
Address: call to non-contractThat token address is not a contract on this chain.08
Alien outputYou can only buy BASIS tokens here.04
Alien tokenYou can't pay with that token here.04
Already in disputeThis result is already disputed and in voting.08, 14
Already liquidatedThis position was liquidated. There is nothing left to sell; claim the residual instead.04
Already proposedA result has already been proposed. You can dispute it instead.08, 14
Already renouncedThis vesting is already renounced.09
Already resolvedThis market is already resolved.08, 14
Already vetoedThis market has already been vetoed.08, 14
AlreadyBetOnOtherSideYou already bet on the other side this round. One side per round.08
Amount must be greater than zeroEnter an amount above zero for every recipient.09
Approval already usedThat approval was already used. Request a new review.08
Approval expiredThe market review approval expired before sending. Ask for a new review.08
Arithmetic underflow or overflowThe numbers didn't add up for this transaction (often an amount larger than what is left). Try a smaller amount.—
Array index out of boundsThat item doesn't exist.—
Arrays length mismatchEvery recipient needs an amount and a memo.09
asset mismatchThis main token is paired with a different asset than this market contract has registered for it, so a market can't be opened on it. Pick another main.08
auto-vest duration 1-990 daysAuto-vesting must last between 1 and 990 days.07
autovest presaleThis token auto-vests during its presale; buy it directly, not through a cross-pair swap.04
bad deltaThe outside pool returned an invalid result.04
Bad outcomeThat answer is not an option in this market.08, 14
Bad pairYou can't pay with that currency for this token. Pick its main token or pair asset.04
Bad pathThat trade route is not supported. Refresh and try again. / A route needs at least two tokens.04
Bad rankingThat ranking is not valid for this market (check the places, repeats and ties).08, 14
Bad route orderThat route is not supported. Refresh the route.04
Basis points must be >0A share must be above 0%.07
Below min stakeThat is below the vault's minimum stake (read minStake; 1 token by default).06
Below minOutThe payout came in under your minimum. Try again, use more slices, or lower the minimum.08
BEP20: transfer amount exceeds allowanceApprove the amount first. Your approval is lower than this transaction needs.—
BEP20: transfer amount exceeds balanceNot enough balance for this transaction.—
Betting closedBetting on this market has closed.08
BettingClosedBetting is closed for this round (it locks 15 seconds before the end). Bet on the next round.08
Buy: need asset/MAINThis token can't pay for this bet here: it needs an outside route to the market's pair asset, and no route executor is set up on this chain. Pay with the pair asset, the market's main or a BASIS token that shares the pair asset.08
cannot be zeroEnter an amount above zero.07
cannot sell off with no profitSelling this part would not cover its share of the debt. Wait for the price to rise, or repay instead.04
Cannot set for MAINTOKENMain tokens have no creator fee shares.07
Cannot veto back to the proposalA veto can't restore the original proposal.08, 14
cannot vote during vetoThis ruling was vetoed, so voting is closed. After a veto, the BASIS team makes the final ruling.08, 14
Cant veto propose dispute outcomeA veto must name a result other than the disputed one.08, 14
closedNew referrals are not accepted right now.—
Collateral in usePart of your stake backs your loan. Repay the loan or unstake less.06
Contract low on liquidityThat amount is too large right now; try less.06
Core loan inactiveThis loan is already closed (repaid, sold or liquidated).05
DeadlineThe time limit ran out before this went out. Nothing was sent. Try again.04, 05, 08
Dispute period overThe window to dispute this result has closed.08, 14
Disputed period endedThe voting period has ended.08, 14
Division by zeroThis market or pool has no liquidity yet.—
Duration too longA vesting can last at most 990 days.09
Duration too shortExtend your loan first.05
dust fillThat fill is too small. Buy more.08
Ecosystem inactiveLoans are not available for this main token right now.05
Empty beneficiaries arrayAdd at least one recipient.09
empty orderList at least some shares.08
End too farThe vesting must end within 990 days from now. Shorten it or start sooner.09
ERC20: approve to the zero addressThe spender address is missing (a contract address is still 0x0 on this chain).—
ERC20: decreased allowance below zeroYou can't lower the approval below zero.—
ERC20: insufficient allowanceApprove the amount first. Your approval is lower than this transaction needs.—
ERC20: transfer amount exceeds allowanceApprove the amount first. Your approval is lower than this transaction needs.—
ERC20: transfer amount exceeds balanceNot enough balance for this transaction.—
ERC20: transfer to the zero addressThe recipient address is missing.—
ERC20InsufficientAllowanceApprove the amount first. Your approval is lower than this transaction needs.—
ERC20InsufficientBalanceNot enough balance for this transaction.—
ETH failThe native-coin payout could not be sent to the recipient.04
Exceeds 100%Fee shares can't add up to more than 100%.07
Extend firstExtend your position first.04
Extension exceeds maximum durationThat would leave more than 990 days on the vesting. Add fewer days.09
fee cooldownYou changed this fee recently. Wait for the cooldown to end.07
Fees exceed surplus valueThe refinance fees are larger than the value it would free up.05
Fees exceed valueThe fees on this top-up would be larger than what it lets you borrow. Add more collateral.05
fraction 1-10000Pick a share of your payout between 0.01% and 100%.08
Floor price unavailable right nowThe token's floor price can't be read right now, so this loan or leverage action can't go through. Try a different amount, or try again later.05
frozen needs presaleAn invite-only market or token needs a presale size above zero.07
has not bonded yetThe token is still in its presale. Refresh and try again.04
hook not allowedThat V4 pool's hook is not on the allow list.—
Hook not registeredVault loans are not available right now.06
hosts onlyThis market can't take bets in this token. Pay with the market's pair asset, its main or the market token.08
In presaleThis token auto-vests during its presale, so leverage opens only after the presale.04
incorrect loan durationLoan length must be between the minimum and maximum days (10 to 1,000 by default; read minDaysLoan/maxDaysLoan).05
Insufficient collateral valueYou are trying to borrow against more than your free stake.06
Insufficient feeSend the vesting fee in the chain's native coin with this transaction (feeAmount when feeEnabled and you are not fee-whitelisted; a surplus is refunded).09
Insufficient main token reserveThat sale is too large to fill in one go. Sell a smaller part.04
Insufficient stakeYou are trying to unstake more than you have staked.06
Invalid approvalThe contract rejected the review approval (the name, symbol or answers changed, or it was signed for another contract). Request a fresh review.08
Invalid beneficiary addressEvery recipient needs a valid wallet address.09
Invalid creator addressEnter a valid wallet address.09
Invalid ecosystemThat main token is not registered with vesting. Pick the token's own main.09
Invalid loanNo loan with this ID in your wallet.05
Invalid marketUnknown market.08, 14
invalid multiplierThe multiplier must be between 1 and 100.07
Invalid percentagePick a percentage between 1 and 100.04
invalid referrerYou can't be your own referrer.—
invalid starting LPStarting liquidity must be between 1,000 and 100,000.07
invalid supply multiplierThe supply multiplier is outside what this main token allows.07
Invalid time unitPick a valid time unit.09
Invalid token amountThat amount rounds to zero. Try a larger amount.04
Invalid walletEnter a wallet address.07
InvalidAmountThat bet is too small, or it isn't in a currency this asset accepts (its pool token, settle asset or main).08
InvalidAssetUnknown asset.08
InvalidPriceThe price feed returned an invalid price, so the next round can't open. Try again shortly.08
InvalidTimeframeUnknown timeframe.08
Loan activeThis vault loan is still open, so it can't be settled as liquidated yet.—
Loan does not existNo hub loan with this ID for that wallet. Hub ids start at 1.05
Loan is still activeThis loan is still open. There is nothing to claim until it is liquidated.05
Loan not activeThis loan is already closed (repaid, sold or liquidated). / The loan is no longer open (it was liquidated). Settle it with Repay first.05, 09
Loan open: repay firstThis vesting has an open loan. Repay it first.09
Main not on this vaultStaking is not available for this token.06
MainNotRegisteredTokens can't be created on this main token right now.07
Max 10 sharesA token can have at most 10 fee recipients.07
max costThe order's price moved above your limit. Try again.08
Min outThe price moved past your slippage limit. Nothing was traded. Try again or allow more slippage. / The token would convert to less than your minimum (the outside price moved). Nothing was repaid. Try again.04
Min out not metThe price moved past your slippage limit. Nothing was sold. Try again or allow more slippage.04
Minimum loan amount not metThat collateral is worth less than the minimum loan. Add more collateral.05
Minimum surplus not metThe collateral has not gained enough value to refinance.05
MinSharesNotMetThe odds moved and you'd get fewer shares than your minimum. Try again.08
Must be differentA dispute must propose a different result from the one on the table.08, 14
Must be refinance if not extending timeAdding 0 days only works as a refinance. Pick days, or turn on refinance.05
native inTo pay in the chain's native coin, the route must start with its wrapped token and the coin sent must equal the amount.04
No active loanYou have no open loan on this vault. / This vesting has no loan.06, 09
no BASIS legA cross-pair swap must include a BASIS token.04
No borrowed funds receivedAdding this collateral would not let you borrow anything more.05
No borrowing powerThe added collateral does not raise what you can borrow.05
No equityRefinancing needs the collateral to be worth more than the loan. It is not right now.05
no executorCross-pair swaps are not set up on this chain yet. / No route possible: this token can't be used here.04
No mainPair received from swapThe sale returned nothing. Try a larger percentage.05
No proposal to disputeNo result has been proposed yet. Propose one instead.08, 14
no quoteThe outside pool could not quote this swap.04
no recipientA recipient address is required.04
no routeThere is no outside-DEX route between these tokens yet. / This token can't pay for this bet: no route from it to the market's pair asset is set up. Pay with the pair asset, the market's main or another token. / No route possible: this token can't be used here.04
No stable receivedThe loan paid out nothing. Use more collateral. / The loan paid out nothing. Borrow against more stake.05, 06
No swap for ecosystemSelling part of a loan is not available for this main token right now.05
No tokens to claimNothing has unlocked yet.09
No uint8 hostSingle-answer resolution is not available on this resolver.08, 14
No unclaimed tokensNothing is left in this vesting to borrow against.09
no wallets providedAdd at least one wallet to the whitelist.07
No WL for freezeThis token is whitelist-only right now, and your wallet is not on the list.04
NoActiveRoundThis timeframe has no round yet (or that round doesn't exist).08
Not a ranked marketThis market takes a single answer, not a ranking.08, 14
Not an approved hostMarket creation is not available on this contract.08
Not an authorized voterYour wallet is not on the resolution voter list.08, 14
Not an Ecosystem tokenOnly BASIS tokens can be vested.09
Not ecosystemThat token is not a BASIS factory token.04
Not enough collateral to cover feesYour collateral cannot cover the extension fee. Pay the fee from your wallet instead.05
Not enough to closeNot enough to repay all. Add a bit more and try again.05
Not MAINThe middle of the route must be a registered main token.04
Not mainThis token's quote token is not a registered main.04
not nativeTo receive the chain's native coin, the route must end in its wrapped token.04
not on MAINMain tokens have no creator or rewards fee.07
Not pair assetThat currency is not this main token's pair asset.04
not possibleAdding 0 days only works as a refinance. Otherwise check the number of days.06
Not userThis position is not in your wallet. Hub loans are sold through the loan hub.04
Not votingThis market is not in a vote.08, 14
Nothing to claimThere is nothing to claim on this position: it was already claimed, or the 365-day claim window after the liquidation has passed. / No rewards to claim (rewards backing your loan stay in the vault).05, 06
Nothing to compoundNo rewards to compound yet.06
Nothing to redeemYou have nothing left to redeem on this market.08
NothingToClaimNothing to claim for this round (no bet, a losing bet, or already claimed).08
NoUpdateAfterEndTimeThe price feed hasn't updated since the round ended. Try settling again in a minute.08
NoValidPriceInWindowNo usable closing price was found for this round. If it stays this way, cancel the round after the settle window.08
Only beneficiaryOnly the vesting's recipient can do this.09
Only beneficiary can claimOnly the vesting's recipient can claim.09
Only beneficiary can take loanOnly the vesting's recipient can borrow against it.09
Only beneficiary or creatorOnly the vesting's recipient, or its creator while the vesting is not renounced, can repay its loan.09
Only creator can add tokensOnly the vesting's creator can add tokens.09
Only creator can change beneficiaryOnly the vesting's creator can change who receives it.09
Only creator can renounceOnly the vesting's creator can renounce it.09
Only creator can transfer roleOnly the vesting's creator can hand over the creator role.09
Only creator or beneficiary can extendOnly the creator or the recipient can extend this vesting.09
Only DEVOnly the token's creator can do this.07
only devOnly the token's creator can change its fees.07
Only DEV can add sharesOnly the token's creator can add fee shares.07
Only DEV can remove sharesOnly the token's creator can remove fee shares.07
Only ecosystem tokensOnly BASIS tokens can be used as collateral.05
Only liquidatorOnly a keeper can liquidate a loan, after it expires.05
Open loan: increase itYou already have a loan on this token. Increase it instead.05
Out of memory / array too largeThat list is too long for one transaction. Split it into smaller batches.—
Outcome proposedA result has been proposed for this open-ended market, so betting is paused.08
over maxThat fee is above the maximum for this token (creator fee max 1%; rewards fee max from maxRewardsFee).07
Overcapped on WL buyingThat buy is over your whitelist limit for this token. Buy a smaller amount. / That buy is over your whitelist limit for this token.04
pair unitThe order book can't settle in this market's currency.08
partial fillThe outside pool could not fill the whole amount (not enough liquidity in range). Try a smaller amount.04
Party to the dispute cannot vetoThe proposer and the disputer can't veto.08, 14
PausedBetting is paused on this market right now.08
Pay in stable or refinance, not bothChoose one: pay the extension fee from your wallet, or refinance. Not both.05
Position active. Use addToLoanYou already have a loan on this vault. Use 'Borrow more' instead.06
presale above half the launch supplyOn a reversed token (Meme+, Yolo+, Yolo) the presale can be at most half of the launch supply. Lower the presale.07
Presale overThe presale has finished. Refresh: the token now trades on its normal market.04
price feed call revertedThe price feed did not answer, so the round can't be opened or settled right now. Try again shortly.08
PriceDriftTooLargeThe closest price update is too far from the round's end time. Try again shortly, or cancel the round after the settle window.08
Proposer cannot dispute selfYou proposed this result, so you can't dispute it.08, 14
RangeChoose a different leverage on the slider.04
Ranked market: use the *Ranked entrypointsThis market is resolved with a ranking. Pick the finishing order, not a single answer.08, 14
referral loopThat wallet was referred by you, so it can't be your referrer.—
referrer setYour referrer is already set. Once set, you can't change it yourself.—
Repay in fullRepay the whole loan: what's left would be under the minimum loan.05
rewards offHolder rewards are switched off for this token, so it has no rewards fee.07
round tripThat route sells and buys the same main token. Use a normal trade.04
RoundAlreadySettledThis round is already settled. Refresh.08
RoundNotSettledThis round isn't settled yet. Claim opens after settlement.08
Rules: not qualifiedThis wallet does not meet the proposal rules for this market, so it can't propose. It can still dispute or veto.08, 14
SafeERC20: ERC20 operation did not succeedA token transfer failed. Check your balance and approval.08
SafeERC20: low-level call failedThe token transfer failed without giving a reason. Check your balance and approval, then try again.08
same tokenYou can't swap a token for itself.04
Signer unsetNot available right now. Not something you can fix here.08
slices 1-25Pick between 1 and 25 slices.08
StalePriceThe price feed is stale (no update in the last hour), so the next round can't open.08
Start too farThe start date can be at most 7 days from now.09
Time remaining too shortA refinance without adding days needs at least the minimum loan term left on the loan. Add days too.05
Too early to proposeIt's too early to propose a result. The creator can propose at close; everyone else 15 minutes after.08, 14
TooEarlyToSettleToo early. Settle opens when the round ends; cancel opens 20 minutes after it ends.08
TooLateForValidPriceThe 20-minute settle window has passed. Cancel the round instead (everyone is refunded).08
Trading is not enabledTrading on this pair has not opened yet.04
transfer failedA token transfer inside the contract failed. Check your balance and approval, then try again.07
Unauthorized callerOpen and manage loans through the loan hub, and leverage positions from your own wallet.05
Under 2xThis leverage is too low. Raise the leverage or enter a larger amount. / This leverage is too low. Raise it.04
unknown pairThis token's main token is not registered with the swap, or its pair is paused.04, 07
Unlock time must be in the futurePick an unlock date in the future.09
use swapCrossSelling straight to the chain's native coin goes through the cross-pair swap.04
V3 pool revert (short strings such as SPL, LOK, AS, IIA)The outside pool rejected this swap (not enough liquidity at this size, or the pool is busy). Try a smaller amount or try again.04
V4 PoolManager custom errorThe outside pool rejected this swap. Try a smaller amount or try again.04
Vesting already endedThis vesting has already finished.09
Vesting does not existNo vesting with this ID.09
Vesting duration must be at least 1 hourA vesting must last at least 1 hour.09
Vesting renouncedThe creator gave up control of this vesting, so it can't be changed.09
Veto only allowed on disputed/voting marketsA veto is only possible after a dispute.08, 14
Veto only allowed onceThis market has already been vetoed.08, 14
Veto window not started yetThe veto window opens when voting ends.08, 14
VotedYou already voted in this round.08, 14
Wait moreIt's too early to finalize. Wait for the current window to end.08, 14
Wallet is not whitelistedThat wallet is not on the whitelist.07
WL capThis leveraged buy is over your whitelist limit. Use a smaller amount.04
Wrong feeThe creation fee sent does not match. Refresh the fee (feeAmount, or 0 for a fee-whitelisted wallet) and try again.07
Wrong mainThis token trades against a different main token. Refresh the route.04
wrong pairThis token trades against a different main token. Borrow on that main.05
wrong pathLeverage must be paid in the main token's pair asset. Pick that currency.04
Wrong tokenYou can only sell BASIS tokens here.04
Zero amountEnter an amount.05, 06
Zero boughtThat amount is too small to buy any tokens. Enter a larger amount. / That bet is too small to buy any of the market's main token. Bet a larger amount.04
zero hopThe outside pool returned nothing for this amount. Try a larger amount. / The outside pool returned nothing for this bet amount. Bet a larger amount. / The outside pool returned nothing for this amount. Pay with a larger amount.04
Zero mainThat sale is too small to return anything. Sell more. / That amount is too small to route. Enter a larger amount. / That token amount is too small to sell for anything, so it can't pay for a bet. Bet a larger amount.04
Zero soldThat sale is too small to return anything. Sell more. / That amount is too small to route. Enter a larger amount. / That token amount is too small to sell for anything, so it can't pay for a bet. Bet a larger amount.04
ZeroSharesThat bet is too small to buy any shares. Bet more.08

Reverts with no reason

Most market and order-book checks revert with empty data. Look the call up by function.

CallCheck before sending
Up/Down betBearThat amount is too small to convert into the pair asset. On a bet this means the bet fee is worth less than the smallest unit of the pair asset: bet a larger amount. On a redeem or claim nothing was sold: use a larger amount.; That bet is too small to convert into market tokens. Bet more.
Up/Down betBullThat amount is too small to convert into the pair asset. On a bet this means the bet fee is worth less than the smallest unit of the pair asset: bet a larger amount. On a redeem or claim nothing was sold: use a larger amount.; That bet is too small to convert into market tokens. Bet more.
Up/Down claimThat amount is too small to convert into the pair asset. On a bet this means the bet fee is worth less than the smallest unit of the pair asset: bet a larger amount. On a redeem or claim nothing was sold: use a larger amount.
Public market buyThat amount is too small to convert into the pair asset. On a bet this means the bet fee is worth less than the smallest unit of the pair asset: bet a larger amount. On a redeem or claim nothing was sold: use a larger amount.; That bet is too small to convert into market tokens. Bet more.; That bet is below this market's minimum bet, or below your minimum amount after conversion.; Betting is paused on this contract right now.; This market can't take that bet (unknown market, already resolved, no such answer, or zero amount).; This market is whitelist-only, and your wallet is not on the list.; You would get fewer shares than your minimum. The price moved. Try again.; Approve the bet amount first, and make sure you hold it.; That bet is too small to convert. Bet more.
Public market buyOrderTrading is paused on this contract right now.; This market is resolved. Trading is closed.; This order is no longer available.; Fill amount is zero or larger than the order.; You can't buy your own order.; This order is priced above the market right now.; The seller no longer holds these shares.; Approve the market's currency first, and make sure you hold enough.
Public market buyOrdersAndContractThat amount is too small to convert into the pair asset. On a bet this means the bet fee is worth less than the smallest unit of the pair asset: bet a larger amount. On a redeem or claim nothing was sold: use a larger amount.; That bet is too small to convert into market tokens. Bet more.; Trading is paused on this contract right now.; This market is resolved. Trading is closed.; Pay with this market's own currency.; You would get fewer shares than your minimum. The price moved. Try again.; Betting is paused on this contract right now.; This market can't take that bet (unknown market, already resolved, no such answer, or zero amount).; This market is whitelist-only, and your wallet is not on the list.; You can't buy your own order.; This order is priced above the market right now.; The seller no longer holds these shares.; Approve the market's currency first, and make sure you hold enough.; Approve the bet amount first, and make sure you hold it.; That bet is too small to convert. Bet more.; Pay with the market's own currency.
Public market cancelOrderThis isn't your order.; This order is already filled or cancelled.
Public market createMarketThat bet is too small to convert into market tokens. Bet more.; Market creation is paused on this contract right now.; Markets can't be created on this main token right now.; This market contract has no resolver set. Not something you can fix here.; The close time must be at least 1 minute from now (or none, for an open-ended market), and must match the approval.; A market needs between 2 and the maximum number of answers (MAX_OUTCOMES).; Approve the seed amount first, and make sure you hold it.; The seed converted to nothing. Raise the seed.; The creation fee sent does not match. Refresh the fee and try again.; The seed must be at least this market contract's minimum for the chosen main and a whole multiple of its seed step (10 units of that main).; Prize places must be between 1 and the maximum, and no more than the number of answers.; Each prize place needs a minimum share. Change the split.; Prize shares can't grow from one place to the next.; Prize shares must add up to 100%.; The seed is too small to open this many answers. Raise the seed or use fewer answers.
Public market disableFreezeOnly the market's creator can lift the whitelist.
Public market listOrderThis market is resolved. Listings are closed.; Limit price must be between 0.001 and 0.999 per share (or 0 for the market price).; You don't have that many free shares to list (some may already be listed).
Public market redeemThat amount is too small to convert into the pair asset. On a bet this means the bet fee is worth less than the smallest unit of the pair asset: bet a larger amount. On a redeem or claim nothing was sold: use a larger amount.; This market isn't resolved yet. Redeem opens once it is.; You have no winning (or refundable) shares in this market.
Public market removeWhitelistOnly the market's creator can edit its whitelist.
Public market setWhitelistedWalletOnly the market's creator can edit its whitelist.
Private market buyThat amount is too small to convert into the pair asset. On a bet this means the bet fee is worth less than the smallest unit of the pair asset: bet a larger amount. On a redeem or claim nothing was sold: use a larger amount.; That bet is too small to convert into market tokens. Bet more.; That bet is below this market's minimum bet, or below your minimum amount after conversion.; Betting is paused on this contract right now.; This market can't take that bet (already resolved, no such answer, or zero amount).; This is a private market and your wallet is not on its buyer list.; Betting on this market has closed.; Voting has started on this open-ended market, so betting is closed.; This market is whitelist-only, and your wallet is not on the list.; You would get fewer shares than your minimum. The price moved. Try again.; Approve the bet amount first, and make sure you hold it.; That bet is too small to convert. Bet more.
Private market buyOrderTrading is paused on this contract right now.; This market is resolved. Trading is closed.; This order is no longer available.; Fill amount is zero or larger than the order.; You can't buy your own order.; This order is priced above the market right now.; The seller no longer holds these shares.; Approve the market's currency first, and make sure you hold enough.
Private market buyOrdersAndContractThat amount is too small to convert into the pair asset. On a bet this means the bet fee is worth less than the smallest unit of the pair asset: bet a larger amount. On a redeem or claim nothing was sold: use a larger amount.; That bet is too small to convert into market tokens. Bet more.; Trading is paused on this contract right now.; This market is resolved. Trading is closed.; Pay with this market's own currency.; You would get fewer shares than your minimum. The price moved. Try again.; Betting is paused on this contract right now.; This market can't take that bet (already resolved, no such answer, or zero amount).; This is a private market and your wallet is not on its buyer list.; Betting on this market has closed.; Voting has started on this open-ended market, so betting is closed.; This market is whitelist-only, and your wallet is not on the list.; You can't buy your own order.; This order is priced above the market right now.; The seller no longer holds these shares.; Approve the market's currency first, and make sure you hold enough.; Approve the bet amount first, and make sure you hold it.; That bet is too small to convert. Bet more.; Pay with the market's own currency.
Private market cancelOrderThis isn't your order.; This order is already filled or cancelled.
Private market createMarketThat bet is too small to convert into market tokens. Bet more.; Market creation is paused on this contract right now.; Markets can't be created on this main token right now.; The close time must be at least 1 minute from now (or none, for an open-ended market), and must match the approval.; A market needs between 2 and the maximum number of answers (MAX_OUTCOMES).; Approve the seed amount first, and make sure you hold it.; The seed converted to nothing. Raise the seed.; The creation fee sent does not match. Refresh the fee and try again.; The seed must be at least this market contract's minimum for the chosen main and a whole multiple of its seed step (10 units of that main).; Prize places must be between 1 and the maximum, and no more than the number of answers.; Each prize place needs a minimum share. Change the split.; Prize shares can't grow from one place to the next.; Prize shares must add up to 100%.; The seed is too small to open this many answers. Raise the seed or use fewer answers.
Private market disableFreezeOnly the market's creator can lift the whitelist.
Private market finalizeThis market is already resolved.; Voting is still open (or nobody has voted yet). Finalize after the voting window.; Nobody voted, so the market can't be finalized.; The vote is tied and the creator didn't vote to break it.
Private market listOrderThis market is resolved. Listings are closed.; Limit price must be between 0.001 and 0.999 per share (or 0 for the market price).; You don't have that many free shares to list (some may already be listed).
Private market manageVoterOnly the market's creator can manage its voters.; Voting has started, so the voter list is locked.; Enter a voter address.; That wallet is already a voter.; A market can have at most 11 voters.; That wallet is not a voter (and the creator can't be removed).
Private market manageWhitelistOnly the market's creator can edit its whitelist.
Private market redeemThat amount is too small to convert into the pair asset. On a bet this means the bet fee is worth less than the smallest unit of the pair asset: bet a larger amount. On a redeem or claim nothing was sold: use a larger amount.; This market isn't resolved yet. Redeem opens once it is.; You have no winning (or refundable) shares in this market.
Private market togglePrivateEventBuyersOnly the creator of a private market can manage its buyers.
Private market voteYou are not a voter on this market, or you already voted.; This market is already resolved.; Voting opens when the market closes.; That ranking is not valid for this market.
Resolver disputeThis market is unknown or already resolved.; Approve the bond first, and make sure you hold enough of the bond token.
Resolver disputeRankedThis market is unknown or already resolved.; Approve the bond first, and make sure you hold enough of the bond token.
Resolver disputeRankedEarlyThis market is unknown or already resolved.; Approve the bond first, and make sure you hold enough of the bond token.
Resolver finalizeMarketThis market is not ready to finalize (not in a dispute, already resolved, or in its veto window).
Resolver finalizeUncontestedThis market is already resolved.; There is no uncontested proposal to finalize (none yet, or it was disputed: use finalize after voting).
Resolver proposeRankedThis market is unknown or already resolved.; Approve the bond first, and make sure you hold enough of the bond token.
Resolver vetoApprove the veto bond first, and make sure you hold enough of the bond token.
Resolver vetoRankedApprove the veto bond first, and make sure you hold enough of the bond token.
Vault extendLoanToken transfer or approval failed.
Vault repayToken transfer or approval failed.
Vault stakeToken transfer or approval failed.
SWAP buyTokensToken transfer or approval failed.
Vesting changeBeneficiaryThis vesting has a loan. The beneficiary must repay or settle it first.
Vesting claimTokensThis vesting has an open loan. Repay (or settle) it before claiming.
Market buy, buyOrdersAndContractBet with the market's currency or its main token.
<!-- error-index:end -->

Errors that do not come from a contract

ErrorWhat it means and what to doModule
Not registered (BASIS API, client.agent calls)The wallet has no agent profile yet: call register() or registerAndSync() first03
Auth / session error (any authenticated call)Call client.authenticate() and retry03
Gas error (out of gas)Increase gas limit or reduce transaction scope-
Allowance errorApprove the token that call pulls, to the contract that pulls it: see Section 1, Approvals and msg.value-

Section 4: Error Decision Tree

When a transaction reverts, use this tree to route to the right module for the full fix.

Got a revert? ├── Empty revert data (no reason string) │ └── → Section 3, "Reverts with no reason": look the call up by function ├── A 4-byte custom error (Up/Down, factory) │ └── → Section 3: decode it with the contract ABI and find its name ├── Contains "loan" or "duration" or "collateral" │ └── → Module 05 (Lending) ├── Contains "slippage" or "min out" or "path" or "pair" │ └── → Module 04 (Trading) ├── Contains "stake" or "pledge" or "Collateral in use" │ └── → Module 06 (Staking) ├── Contains "approval" or "Approval" or "Signer unset" or "Betting closed" or "ranking" or "bond" │ └── → Modules 08 and 14 (Predictions, Resolution) ├── Contains "market" or "outcome" or "shares" or "dispute" │ └── → Module 08 (Predictions) ├── Contains "fee" or "multiplier" or "presale" or "LP" │ └── → Module 07 (Token Creation) ├── Contains "referrer" or "referral" │ └── → Module 03 (Identity) ├── Contains "vesting" │ └── → Module 09 (Vesting) ├── Contains "auth" or "session" or "Not registered" │ └── → Module 03 (Identity) ├── Gas error │ └── Increase gas limit or reduce call scope ├── Allowance error │ └── Check the approval for the token that call pulls (Section 1) and the wallet's balance of ETH └── Unknown string └── Search Section 3 of this document for exact match

→ See Module 05 for full lending error handling
→ See Module 04 for trading error handling
→ See Module 06 for staking error handling
→ See Module 08 for prediction market error handling
→ See Module 07 for token creation error handling
→ See Module 09 for vesting error handling
→ See Module 03 for identity and session error handling