Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

lastcall state

Back to all declarations

usd

*v0.Token

tUSD is the test-USD collateral token. 6 decimals, so one tUSD unit is 1\_000000 and token amounts line up 1:1 with micro-USD price quotes.

Open
OID
009d34…44b1:142
usd details

Inspect pointer

usdLedger

*v0.PrivateLedger

tUSD is the test-USD collateral token. 6 decimals, so one tUSD unit is 1\_000000 and token amounts line up 1:1 with micro-USD price quotes.

Open
OID
009d34…44b1:144
usdLedger details

Inspect pointer

FaucetUSD

func()

FaucetUSD mints 10,000 tUSD to the caller. Open faucet — demo only.

Open
OID
009d34…44b1:7
FaucetUSD details

Inspect func

BalanceUSD

func(owner .uverse.address) int64
Open
OID
009d34…44b1:8
BalanceUSD details

Inspect func

costKey

type

Value

lastcall.costKey

spotCost

map[lastcall.costKey]int64
Open
OID
009d34…44b1:10
spotCost details

Inspect map

addCost

func(owner .uverse.address, ticker string, paid int64)

addCost records the tUSD notional (micro) a buyer paid toward their cost basis.

Open
OID
009d34…44b1:11
addCost details

Inspect func

reduceCost

func(owner .uverse.address, ticker string, sold int64, heldBefore int64)

reduceCost removes the cost of \`sold\` units from a holder whose balance BEFORE the sale was \`heldBefore\`, keeping the average per-share cost unchanged.

Open
OID
009d34…44b1:13
reduceCost details

Inspect func

AvgEntry

func(ticker string, owner .uverse.address) int64

AvgEntry returns the owner's average entry price for ticker in micro-USD per share, or 0 if they hold none.

Open
OID
009d34…44b1:14
AvgEntry details

Inspect func

admin

.uverse.address

Value

<gnolang.StringValue>

updater

.uverse.address

Value

<gnolang.StringValue>

deskAddr

.uverse.address

Value

<gnolang.StringValue>

nextTokID

v0.ID

Value

<zero>

SetAdmin

func(a .uverse.address)
Open
OID
009d34…44b1:21
SetAdmin details

Inspect func

SetUpdater

func(u .uverse.address)
Open
OID
009d34…44b1:22
SetUpdater details

Inspect func

DeskAddress

func() .uverse.address
Open
OID
009d34…44b1:25
DeskAddress details

Inspect func

Price

type

Price is quoted in micro-USD per whole share.

Value

lastcall.Price

prices

map[string]lastcall.Price
Open
OID
009d34…44b1:29
prices details

Inspect map

SetPrice

func(ticker string, value int64, observedAt int64)

SetPrice is pushed by the off-chain bot (updater key) for one ticker.

Open
OID
009d34…44b1:30
SetPrice details

Inspect func

SetPrices

func(quotes string, observedAt int64)

SetPrices stores several quotes in one transaction so the keeper pays one fee per cycle. quotes is "TICKER:microUSD" pairs joined by ','.

Open
OID
009d34…44b1:31
SetPrices details

Inspect func

storePrice

func(ticker string, value int64, observedAt int64)
Open
OID
009d34…44b1:32
storePrice details

Inspect func

GetPrice

func(ticker string) (int64, int64)

GetPrice returns the last quote for a ticker. Panics if unknown.

Open
OID
009d34…44b1:33
GetPrice details

Inspect func

maxPriceAge

untyped bigint

Value

(600 <untyped> bigint)

maxClockSkew

untyped bigint

Value

(60 <untyped> bigint)

maxPrice

untyped bigint

Value

(1000000000000 <untyped> bigint)

IsFresh

func(ticker string) bool

IsFresh reports whether a ticker has a quote young enough to trade against.

Open
OID
009d34…44b1:34
IsFresh details

Inspect func

freshPrice

func(ticker string) int64
Open
OID
009d34…44b1:35
freshPrice details

Inspect func

usdFmt

func(micro int64) string

usdFmt formats micro-USD as a dollar string with two decimals.

Open
OID
009d34…44b1:37
usdFmt details

Inspect func

sharesFmt

func(units int64) string

sharesFmt formats a 6-decimal token amount as a share count.

Open
OID
009d34…44b1:38
sharesFmt details

Inspect func

limitOrder

type

Value

lastcall.limitOrder

limits

map[uint64]*lastcall.limitOrder
Open
OID
009d34…44b1:40
limits details

Inspect map

nextLimitID

uint64

Value

0

PlaceLimit

func(ticker string, isLong bool, size int64, margin int64, limit int64) uint64

PlaceLimit locks \`margin\` + the open fee and queues an order to open a perp when the oracle price reaches \`limit\`. Returns the order id.

Open
OID
009d34…44b1:42
PlaceLimit details

Inspect func

CancelLimit

func(id uint64)

CancelLimit refunds a pending order's locked margin + fee to its owner.

Open
OID
009d34…44b1:44
CancelLimit details

Inspect func

limitReady

func(o *lastcall.limitOrder, mark int64) bool

limitReady reports whether an order's trigger condition holds at \`mark\`: a long fills at or below its limit, a short at or above.

Open
OID
009d34…44b1:45
limitReady details

Inspect func

fillSize

func(o *lastcall.limitOrder, mark int64) int64

fillSize shrinks an order whose notional at the fill price would exceed the leverage its margin allows, so a price gap past the limit still fills.

Open
OID
009d34…44b1:46
fillSize details

Inspect func

TriggerLimit

func(id uint64) uint64

TriggerLimit executes a ready order at the current oracle price, using the locked margin + prepaid fee. Permissionless (keeper / UI). Requires the market open and the trigger reached; panics otherwise so the keeper simply retries later.

Open
OID
009d34…44b1:47
TriggerLimit details

Inspect func

LimitsOf

func(owner .uverse.address) string

LimitsOf returns an owner's pending orders, ';'-joined, fields comma-separated: id,ticker,L|S,size,margin,limit,mark (size/money micro, 6 dp).

Open
OID
009d34…44b1:48
LimitsOf details

Inspect func

AllLimits

func() string

AllLimits lists every pending order for the keeper to scan, ';'-joined: id,ticker,L|S,limit,mark. The keeper triggers the ones whose condition holds.

Open
OID
009d34…44b1:49
AllLimits details

Inspect func

marketOpen

bool

// default open until the updater pushes the real status

Value

true

SetMarketOpen

func(open bool)

SetMarketOpen is pushed by the off-chain updater (bot) from the live market state.

Open
OID
009d34…44b1:51
SetMarketOpen details

Inspect func

IsMarketOpen

func() bool

IsMarketOpen reports whether the desk is accepting new perp opens.

Open
OID
009d34…44b1:53
IsMarketOpen details

Inspect func

maxInt64

uint64

Value

9223372036854775807

mulDiv

func(a int64, b int64, c int64) int64
Open
OID
009d34…44b1:54
mulDiv details

Inspect func

perpFeeBps

untyped bigint

// 0.10% of notional, each side (open + close)

Value

(10 <untyped> bigint)

maxLeverage

untyped bigint

// 10x: notional \<= margin \* 10

Value

(10 <untyped> bigint)

maintBps

untyped bigint

// 10% maintenance: liquidatable when equity \<= 10% of margin

Value

(1000 <untyped> bigint)

minMargin

untyped bigint

// $1 minimum margin, blocks dust

Value

(1000000 <untyped> bigint)

perpMaxNotional

untyped bigint

// $1,000,000 notional cap

Value

(1000000000000 <untyped> bigint)

maxMargin

untyped bigint

Value

(1000000000000 <untyped> bigint)

holdRateBpsYear

untyped bigint

// 10%/yr borrow fee on notional while a position is open

Value

(1000 <untyped> bigint)

secondsYear

untyped bigint

// 365d, for prorating the borrow fee

Value

(31536000 <untyped> bigint)

perp

type

Value

lastcall.perp

perps

map[uint64]*lastcall.perp
Open
OID
009d34…44b1:57
perps details

Inspect map

nextPerpID

uint64

Value

1

mustPerp

func(id uint64) *lastcall.perp
Open
OID
009d34…44b1:59
mustPerp details

Inspect func

perpPnL

func(p *lastcall.perp, mark int64) int64

perpPnL is size \* (mark - entry) / 1e6 for a long, negated for a short.

Open
OID
009d34…44b1:61
perpPnL details

Inspect func

perpEquity

func(p *lastcall.perp, mark int64) int64

equity is the position's margin plus unrealized PnL.

Open
OID
009d34…44b1:62
perpEquity details

Inspect func

liquidatable

func(p *lastcall.perp, mark int64) bool

liquidatable: equity has fallen to the maintenance fraction of the margin.

Open
OID
009d34…44b1:63
liquidatable details

Inspect func

liqPrice

func(p *lastcall.perp) int64

liqPrice is the mark price at which the position becomes liquidatable.

Open
OID
009d34…44b1:64
liqPrice details

Inspect func

assertPerpSize

func(size int64)

assertPerpSize bounds the size so price\*size stays inside int64.

Open
OID
009d34…44b1:65
assertPerpSize details

Inspect func

assertMargin

func(margin int64)
Open
OID
009d34…44b1:66
assertMargin details

Inspect func

OpenPerp

func(ticker string, isLong bool, size int64, margin int64) uint64

OpenPerp opens a long or short on \`ticker\` of \`size\` stock units (6 dp), backed by \`margin\` tUSD micro pulled from the caller (plus the open fee). Market order.

Open
OID
009d34…44b1:67
OpenPerp details

Inspect func

openPositionCore

func(owner .uverse.address, ticker string, isLong bool, size int64, margin int64, price int64, fee int64) uint64

openPositionCore validates and creates a perp, assuming \`margin\`+\`fee\` tUSD are ALREADY in the desk reserve (pulled from the owner by the caller). Shared by market opens (OpenPerp) and limit-order execution (TriggerLimit). A panic here reverts the whole tx, including the funds pull, so nothing is stranded.

Open
OID
009d34…44b1:68
openPositionCore details

Inspect func

ClosePerp

func(id uint64)

ClosePerp closes the caller's own position at the current mark and settles.

Open
OID
009d34…44b1:69
ClosePerp details

Inspect func

ClosePartial

func(id uint64, closeSize int64)

ClosePartial closes \`closeSize\` units (6 dp) of the caller's own position at the current mark, leaving the rest open. Always allowed, even when the market is closed. closeSize == the full size behaves like ClosePerp.

Open
OID
009d34…44b1:70
ClosePartial details

Inspect func

Liquidate

func(id uint64)

Liquidate closes an underwater position. Permissionless: anyone (the desk's keeper bot, or the UI) may call it once the position is at maintenance.

Open
OID
009d34…44b1:71
Liquidate details

Inspect func

holdingFee

func(p *lastcall.perp, now int64) int64

holdingFee is the borrow fee owed to the pool for keeping a position open: holdRateBpsYear of the entry notional, prorated by seconds held. It prices the pool's directional risk over time — the honest substitute for funding on an oracle-mark desk (there is no perp-vs-spot basis to correct, but the pool is still carrying the position). Overflow-safe: perYear \<= 1e11, elapsed clamped.

Open
OID
009d34…44b1:72
holdingFee details

Inspect func

sliceSettle

func(p *lastcall.perp, sz int64, mark int64, now int64) (payout int64, fee int64, hold int64, marginSlice int64)

sliceSettle computes the numbers for closing \`sz\` units of a position at \`mark\`: pro-rata margin, the slice's PnL, the close fee and the borrow fee, and the owner payout (floored at 0). Pure — no transfers — so it is unit-tested directly.

Open
OID
009d34…44b1:73
sliceSettle details

Inspect func

collectedFee

func(p *lastcall.perp, sz int64, mark int64, marginSlice int64, owed int64) int64

collectedFee caps a close's fees at the equity the closed slice still had.

Open
OID
009d34…44b1:74
collectedFee details

Inspect func

closePortion

func(p *lastcall.perp, sz int64, mark int64)

closePortion closes \`sz\` units of the position at \`mark\`: pays the owner the slice payout, routes the fees to the pool, releases the slice's open interest, and shrinks the position (or removes it when \`sz\` is the whole size). Leverage, entry and liq price of the remainder are unchanged (margin and size shrink together).

Open
OID
009d34…44b1:75
closePortion details

Inspect func

settlePerp

func(p *lastcall.perp, mark int64)

settlePerp fully closes and removes the position.

Open
OID
009d34…44b1:76
settlePerp details

Inspect func

PerpsOf

func(owner .uverse.address) string

PerpsOf returns the caller's open positions, one per line, fields comma- separated: id,ticker,L|S,size,entry,margin,mark,pnl,liq,stopLoss,takeProfit. Money and size are integers at 6 dp; mark/pnl/liq are computed live. Stop prices are 0 when unset. Empty string if none.

Open
OID
009d34…44b1:77
PerpsOf details

Inspect func

AllLiquidatable

func() string

AllLiquidatable lists the ids of positions at or below maintenance on a fresh quote, ';'-joined, for the keeper.

Open
OID
009d34…44b1:78
AllLiquidatable details

Inspect func

defaultOICap

untyped bigint

// $250,000 of open notional per side, per market

Value

(250000000000 <untyped> bigint)

skewImpactMaxBps

untyped bigint

// max +/-1.00% skew price impact on entry

Value

(100 <untyped> bigint)

skewScaleK

untyped bigint

// $500,000: net skew at which impact reaches the max

Value

(500000000000 <untyped> bigint)

oiLong

map[string]int64

// open long notional (micro-USD, at entry) per ticker

Open
OID
009d34…44b1:80
oiLong details

Inspect map

oiShort

map[string]int64

// open short notional per ticker

Open
OID
009d34…44b1:82
oiShort details

Inspect map

oiCapOv

map[string]int64

// per-ticker per-side cap override; 0 => default

Open
OID
009d34…44b1:84
oiCapOv details

Inspect map

maxLevOv

map[string]int64

// per-ticker max leverage override; 0 => global maxLeverage

Open
OID
009d34…44b1:86
maxLevOv details

Inspect map

maxLevOf

func(ticker string) int64

maxLevOf is the leverage ceiling for a market: a per-asset override if set, otherwise the global maxLeverage. Overrides may only lower it.

Open
OID
009d34…44b1:89
maxLevOf details

Inspect func

sideOI

func(ticker string, isLong bool) int64
Open
OID
009d34…44b1:90
sideOI details

Inspect func

addOI

func(ticker string, isLong bool, notional int64)
Open
OID
009d34…44b1:91
addOI details

Inspect func

subOI

func(ticker string, isLong bool, notional int64)
Open
OID
009d34…44b1:92
subOI details

Inspect func

SetOICap

func(ticker string, perSide int64)

SetOICap sets the per-side open-interest cap for a market (micro-USD). 0 restores the default.

Open
OID
009d34…44b1:93
SetOICap details

Inspect func

SetMaxLev

func(ticker string, lev int64)

SetMaxLev lowers (never raises) the max leverage for a market. 0 restores the global default.

Open
OID
009d34…44b1:94
SetMaxLev details

Inspect func

OIOf

func(ticker string) string

OIOf returns a market's open-interest state, comma-separated: oiLong,oiShort,capPerSide,maxLev (notional micro-USD; maxLev a plain integer).

Open
OID
009d34…44b1:95
OIOf details

Inspect func

skewImpactBps

func(ticker string, isLong bool, notional int64) int64

skewImpactBps is the entry price impact in bps for opening \`notional\` on \`isLong\`: the opener pays when they deepen the skew and fills at the oracle price when they balance it. A rebate would let an instant round trip profit.

Open
OID
009d34…44b1:96
skewImpactBps details

Inspect func

skewEntry

func(price int64, impBps int64, isLong bool) int64

skewEntry applies a bps impact to the oracle price to get the fill/entry price: a long fills higher and a short fills lower by \`impBps\` (worse when impBps > 0).

Open
OID
009d34…44b1:97
skewEntry details

Inspect func

stock

type

A stock is one synthetic-equity market: a GRC20 token (6 decimals) whose ledger the desk owns, so the desk can mint on Buy and burn on Sell.

Value

lastcall.stock

stocks

map[string]*lastcall.stock
Open
OID
009d34…44b1:99
stocks details

Inspect map

listStock

func(ticker string, name string)
Open
OID
009d34…44b1:111
listStock details

Inspect func

mustStock

func(ticker string) *lastcall.stock
Open
OID
009d34…44b1:112
mustStock details

Inspect func

StockBalance

func(ticker string, owner .uverse.address) int64
Open
OID
009d34…44b1:113
StockBalance details

Inspect func

StockSupply

func(ticker string) int64
Open
OID
009d34…44b1:114
StockSupply details

Inspect func

validateStops

func(p *lastcall.perp, sl int64, tp int64)

validateStops rejects stop prices on the wrong side of the current mark, which would trigger instantly, and keeps SL below TP for a long / above TP for a short. A 0 clears that leg. Prices are micro-USD per share.

Open
OID
009d34…44b1:115
validateStops details

Inspect func

SetStops

func(id uint64, stopLoss int64, takeProfit int64)

SetStops sets, updates or clears the stop-loss and take-profit of the caller's own position. Each price is micro-USD per share; pass 0 to clear that leg.

Open
OID
009d34…44b1:117
SetStops details

Inspect func

stopReady

func(p *lastcall.perp, mark int64) bool

stopReady reports whether a position's stop-loss or take-profit has been reached at \`mark\`. Long: SL when mark \<= SL, TP when mark >= TP. Short: mirrored.

Open
OID
009d34…44b1:118
stopReady details

Inspect func

TriggerStop

func(id uint64)

TriggerStop closes a position whose stop-loss or take-profit has been reached, at the current mark. Permissionless (keeper / UI); panics if no stop is set or not reached, so the keeper simply retries later.

Open
OID
009d34…44b1:119
TriggerStop details

Inspect func

AllStops

func() string

AllStops lists every open position that has a stop set, for the keeper to scan, ';'-joined, fields comma-separated: id,ticker,L|S,stopLoss,takeProfit,mark. The keeper triggers the ones whose condition holds.

Open
OID
009d34…44b1:120
AllStops details

Inspect func

feeBps

untyped bigint

// 0.30% desk fee each side

Value

(30 <untyped> bigint)

bpsDenom

untyped bigint

//

Value

(10000 <untyped> bigint)

microUSD

untyped bigint

// 1 tUSD = 1\_000000 micro; 1 share = 1\_000000 units

Value

(1000000 <untyped> bigint)

minTradeUnits

untyped bigint

// 0.001 share minimum, blocks dust

Value

(1000 <untyped> bigint)

maxTradeUnits

untyped bigint

// 10,000 shares max, keeps price\*amount in int64

Value

(10000000000 <untyped> bigint)

notionalMicroUSD

func(price int64, stockAmount int64) int64

notionalMicroUSD returns price \* stockAmount / 1e6 — the micro-USD value of stockAmount units (6 dp) of a stock quoted at \`price\` micro-USD per share.

Open
OID
009d34…44b1:121
notionalMicroUSD details

Inspect func

assertTradeSize

func(stockAmount int64)
Open
OID
009d34…44b1:123
assertTradeSize details

Inspect func

Buy

func(ticker string, stockAmount int64)

Buy mints stockAmount units (6 dp) of sTicker to the caller and charges tUSD at the desk price plus fee. Caller must already hold enough tUSD.

Open
OID
009d34…44b1:124
Buy details

Inspect func

Sell

func(ticker string, stockAmount int64)

Sell burns stockAmount units of sTicker from the caller and pays tUSD at the desk price minus fee, from the desk reserve.

Open
OID
009d34…44b1:125
Sell details

Inspect func

QuoteBuy

func(ticker string, stockAmount int64) int64

QuoteBuy / QuoteSell are read-only helpers for the UI: the tUSD cost/proceeds of trading stockAmount units at the current price.

Open
OID
009d34…44b1:126
QuoteBuy details

Inspect func

QuoteSell

func(ticker string, stockAmount int64) int64
Open
OID
009d34…44b1:127
QuoteSell details

Inspect func

SeedUSD

func(amount int64)

SeedUSD mints tUSD into the desk reserve so it can pay out on sells and in-the-money perps. Admin only — the desk's bootstrap liquidity.

Open
OID
009d34…44b1:128
SeedUSD details

Inspect func

DeskReserveUSD

func() int64

DeskReserveUSD is the desk's own tUSD balance.

Open
OID
009d34…44b1:129
DeskReserveUSD details

Inspect func

minPoolDeposit

untyped bigint

// $1 minimum, blocks dust shares

Value

(1000000 <untyped> bigint)

poolShares

int64

// total shares outstanding

Value

100000000

poolAssets

int64

// micro-USD the pool is entitled to in the reserve

Value

100000000

poolFeesAll

int64

// cumulative fees ever routed to the pool (metrics)

Value

0

poolBals

map[.uverse.address]int64

// shares held per depositor

Open
OID
009d34…44b1:134
poolBals details

Inspect map

accrueFee

func(fee int64)

accrueFee routes a desk fee into the pool. Called by spot and perp trading. If no one has deposited yet (poolShares == 0) the fee simply stays in the reserve as it did before — there is no one to credit.

Open
OID
009d34…44b1:135
accrueFee details

Inspect func

PoolDeposit

func(amount int64) int64

PoolDeposit pulls \`amount\` tUSD micro from the caller into the desk reserve and mints pool shares at the current share price. Returns the shares minted.

Open
OID
009d34…44b1:137
PoolDeposit details

Inspect func

PoolWithdraw

func(shares int64) int64

PoolWithdraw burns \`shares\` from the caller and pays their pro-rata slice of the pool in tUSD from the desk reserve. Returns the tUSD micro paid out.

Open
OID
009d34…44b1:138
PoolWithdraw details

Inspect func

PoolSharePrice

func() int64

PoolSharePrice is the value of one share in micro-USD, scaled by 1e6 (so a fresh pool reads 1\_000000 == $1.000000 per share). Returns 1e6 when empty.

Open
OID
009d34…44b1:139
PoolSharePrice details

Inspect func

PoolInfo

func() string

PoolInfo returns pool-wide figures, comma-separated: totalShares,poolAssets,feesAll,deskReserve (all micro, 6 dp).

Open
OID
009d34…44b1:140
PoolInfo details

Inspect func

PoolOf

func(owner .uverse.address) string

PoolOf returns one depositor's position, comma-separated: shares,assets where assets is the current tUSD micro value of those shares.

Open
OID
009d34…44b1:141
PoolOf details

Inspect func
usd : *v0.Token Inspect
usdLedger : *v0.PrivateLedger Inspect
initUSD : func() Inspect
FaucetUSD : func() Inspect
BalanceUSD : func(owner .uverse.address) int64 Inspect
costKey : type =lastcall.costKey
spotCost : map[lastcall.costKey]int64 Inspect
addCost : func(owner .uverse.address, ticker string, paid int64) Inspect
reduceCost : func(owner .uverse.address, ticker string, sold int64, heldBefore int64) Inspect
AvgEntry : func(ticker string, owner .uverse.address) int64 Inspect
admin : .uverse.address =<gnolang.StringValue>
updater : .uverse.address =<gnolang.StringValue>
deskAddr : .uverse.address =<gnolang.StringValue>
nextTokID : v0.ID =<zero>
init.14 : func() Inspect
SetAdmin : func(a .uverse.address) Inspect
SetUpdater : func(u .uverse.address) Inspect
Admin : func() .uverse.address Inspect
Updater : func() .uverse.address Inspect
DeskAddress : func() .uverse.address Inspect
assertAdmin : func() Inspect
assertUpdater : func() Inspect
Price : type =lastcall.Price
prices : map[string]lastcall.Price Inspect
SetPrice : func(ticker string, value int64, observedAt int64) Inspect
SetPrices : func(quotes string, observedAt int64) Inspect
storePrice : func(ticker string, value int64, observedAt int64) Inspect
GetPrice : func(ticker string) (int64, int64) Inspect
maxPriceAge : untyped bigint =(600 <untyped> bigint)
maxClockSkew : untyped bigint =(60 <untyped> bigint)
maxPrice : untyped bigint =(1000000000000 <untyped> bigint)
IsFresh : func(ticker string) bool Inspect
freshPrice : func(ticker string) int64 Inspect
Render : func(path string) string Inspect
usdFmt : func(micro int64) string Inspect
sharesFmt : func(units int64) string Inspect
limitOrder : type =lastcall.limitOrder
limits : map[uint64]*lastcall.limitOrder Inspect
nextLimitID : uint64 =0
PlaceLimit : func(ticker string, isLong bool, size int64, margin int64, limit int64) uint64 Inspect
CancelLimit : func(id uint64) Inspect
limitReady : func(o *lastcall.limitOrder, mark int64) bool Inspect
fillSize : func(o *lastcall.limitOrder, mark int64) int64 Inspect
TriggerLimit : func(id uint64) uint64 Inspect
LimitsOf : func(owner .uverse.address) string Inspect
AllLimits : func() string Inspect
marketOpen : bool =true
SetMarketOpen : func(open bool) Inspect
IsMarketOpen : func() bool Inspect
maxInt64 : uint64 =9223372036854775807
mulDiv : func(a int64, b int64, c int64) int64 Inspect
perpFeeBps : untyped bigint =(10 <untyped> bigint)
maxLeverage : untyped bigint =(10 <untyped> bigint)
maintBps : untyped bigint =(1000 <untyped> bigint)
minMargin : untyped bigint =(1000000 <untyped> bigint)
perpMaxNotional : untyped bigint =(1000000000000 <untyped> bigint)
maxMargin : untyped bigint =(1000000000000 <untyped> bigint)
holdRateBpsYear : untyped bigint =(1000 <untyped> bigint)
secondsYear : untyped bigint =(31536000 <untyped> bigint)
perp : type =lastcall.perp
perps : map[uint64]*lastcall.perp Inspect
nextPerpID : uint64 =1
mustPerp : func(id uint64) *lastcall.perp Inspect
perpPnL : func(p *lastcall.perp, mark int64) int64 Inspect
perpEquity : func(p *lastcall.perp, mark int64) int64 Inspect
liquidatable : func(p *lastcall.perp, mark int64) bool Inspect
liqPrice : func(p *lastcall.perp) int64 Inspect
assertPerpSize : func(size int64) Inspect
assertMargin : func(margin int64) Inspect
OpenPerp : func(ticker string, isLong bool, size int64, margin int64) uint64 Inspect
openPositionCore : func(owner .uverse.address, ticker string, isLong bool, size int64, margin int64, price int64, fee int64) uint64 Inspect
ClosePerp : func(id uint64) Inspect
ClosePartial : func(id uint64, closeSize int64) Inspect
Liquidate : func(id uint64) Inspect
holdingFee : func(p *lastcall.perp, now int64) int64 Inspect
sliceSettle : func(p *lastcall.perp, sz int64, mark int64, now int64) (payout int64, fee int64, hold int64, marginSlice int64) Inspect
collectedFee : func(p *lastcall.perp, sz int64, mark int64, marginSlice int64, owed int64) int64 Inspect
closePortion : func(p *lastcall.perp, sz int64, mark int64) Inspect
settlePerp : func(p *lastcall.perp, mark int64) Inspect
PerpsOf : func(owner .uverse.address) string Inspect
AllLiquidatable : func() string Inspect
defaultOICap : untyped bigint =(250000000000 <untyped> bigint)
skewImpactMaxBps : untyped bigint =(100 <untyped> bigint)
skewScaleK : untyped bigint =(500000000000 <untyped> bigint)
oiLong : map[string]int64 Inspect
oiShort : map[string]int64 Inspect
oiCapOv : map[string]int64 Inspect
maxLevOv : map[string]int64 Inspect
oiCap : func(ticker string) int64 Inspect
maxLevOf : func(ticker string) int64 Inspect
sideOI : func(ticker string, isLong bool) int64 Inspect
addOI : func(ticker string, isLong bool, notional int64) Inspect
subOI : func(ticker string, isLong bool, notional int64) Inspect
SetOICap : func(ticker string, perSide int64) Inspect
SetMaxLev : func(ticker string, lev int64) Inspect
OIOf : func(ticker string) string Inspect
skewImpactBps : func(ticker string, isLong bool, notional int64) int64 Inspect
skewEntry : func(price int64, impBps int64, isLong bool) int64 Inspect
stock : type =lastcall.stock
stocks : map[string]*lastcall.stock Inspect
tickers : []string (len=5) Inspect
defaultMarkets : []struct{...} (len=5) Inspect
initStocks : func() Inspect
listStock : func(ticker string, name string) Inspect
mustStock : func(ticker string) *lastcall.stock Inspect
StockBalance : func(ticker string, owner .uverse.address) int64 Inspect
StockSupply : func(ticker string) int64 Inspect
validateStops : func(p *lastcall.perp, sl int64, tp int64) Inspect
SetStops : func(id uint64, stopLoss int64, takeProfit int64) Inspect
stopReady : func(p *lastcall.perp, mark int64) bool Inspect
TriggerStop : func(id uint64) Inspect
AllStops : func() string Inspect
feeBps : untyped bigint =(30 <untyped> bigint)
bpsDenom : untyped bigint =(10000 <untyped> bigint)
microUSD : untyped bigint =(1000000 <untyped> bigint)
minTradeUnits : untyped bigint =(1000 <untyped> bigint)
maxTradeUnits : untyped bigint =(10000000000 <untyped> bigint)
notionalMicroUSD : func(price int64, stockAmount int64) int64 Inspect
assertTradeSize : func(stockAmount int64) Inspect
Buy : func(ticker string, stockAmount int64) Inspect
Sell : func(ticker string, stockAmount int64) Inspect
QuoteBuy : func(ticker string, stockAmount int64) int64 Inspect
QuoteSell : func(ticker string, stockAmount int64) int64 Inspect
SeedUSD : func(amount int64) Inspect
DeskReserveUSD : func() int64 Inspect
minPoolDeposit : untyped bigint =(1000000 <untyped> bigint)
poolShares : int64 =100000000
poolAssets : int64 =100000000
poolFeesAll : int64 =0
poolBals : map[.uverse.address]int64 Inspect
accrueFee : func(fee int64) Inspect
PoolDeposit : func(amount int64) int64 Inspect
PoolWithdraw : func(shares int64) int64 Inspect
PoolSharePrice : func() int64 Inspect
PoolInfo : func() string Inspect
PoolOf : func(owner .uverse.address) string Inspect