getTradeEarnings

Returns a user's potential earnings for each outcome in a market (doesn't subtract fee's and doesn't take outcome governance participation into account, for total earnings refer to getClaimable)

Example

const earnings = await flux.getTradeEarnings(
0, // marketId
"alice" // accountId
);

Parameters

Parameter

Type

Description

Required

marketId

number

The id of a specific market

True

accountId

string

The accountId the earnings amount needs to be calculated for. Will default to the signed in account.

False

Returns

Name

Type

Description

earnings

Promise<Object<outcome, earnings>>

Returns a promise that to an objcet that maps outcomes to potential earnings, denominated in 1e18