Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bean UI: Seed Gauge System Changes #725

Merged
merged 117 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
f8119c7
ui/sdk: add support for dynamic seeds
0xalecks Nov 1, 2023
2b11a27
sdk: add sunrise and updateStalkPerBdvPerSeason calls
0xalecks Nov 6, 2023
f149ade
ui: reload seeds after each season
0xalecks Nov 6, 2023
29e1f9b
ui: updateStalk
0xalecks Nov 6, 2023
1ff4731
Initial BIP39 event schema and handlers
cujowolf Nov 7, 2023
bcde8cc
ui: updateStalk
0xalecks Nov 6, 2023
9ca0d6d
ui: support unripe to ripe convert
0xalecks Nov 14, 2023
e8da405
ui: cleanup
0xalecks Nov 14, 2023
28b0d5a
ui: update convert warning for unripe assets
0xalecks Dec 13, 2023
4ea7bd7
ui: bean:3crv dewhitelist
0xalecks Feb 8, 2024
e9514de
ui: change href in pricebutton
0xalecks Feb 8, 2024
c63d77a
ui: remove sun changes
0xalecks Apr 8, 2024
67c2ec8
ui: update abi
0xalecks Apr 8, 2024
abdaca5
ui: Silo fixes
0xalecks Apr 8, 2024
735719e
ui: fix silo actions tabs
0xalecks Apr 8, 2024
5244561
sdk: multiply stem by 10**6
0xalecks Apr 8, 2024
7cf4020
ui: fix silo
0xalecks Apr 9, 2024
c05c060
subgraph: updated seed gauge events
soilking Apr 9, 2024
ec46607
subgraph: germinating stalk
soilking Apr 9, 2024
487b43b
subgraph: add missing lwSelector assignment
soilking Apr 9, 2024
ad48bb0
subgraph: hourly caseId for field and gauge
soilking Apr 9, 2024
da4659a
subgraph: fix compilation
soilking Apr 9, 2024
dd58485
subgraph: gauge tests
soilking Apr 10, 2024
7fd1c21
subgraph: seed gauge silo hourly/daily snapshots
soilking Apr 10, 2024
d5a764e
subgraph: whitelist settings daily/hourly snapshot for gauge
soilking Apr 10, 2024
ca787ab
subgraph: snapshot entity test
soilking Apr 11, 2024
5e3844b
fix silo whitelist table
uncoolzero Apr 11, 2024
a20dbf2
ui: fix grown stalk calculation
0xalecks Apr 11, 2024
cde8fd2
ui: fix convert confirm bug
0xalecks Apr 11, 2024
8a9caab
Update abi
soilking Apr 12, 2024
b75dbf2
subgraph: modify UpdatedStalkPerBdvPerSeason handler to only update w…
soilking Apr 15, 2024
50b98ce
protocol: update beanstalk abi
0xalecks Apr 12, 2024
a6e44d1
support germinating deposits
0xalecks Apr 13, 2024
ad95910
ui: add footnote about germinating deposits
0xalecks Apr 17, 2024
b82e688
ui: change copy
0xalecks Apr 18, 2024
c1ead06
Add missing event
soilking Apr 8, 2024
51ac15c
Reduce cached vAPY decimal precision
soilking Apr 8, 2024
b6bf50c
Refactor cache loaders
soilking Apr 8, 2024
d065eb2
subgraph: Fix fert vAPY and omit redundant humidity calls
soilking Apr 9, 2024
5af292c
subgraph: bump version
soilking Apr 10, 2024
7c05dc1
ui: fix unrip convert warning logic
0xalecks Apr 19, 2024
e93e4d8
ui: remove bean > bean3crv convert path
0xalecks Apr 19, 2024
4f2e564
bump version
soilking Apr 19, 2024
c7425fc
ui: fix copy
0xalecks Apr 19, 2024
31dcb04
ui: price button fix pool links
0xalecks Apr 19, 2024
0215a85
subgraph: even/odd germinating stalk by user
soilking Apr 20, 2024
81dc6f8
subgraph: gauge apy wip
soilking Apr 20, 2024
e21216a
subgraph: working gauge apy for bean
soilking Apr 22, 2024
4473084
subgraph: minor state adjustment
soilking Apr 22, 2024
71b094f
include germinating in gauge apy
soilking Apr 22, 2024
b70126a
generalized gauge apy calculation
soilking Apr 22, 2024
02a2c8d
Updated bip42 abi
soilking Apr 23, 2024
29b6d8f
remove commented logs
soilking Apr 23, 2024
c8eaa29
Update comment for unripe gauge apy
soilking Apr 23, 2024
a4fbe31
Update gauge handlers for updated events
soilking Apr 23, 2024
cabc4d2
Gauge tests
soilking Apr 23, 2024
d78f502
gauge apy performance improvements
soilking Apr 23, 2024
f706131
Increasing r when thare are no mints
soilking Apr 23, 2024
e9dadf0
gauge vapy inputs
soilking Apr 23, 2024
05025b5
gauge apy entity test
soilking Apr 23, 2024
84618fc
fix to germinating bdv
soilking Apr 23, 2024
7258328
expand test case
soilking Apr 23, 2024
3031580
ui: change copy
0xalecks Apr 18, 2024
5434558
ui: fix unrip convert warning logic
0xalecks Apr 19, 2024
00b55cd
ui: remove bean > bean3crv convert path
0xalecks Apr 19, 2024
5df180b
ui: fix copy
0xalecks Apr 19, 2024
b829866
ui: price button fix pool links
0xalecks Apr 19, 2024
724d18f
subgraph: even/odd germinating stalk by user
soilking Apr 20, 2024
4364935
subgraph: gauge apy wip
soilking Apr 20, 2024
480709e
subgraph: working gauge apy for bean
soilking Apr 22, 2024
53b22ca
subgraph: minor state adjustment
soilking Apr 22, 2024
f6fd460
include germinating in gauge apy
soilking Apr 22, 2024
421d958
generalized gauge apy calculation
soilking Apr 22, 2024
b4260d4
Updated bip42 abi
soilking Apr 23, 2024
8ddbda0
remove commented logs
soilking Apr 23, 2024
9f892db
Update comment for unripe gauge apy
soilking Apr 23, 2024
5025f73
Update gauge handlers for updated events
soilking Apr 23, 2024
d632b95
Gauge tests
soilking Apr 23, 2024
2ac8dc5
gauge apy performance improvements
soilking Apr 23, 2024
cd9cf46
Increasing r when thare are no mints
soilking Apr 23, 2024
ff427df
gauge vapy inputs
soilking Apr 23, 2024
358bfc4
gauge apy entity test
soilking Apr 23, 2024
562e221
fix to germinating bdv
soilking Apr 23, 2024
29a7c6f
expand test case
soilking Apr 23, 2024
c66ea2f
ui: twadeltab for pools in price button
0xalecks Apr 24, 2024
b29a414
comment
soilking Apr 27, 2024
3659a95
update vapy test case
soilking Apr 29, 2024
6d44a69
vapy to include dewhitelisted deposited bdv
soilking Apr 29, 2024
3842b7e
rename grownStalkPerSeason, modify codegen
soilking Apr 30, 2024
6d95e78
comment
soilking Apr 30, 2024
0aaa9e6
Modify gauge vapy to use fixed-point arithmetic for performance impro…
soilking Apr 30, 2024
f4fa984
Add missing whitelist snapshots
soilking Apr 30, 2024
a53b89e
remove unsupported feature (fixme)
soilking May 1, 2024
178ae99
add dewhitelistToken list to silo
soilking May 1, 2024
3ea6595
Alternate siloAsset retrieval without .load
soilking May 1, 2024
2cec204
refactor to bip44
soilking May 1, 2024
51fe2cc
Merge branch 'master' into bip39ui
uncoolzero May 16, 2024
8edbb86
Merge branch 'subgraph-beanstalk2.2.0' into bip39ui
uncoolzero May 16, 2024
2e337cc
Fix unmigrated grown stalk calculations
uncoolzero May 17, 2024
66bd699
update stalk estimation + stacked chart
uncoolzero May 19, 2024
b109289
update graphql queries
uncoolzero May 22, 2024
a759b8c
Merge branch 'master' into bip39ui
uncoolzero May 22, 2024
3d77244
Update codegen-individual.yml
uncoolzero May 22, 2024
e747df6
fix revitalized stalk showing NaN instead of 0
uncoolzero May 22, 2024
764110e
fixed chart rendering before having all the data
uncoolzero May 22, 2024
9c12088
fixed tooltip disappearing after switching charts
uncoolzero May 22, 2024
63f12c4
update endpoints
uncoolzero May 22, 2024
6108f33
interpolation updates + minor tweaks
uncoolzero May 22, 2024
f6fd2af
Merge branch 'bean-ui-unmigrated-grown-stalk-fixes' into bip39ui
uncoolzero May 22, 2024
9d86de8
small bugfixes
uncoolzero May 22, 2024
c02b8a6
cleanup
uncoolzero May 22, 2024
d6739d3
more cleaning
uncoolzero May 22, 2024
2ec9aab
mr clean
uncoolzero May 22, 2024
6591c12
cleanup
uncoolzero May 22, 2024
68e4ba8
revert codegen-individual.yml
uncoolzero May 22, 2024
6e5685b
fix type errors, restore codegen-individual.yml
uncoolzero May 22, 2024
61d1f8e
actions run subgraph test on changes to core
soilking May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.subgraph-basin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [opened, synchronize]
paths:
- "projects/subgraph-basin/**"
- "projects/subgraph-core/**"

jobs:
compile:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.subgraph-bean.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [opened, synchronize]
paths:
- "projects/subgraph-bean/**"
- "projects/subgraph-core/**"

jobs:
compile:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.subgraph-beanft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [opened, synchronize]
paths:
- "projects/subgraph-beanft/**"
- "projects/subgraph-core/**"

jobs:
compile:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.subgraph-beanstalk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [opened, synchronize]
paths:
- "projects/subgraph-beanstalk/**"
- "projects/subgraph-core/**"

jobs:
compile:
Expand Down
2 changes: 1 addition & 1 deletion projects/cli/src/commands/setbalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const setbalance = async (sdk, chain, { account, symbol, amount }) => {
if (!symbol) {
await chain.setAllBalances(account, amount);
} else {
const symbols = ["ETH", "WETH", "BEAN", "USDT", "USDC", "DAI", "3CRV", "BEAN3CRV", "BEANWETH", "urBEAN", "urBEANWETH", "ROOT"];
const symbols = ["ETH", "WETH", "BEAN", "USDT", "USDC", "DAI", "CRV3", "BEAN3CRV", "BEANWETH", "urBEAN", "urBEANWETH", "ROOT"];
if (!symbols.includes(symbol)) {
console.log(`${chalk.bold.red("Error")} - ${chalk.bold.white(symbol)} is not a valid token. Valid options are: `);
console.log(symbols.map((s) => chalk.green(s)).join(", "));
Expand Down
20 changes: 13 additions & 7 deletions projects/examples/src/silo/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,28 @@ main().catch((e) => {
console.log(e);
});

let sdk:BeanstalkSDK;
let sdk: BeanstalkSDK;

async function main() {
const account = process.argv[3] || _account;
console.log(`${chalk.bold.whiteBright("Account:")} ${chalk.greenBright(account)}`);
let { sdk: _sdk, stop } = await impersonate(account);
sdk = _sdk;
sdk.DEBUG = false;
await sdk.refresh();
// const fromToken = sdk.tokens.UNRIPE_BEAN_WETH;
// const toToken = sdk.tokens.BEAN_ETH_WELL_LP;
const fromToken = sdk.tokens.UNRIPE_BEAN;
const toToken = sdk.tokens.BEAN;


const fromToken = sdk.tokens.BEAN
const toToken = sdk.tokens.UNRIPE_BEAN
const amount = fromToken.amount(2500)
const maxConvert = await sdk.contracts.beanstalk.getMaxAmountIn(fromToken.address, toToken.address);

let tx = await sdk.silo.convert(fromToken, toToken, amount)
const amount = fromToken.amount(1000);
const quote = await sdk.contracts.beanstalk.getAmountOut(fromToken.address, toToken.address, amount.toBlockchain());
console.log(quote.toString());

let tx = await sdk.silo.convert(fromToken, toToken, amount);
await tx.wait();

await stop();
}
6 changes: 4 additions & 2 deletions projects/sdk/src/classes/Token/Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare module "@beanstalk/sdk-core" {
abstract class Token {
static _source: string;
isUnripe: boolean;
rewards?: { stalk: TokenValue; seeds: TokenValue };
rewards?: { stalk: TokenValue; seeds: TokenValue | null };
getStalk(bdv?: TokenValue): TokenValue;
getSeeds(bdv?: TokenValue): TokenValue;
approveBeanstalk(amount: TokenValue | BigNumber): Promise<ContractTransaction>;
Expand All @@ -34,7 +34,9 @@ CoreToken.prototype.getStalk = function (bdv?: TokenValue): TokenValue {
* Get the amount of Seeds rewarded per deposited BDV of this Token.
* */
CoreToken.prototype.getSeeds = function (bdv?: TokenValue): TokenValue {
if (!this.rewards?.seeds) return TokenValue.fromHuman(0, SEED_DECIMALS);
if (this.rewards?.seeds === undefined || this.rewards.seeds === null) {
throw new Error(`Token ${this.symbol} has no seeds defined!`);
}
if (!bdv) return this.rewards.seeds;

return this.rewards.seeds.mul(bdv);
Expand Down
15 changes: 15 additions & 0 deletions projects/sdk/src/lib/BeanstalkSDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class BeanstalkSDK {
public providerOrSigner: Signer | Provider;
public source: DataSource;
public subgraphUrl: string;
public lastRefreshTimestamp: number;

public readonly chainId: ChainId;
public readonly addresses: typeof addresses;
Expand Down Expand Up @@ -99,6 +100,19 @@ export class BeanstalkSDK {
this.wells = new WellsSDK(config);
}

/**
* Refreshes the SDK's state with updated data from contracts. This should be called immediately after sdk initialization and after every season
*/
async refresh() {
// Reload dynamic stalk per wl token
const whitelist = this.tokens.siloWhitelist;
for await (const token of whitelist) {
const { stalkEarnedPerSeason } = await this.contracts.beanstalk.tokenSettings(token.address);
token.rewards!.seeds = this.tokens.SEEDS.fromBlockchain(stalkEarnedPerSeason);
}
this.lastRefreshTimestamp = Date.now();
}

debug(...args: any[]) {
if (!this.DEBUG) return;
console.debug(...args);
Expand Down Expand Up @@ -167,6 +181,7 @@ export class BeanstalkSDK {
toJSON() {
return {
chainId: this.chainId,
lastRefreshTimestamp: this.lastRefreshTimestamp,
provider: {
url: this.provider?.connection?.url,
network: this.provider?._network
Expand Down
25 changes: 14 additions & 11 deletions projects/sdk/src/lib/events/processor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ const account = "0xFARMER";
* and not the indices; this is more for consistency.
*/
const propArray = (o: { [key: string]: any }) =>
Object.keys(o).reduce((prev, key) => {
prev[prev.length] = o[key];
prev[key] = o[key];
return prev;
}, [] as (keyof typeof o)[] & typeof o);
Object.keys(o).reduce(
(prev, key) => {
prev[prev.length] = o[key];
prev[key] = o[key];
return prev;
},
[] as (keyof typeof o)[] & typeof o
);

const mockProcessor = () => new EventProcessor(sdk, account);

Expand Down Expand Up @@ -205,8 +208,8 @@ describe("the Silo", () => {
bdv: bdv1
})
} as AddDepositEvent);

expect(p.deposits.get(Bean)?.["6074"]).toStrictEqual({
const t = p.deposits.get(Bean);
expect(p.deposits.get(Bean)?.["6074000000"]).toStrictEqual({
amount: amount1,
bdv: bdv1
});
Expand All @@ -225,7 +228,7 @@ describe("the Silo", () => {
})
} as AddDepositEvent);

expect(p.deposits.get(Bean)?.["6074"]).toStrictEqual({
expect(p.deposits.get(Bean)?.["6074000000"]).toStrictEqual({
amount: amount1.add(amount2),
bdv: bdv1.add(bdv2)
});
Expand All @@ -244,7 +247,7 @@ describe("the Silo", () => {
})
} as AddDepositEvent);

expect(p.deposits.get(BeanCrv3)?.["6100"]).toStrictEqual({
expect(p.deposits.get(BeanCrv3)?.["6100000000"]).toStrictEqual({
amount: amount3,
bdv: bdv3
});
Expand Down Expand Up @@ -281,7 +284,7 @@ describe("the Silo", () => {
})
} as RemoveDepositEvent);

expect(p.deposits.get(Bean)?.["6074"]).toStrictEqual({
expect(p.deposits.get(Bean)?.["6074000000"]).toStrictEqual({
amount: amount1.sub(amount2),
bdv: bdv1.sub(bdv2)
});
Expand All @@ -300,7 +303,7 @@ describe("the Silo", () => {
})
} as RemoveDepositEvent);

expect(p.deposits.get(Bean)?.["6074"]).toBeUndefined();
expect(p.deposits.get(Bean)?.["6074000000"]).toBeUndefined();
});
});

Expand Down
15 changes: 12 additions & 3 deletions projects/sdk/src/lib/events/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { BeanstalkSDK } from "../BeanstalkSDK";
import { EventManager } from "src/lib/events/EventManager";
import { ZERO_BN } from "src/constants";
import { TokenValue } from "@beanstalk/sdk-core";

// ----------------------------------------

Expand Down Expand Up @@ -394,7 +395,7 @@ export class EventProcessor {

AddDeposit(event: EventManager.Simplify<AddDepositEvent>) {
const token = this.getToken(event);
const stem = event.args.stem.toString();
const stem = this.migrateStem(event.args.stem);

if (!this.whitelist.has(token)) throw new Error(`Attempted to process an event with an unknown token: ${token}`);

Expand All @@ -407,14 +408,22 @@ export class EventProcessor {

RemoveDeposit(event: EventManager.Simplify<RemoveDepositEvent>) {
const token = this.getToken(event);
const stem = event.args.stem.toString();
const stem = this.migrateStem(event.args.stem);
this._removeDeposit(stem, token, event.args.amount);
}

RemoveDeposits(event: EventManager.Simplify<RemoveDepositsEvent>) {
const token = this.getToken(event);
event.args.stems.forEach((stem, index) => {
this._removeDeposit(stem.toString(), token, event.args.amounts[index]);
this._removeDeposit(this.migrateStem(stem), token, event.args.amounts[index]);
});
}

migrateStem(stem: ethers.BigNumber): string {
let stemTV = TokenValue.fromBlockchain(stem, 0);
if (stemTV.abs().lt(10 ** 6)) stemTV = stemTV.mul(10 ** 6);
const migratedStem = stemTV.toHuman();

return migratedStem;
}
}
25 changes: 0 additions & 25 deletions projects/sdk/src/lib/root.test.ts

This file was deleted.

44 changes: 31 additions & 13 deletions projects/sdk/src/lib/silo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ export class Silo {
options?: { source: DataSource.LEDGER } | { source: DataSource.SUBGRAPH }
): Promise<TokenSiloBalance> {
const source = Silo.sdk.deriveConfig("source", options);
const [account, currentSeason, stemTip] = await Promise.all([
const [account, currentSeason, stemTip, germinatingStem] = await Promise.all([
Silo.sdk.getAccount(_account),
Silo.sdk.sun.getSeason(),
this.getStemTip(_token)
this.getStemTip(_token),
Silo.sdk.contracts.beanstalk.getGerminatingStem(_token.address)
]);

if (!Silo.sdk.tokens.siloWhitelist.has(_token)) throw new Error(`${_token.address} is not whitelisted in the Silo`);
Expand All @@ -212,7 +213,8 @@ export class Silo {
utils.applyDeposit(balance, _token, stemTip, {
stem,
amount: deposits[stem].amount,
bdv: deposits[stem].bdv
bdv: deposits[stem].bdv,
germinatingStem
});
}

Expand All @@ -237,7 +239,8 @@ export class Silo {
utils.applyDeposit(balance, _token, stemTip, {
stem: deposit.season, // FIXME
amount: deposit.amount,
bdv: deposit.bdv
bdv: deposit.bdv,
germinatingStem
})
);

Expand All @@ -262,17 +265,25 @@ export class Silo {
_account?: string,
options?: { source: DataSource.LEDGER } | { source: DataSource.SUBGRAPH }
): Promise<Map<Token, TokenSiloBalance>> {
/// SETUP
const whitelist = Silo.sdk.tokens.siloWhitelist;
const whiteListTokens = Array.from(whitelist);
const balances = new Map<Token, TokenSiloBalance>();
whitelist.forEach((token) => balances.set(token, utils.makeTokenSiloBalance()));
const source = Silo.sdk.deriveConfig("source", options);
const [account, currentSeason, stemTips] = await Promise.all([

const [account, currentSeason, stemTips, germinatingStemsRaw] = await Promise.all([
Silo.sdk.getAccount(_account),
Silo.sdk.sun.getSeason(),
this.getStemTips([...Silo.sdk.tokens.siloWhitelist])
this.getStemTips([...Silo.sdk.tokens.siloWhitelist]),
Silo.sdk.contracts.beanstalk.getGerminatingStems(whiteListTokens.map((t) => t.address))
]);

/// SETUP
const whitelist = Silo.sdk.tokens.siloWhitelist;
const balances = new Map<Token, TokenSiloBalance>();
whitelist.forEach((token) => balances.set(token, utils.makeTokenSiloBalance()));
// Set germinatingStems
const germinatingStems = new Map<Token, BigNumber>();
for (let i = 0; i < germinatingStemsRaw.length; i++) {
germinatingStems.set(whiteListTokens[i], germinatingStemsRaw[i]);
}

/// LEDGER
if (source === DataSource.LEDGER) {
Expand All @@ -283,6 +294,9 @@ export class Silo {
// Handle deposits.
// Attach stalk & seed counts for each crate.
depositsByToken.forEach((deposits, token) => {
const germinatingStem = germinatingStems.get(token)!;
if (!germinatingStem) throw new Error(`No germinatingStem found for ${token.symbol}`);

// If we receive a token that wasn't on the SDK's known whitelist, create
// a new balance object for it. (This shouldn't happen)
if (!balances.has(token)) balances.set(token, utils.makeTokenSiloBalance());
Expand All @@ -296,7 +310,8 @@ export class Silo {
utils.applyDeposit(balance, token, stemTip, {
stem,
amount: deposits[stem].amount,
bdv: deposits[stem].bdv
bdv: deposits[stem].bdv,
germinatingStem
});
}

Expand All @@ -319,9 +334,11 @@ export class Silo {
const { deposited } = query.farmer;

// Handle deposits.
deposited.forEach((deposit: typeof deposited[number]) => {
deposited.forEach((deposit: (typeof deposited)[number]) => {
const token = Silo.sdk.tokens.findByAddress(deposit.token);
if (!token) return; // FIXME: unknown token handling
const germinatingStem = germinatingStems.get(token)!;
if (!germinatingStem) throw new Error(`No germinatingStem found for ${token.symbol}`);

// If we receive a token that wasn't on the SDK's known whitelist, create
// a new balance object for it. (This shouldn't happen)
Expand All @@ -335,7 +352,8 @@ export class Silo {
utils.applyDeposit(balance, token, stemTip, {
stem: deposit.stem || deposit.season,
amount: deposit.amount,
bdv: deposit.bdv
bdv: deposit.bdv,
germinatingStem
});
});

Expand Down
Loading
Loading