Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
BalanceGuaranteedSwap Class Reference

Serializable Balance Guaranteed Swap. More...

#include <ored/portfolio/balanceguaranteedswap.hpp>

+ Inheritance diagram for BalanceGuaranteedSwap:
+ Collaboration diagram for BalanceGuaranteedSwap:

Public Member Functions

 BalanceGuaranteedSwap ()
 
 BalanceGuaranteedSwap (const ore::data::Envelope &env, const std::string &referenceSecurity, const std::vector< BGSTrancheData > &tranches, const ore::data::Schedule schedule, const std::vector< ore::data::LegData > &swap)
 
void build (const QuantLib::ext::shared_ptr< ore::data::EngineFactory > &) override
 
Inspectors
const std::string & referenceSecurity () const
 
const std::vector< BGSTrancheData > & tranches () const
 
const ore::data::ScheduleData schedule () const
 
const std::vector< ore::data::LegData > & swap () const
 
- Public Member Functions inherited from Trade
 Trade ()
 Default constructor. More...
 
 Trade (const string &tradeType, const Envelope &env=Envelope(), const TradeActions &ta=TradeActions())
 Base class constructor. More...
 
virtual ~Trade ()
 Default destructor. More...
 
virtual void build (const QuantLib::ext::shared_ptr< EngineFactory > &)=0
 
virtual std::map< std::string, RequiredFixings::FixingDatesfixings (const QuantLib::Date &settlementDate=QuantLib::Date()) const
 
const RequiredFixingsrequiredFixings () const
 
virtual std::map< AssetClass, std::set< std::string > > underlyingIndices (const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager=nullptr) const
 
void reset ()
 Reset trade, clear all base class data. This does not reset accumulated timings for this trade. More...
 
void resetPricingStats (const std::size_t numberOfPricings=0, const boost::timer::nanosecond_type cumulativePricingTime=0)
 Reset accumulated timings to given values. More...
 
string & id ()
 Set the trade id. More...
 
void setEnvelope (const Envelope &envelope)
 Set the envelope with counterparty and portfolio info. More...
 
void setAdditionalData (const std::map< std::string, boost::any > &additionalData)
 
TradeActionstradeActions ()
 Set the trade actions. More...
 
const string & id () const
 
const string & tradeType () const
 
const Envelopeenvelope () const
 
const set< string > & portfolioIds () const
 
const TradeActionstradeActions () const
 
const QuantLib::ext::shared_ptr< InstrumentWrapper > & instrument () const
 
const std::vector< QuantLib::Leg > & legs () const
 
const std::vector< string > & legCurrencies () const
 
const std::vector< bool > & legPayers () const
 
const string & npvCurrency () const
 
virtual QuantLib::Real notional () const
 Return the current notional in npvCurrency. See individual sub-classes for the precise definition. More...
 
virtual string notionalCurrency () const
 
const Date & maturity () const
 
virtual bool isExpired (const Date &d)
 
const string & issuer () const
 
template<typename T >
additionalDatum (const std::string &tag) const
 returns any additional datum. More...
 
virtual const std::map< std::string, boost::any > & additionalData () const
 returns all additional data returned by the trade once built More...
 
const std::string & sensitivityTemplate () const
 
void validate () const
 Utility to validate that everything that needs to be set in this base class is actually set. More...
 
virtual bool hasCashflows () const
 
boost::timer::nanosecond_type getCumulativePricingTime () const
 Get cumulative timing spent on pricing. More...
 
std::size_t getNumberOfPricings () const
 Get number of pricings. More...
 
- Public Member Functions inherited from XMLSerializable
virtual ~XMLSerializable ()
 
virtual void fromXML (XMLNode *node)=0
 
virtual XMLNodetoXML (XMLDocument &doc) const =0
 
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename) const
 
void fromXMLString (const std::string &xml)
 Parse from XML string. More...
 
std::string toXMLString () const
 Parse from XML string. More...
 

Serialisation

std::string referenceSecurity_
 
std::vector< BGSTrancheDatatranches_
 
ore::data::ScheduleData schedule_
 
std::vector< ore::data::LegDataswap_
 
virtual void fromXML (ore::data::XMLNode *node) override
 
virtual ore::data::XMLNodetoXML (ore::data::XMLDocument &doc) const override
 
std::map< ore::data::AssetClass, std::set< std::string > > underlyingIndices (const QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > &) const override
 

Additional Inherited Members

- Protected Member Functions inherited from Trade
Date addPremiums (std::vector< QuantLib::ext::shared_ptr< Instrument > > &instruments, std::vector< Real > &multipliers, const Real tradeMultiplier, const PremiumData &premiumData, const Real premiumMultiplier, const Currency &tradeCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &factory, const string &configuration)
 
void setLegBasedAdditionalData (const Size legNo, Size resultLegId=Null< Size >()) const
 
void setSensitivityTemplate (const EngineBuilder &builder)
 
void setSensitivityTemplate (const std::string &id)
 
- Protected Attributes inherited from Trade
string tradeType_
 
QuantLib::ext::shared_ptr< InstrumentWrapperinstrument_
 
std::vector< QuantLib::Leg > legs_
 
std::vector< string > legCurrencies_
 
std::vector< boollegPayers_
 
string npvCurrency_
 
QuantLib::Real notional_
 
string notionalCurrency_
 
Date maturity_
 
string issuer_
 
string sensitivityTemplate_
 
bool sensitivityTemplateSet_ = false
 
std::size_t savedNumberOfPricings_ = 0
 
boost::timer::nanosecond_type savedCumulativePricingTime_ = 0
 
RequiredFixings requiredFixings_
 
std::map< std::string, boost::any > additionalData_
 

Detailed Description

Serializable Balance Guaranteed Swap.

Definition at line 71 of file balanceguaranteedswap.hpp.

Constructor & Destructor Documentation

◆ BalanceGuaranteedSwap() [1/2]

Definition at line 73 of file balanceguaranteedswap.hpp.

73: Trade("BalanceGuaranteedSwap") {}
Trade()
Default constructor.
Definition: trade.hpp:59

◆ BalanceGuaranteedSwap() [2/2]

BalanceGuaranteedSwap ( const ore::data::Envelope env,
const std::string &  referenceSecurity,
const std::vector< BGSTrancheData > &  tranches,
const ore::data::Schedule  schedule,
const std::vector< ore::data::LegData > &  swap 
)

Definition at line 74 of file balanceguaranteedswap.hpp.

77 : Trade("BalanceGuaranteedSwap", env), referenceSecurity_(referenceSecurity), tranches_(tranches), swap_(swap) {
78 }
const std::string & referenceSecurity() const
std::vector< ore::data::LegData > swap_
std::vector< BGSTrancheData > tranches_
const std::vector< BGSTrancheData > & tranches() const
const std::vector< ore::data::LegData > & swap() const

Member Function Documentation

◆ build()

void build ( const QuantLib::ext::shared_ptr< ore::data::EngineFactory > &  )
override

Definition at line 54 of file balanceguaranteedswap.cpp.

54 {
55
56 LOG("BalanceGuaranteedSwap::build() for id \"" << id() << "\" called.");
57
58 // ISDA taxonomy
59 additionalData_["isdaAssetClass"] = string("Interest Rate");
60 additionalData_["isdaBaseProduct"] = string("Exotic");
61 additionalData_["isdaSubProduct"] = string("");
62 additionalData_["isdaTransaction"] = string("");
63
64 QuantLib::Schedule schedule = makeSchedule(this->schedule());
65
66 std::vector<BGSTrancheData> sortedTranches(tranches());
67 std::sort(sortedTranches.begin(), sortedTranches.end(),
68 [](const BGSTrancheData& x, const BGSTrancheData& y) { return x.seniority() < y.seniority(); });
69 std::vector<std::vector<Real>> trancheNotionals;
70 Size referencedTranche = Null<Size>(), counter = 0;
71 for (auto const& t : sortedTranches) {
72 if (t.securityId() == referenceSecurity()) {
73 QL_REQUIRE(referencedTranche == Null<Size>(),
74 "there is more than one tranche with id \"" << referenceSecurity() << "\"");
75 referencedTranche = counter;
76 }
77 trancheNotionals.push_back(buildScheduledVectorNormalised(t.notionals(), t.notionalDates(), schedule, 0.0));
78 ++counter;
79 }
80 QL_REQUIRE(referencedTranche != Null<Size>(), "referenced tranche not found");
81
82 QL_REQUIRE(swap_.size() == 2, "swap must have 2 legs");
83 QL_REQUIRE(swap_[0].currency() == swap_[1].currency(), "swap must be single currency");
84
85 string ccy_str = swap_[0].currency();
86 Currency currency = parseCurrency(ccy_str);
87
88 Size fixedLegIndex, floatingLegIndex;
89 if (swap_[0].legType() == "Floating" && swap_[1].legType() == "Fixed") {
90 floatingLegIndex = 0;
91 fixedLegIndex = 1;
92 } else if (swap_[1].legType() == "Floating" && swap_[0].legType() == "Fixed") {
93 floatingLegIndex = 1;
94 fixedLegIndex = 0;
95 } else {
96 QL_FAIL("Invalid leg types " << swap_[0].legType() << " + " << swap_[1].legType());
97 }
98
99 QuantLib::ext::shared_ptr<FixedLegData> fixedLegData =
100 QuantLib::ext::dynamic_pointer_cast<FixedLegData>(swap_[fixedLegIndex].concreteLegData());
101 QuantLib::ext::shared_ptr<FloatingLegData> floatingLegData =
102 QuantLib::ext::dynamic_pointer_cast<FloatingLegData>(swap_[floatingLegIndex].concreteLegData());
103
104 QL_REQUIRE(fixedLegData != nullptr, "expected fixed leg data");
105 QL_REQUIRE(floatingLegData != nullptr, "expected floating leg data");
106
107 QuantLib::ext::shared_ptr<EngineBuilder> tmp = engineFactory->builder("BalanceGuaranteedSwap");
108 auto builder = QuantLib::ext::dynamic_pointer_cast<FlexiSwapBGSEngineBuilderBase>(tmp);
109 QL_REQUIRE(builder, "No BGS Builder found for \"" << id() << "\"");
110
111 Schedule fixedSchedule = makeSchedule(swap_[fixedLegIndex].schedule());
112 Schedule floatingSchedule = makeSchedule(swap_[floatingLegIndex].schedule());
113 vector<Real> fixedRate =
114 buildScheduledVectorNormalised(fixedLegData->rates(), fixedLegData->rateDates(), fixedSchedule, 0.0);
115 vector<Real> spreads = buildScheduledVectorNormalised(floatingLegData->spreads(), floatingLegData->spreadDates(),
116 floatingSchedule, 0.0);
117 vector<Real> gearings = buildScheduledVectorNormalised(floatingLegData->gearings(), floatingLegData->gearingDates(),
118 floatingSchedule, 1.0);
119 vector<Real> caps = buildScheduledVectorNormalised(floatingLegData->caps(), floatingLegData->capDates(),
120 floatingSchedule, (Real)Null<Real>());
121 vector<Real> floors = buildScheduledVectorNormalised(floatingLegData->floors(), floatingLegData->floorDates(),
122 floatingSchedule, (Real)Null<Real>());
123 std::string floatingIndex = floatingLegData->index();
124 DayCounter fixedDayCounter = parseDayCounter(swap_[fixedLegIndex].dayCounter());
125 Handle<IborIndex> index =
126 engineFactory->market()->iborIndex(floatingIndex, builder->configuration(MarketContext::pricing));
127 DayCounter floatingDayCounter = parseDayCounter(swap_[floatingLegIndex].dayCounter());
128 BusinessDayConvention paymentConvention = parseBusinessDayConvention(swap_[floatingLegIndex].paymentConvention());
129 VanillaSwap::Type type = swap_[fixedLegIndex].isPayer() ? VanillaSwap::Payer : VanillaSwap::Receiver;
130
131 auto bgSwap = QuantLib::ext::make_shared<QuantExt::BalanceGuaranteedSwap>(
132 type, trancheNotionals, schedule, referencedTranche, fixedSchedule, fixedRate, fixedDayCounter,
133 floatingSchedule, *index, gearings, spreads, caps, floors, floatingDayCounter, paymentConvention);
134
135 auto fixLeg = bgSwap->leg(0);
136 auto fltLeg = bgSwap->leg(1);
137
138 // check that nominal schedule in legs is identical with the one we extracted from the tranche notionals
139 Size legRatio = fltLeg.size() / fixLeg.size(); // no remainder by construction of a bg swap
140 vector<Real> legFixedNominal = buildScheduledVectorNormalised(
141 swap_[fixedLegIndex].notionals(), swap_[fixedLegIndex].notionalDates(), fixedSchedule, 0.0);
142 vector<Real> legFloatingNominal = buildScheduledVectorNormalised(
143 swap_[floatingLegIndex].notionals(), swap_[floatingLegIndex].notionalDates(), floatingSchedule, 0.0);
144 for (Size i = 0; i < legFixedNominal.size(); ++i) {
145 QL_REQUIRE(close_enough(bgSwap->trancheNominal(referencedTranche, fixedSchedule[i]), legFixedNominal[i]),
146 "fixed leg notional at " << i << " (" << legFixedNominal[i] << ") does not match tranche notional ("
147 << bgSwap->trancheNominal(referencedTranche, fixedSchedule[i])
148 << "), referenced tranche is " << referencedTranche);
149 }
150 for (Size i = 0; i < legFloatingNominal.size(); ++i) {
151 // this is how we build the float notional schedule in the BGS internally as well, i.e. derived from the fixed
152 // side
153 QL_REQUIRE(close_enough(legFloatingNominal[i], legFixedNominal[i / legRatio]),
154 "floating leg notional at " << i << " (" << legFloatingNominal[i]
155 << ") does not match fixed leg notional at " << (i / legRatio) << " ("
156 << legFixedNominal[i / legRatio] << ")");
157 }
158
159 // set coupon pricers if needed (for flow report, discounting swap engine, not used in LGM engine)
160
161 bool hasCapsFloors = false;
162 for (auto const& k : caps) {
163 if (k != Null<Real>())
164 hasCapsFloors = true;
165 }
166 for (auto const& k : floors) {
167 if (k != Null<Real>())
168 hasCapsFloors = true;
169 }
170 if (hasCapsFloors) {
171 QuantLib::ext::shared_ptr<EngineBuilder> cfBuilder = engineFactory->builder("CapFlooredIborLeg");
172 QL_REQUIRE(cfBuilder, "No builder found for CapFlooredIborLeg");
173 QuantLib::ext::shared_ptr<CapFlooredIborLegEngineBuilder> cappedFlooredIborBuilder =
174 QuantLib::ext::dynamic_pointer_cast<CapFlooredIborLegEngineBuilder>(cfBuilder);
175 QL_REQUIRE(cappedFlooredIborBuilder != nullptr, "expected CapFlooredIborLegEngineBuilder");
176 QuantLib::ext::shared_ptr<FloatingRateCouponPricer> couponPricer =
177 cappedFlooredIborBuilder->engine(IndexNameTranslator::instance().oreName(index->name()));
178 QuantLib::setCouponPricer(fltLeg, couponPricer);
179 }
180
181 // determine expiries and strikes for calibration basket (simple approach, a la summit)
182
183 std::vector<Date> expiryDates;
184 std::vector<Real> strikes;
185 Date today = Settings::instance().evaluationDate();
186 for (Size i = 0; i < fltLeg.size(); ++i) {
187 auto fltcpn = QuantLib::ext::dynamic_pointer_cast<FloatingRateCoupon>(fltLeg[i]);
188 if (fltcpn != nullptr && fltcpn->fixingDate() > today && i % legRatio == 0) {
189 expiryDates.push_back(fltcpn->fixingDate());
190 auto fixcpn = QuantLib::ext::dynamic_pointer_cast<FixedRateCoupon>(fixLeg[i]);
191 QL_REQUIRE(fixcpn != nullptr, "BalanceGuaranteedSwap Builder: expected fixed rate coupon");
192 strikes.push_back(fixcpn->rate() - fltcpn->spread());
193 }
194 }
195
196 // set pricing engine, init instrument and other trade members
197
198 bgSwap->setPricingEngine(
199 builder->engine(id(), referenceSecurity(), ccy_str, expiryDates, bgSwap->maturityDate(), strikes));
200 setSensitivityTemplate(*builder);
201
202 // add required fixings
203 addToRequiredFixings(fltLeg, QuantLib::ext::make_shared<FixingDateGetter>(requiredFixings_));
204
205 // FIXME this won't work for exposure, currently not supported
206 instrument_ = QuantLib::ext::make_shared<VanillaInstrument>(bgSwap);
207
208 npvCurrency_ = ccy_str;
209 notional_ = std::max(currentNotional(fixLeg), currentNotional(fltLeg));
210 notionalCurrency_ = ccy_str;
211 legCurrencies_ = vector<string>(2, ccy_str);
212 legs_ = {fixLeg, fltLeg};
213 legPayers_ = {swap_[fixedLegIndex].isPayer(), swap_[floatingLegIndex].isPayer()};
214 maturity_ = bgSwap->maturityDate();
215}
const ore::data::ScheduleData schedule() const
string npvCurrency_
Definition: trade.hpp:201
std::vector< bool > legPayers_
Definition: trade.hpp:200
std::vector< string > legCurrencies_
Definition: trade.hpp:199
std::vector< QuantLib::Leg > legs_
Definition: trade.hpp:198
QuantLib::Real notional_
Definition: trade.hpp:202
void setSensitivityTemplate(const EngineBuilder &builder)
Definition: trade.cpp:295
RequiredFixings requiredFixings_
Definition: trade.hpp:223
QuantLib::ext::shared_ptr< InstrumentWrapper > instrument_
Definition: trade.hpp:197
string notionalCurrency_
Definition: trade.hpp:203
std::map< std::string, boost::any > additionalData_
Definition: trade.hpp:224
Currency parseCurrency(const string &s)
Convert text to QuantLib::Currency.
Definition: parsers.cpp:290
BusinessDayConvention parseBusinessDayConvention(const string &s)
Convert text to QuantLib::BusinessDayConvention.
Definition: parsers.cpp:173
DayCounter parseDayCounter(const string &s)
Convert text to QuantLib::DayCounter.
Definition: parsers.cpp:209
#define LOG(text)
Logging Macro (Level = Notice)
Definition: log.hpp:552
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
vector< T > buildScheduledVectorNormalised(const vector< T > &values, const vector< string > &dates, const Schedule &schedule, const T &defaultValue, const bool checkAllValuesAppearInResult=false)
Definition: legdata.hpp:1139
Real currentNotional(const Leg &leg)
Definition: legdata.cpp:2435
void addToRequiredFixings(const QuantLib::Leg &leg, const QuantLib::ext::shared_ptr< FixingDateGetter > &fixingDateGetter)
Schedule makeSchedule(const ScheduleDates &data)
Definition: schedule.cpp:263
vector< Real > strikes
+ Here is the call graph for this function:

◆ referenceSecurity()

const std::string & referenceSecurity ( ) const

Definition at line 84 of file balanceguaranteedswap.hpp.

84{ return referenceSecurity_; }
+ Here is the caller graph for this function:

◆ tranches()

const std::vector< BGSTrancheData > & tranches ( ) const

Definition at line 85 of file balanceguaranteedswap.hpp.

85{ return tranches_; }
+ Here is the caller graph for this function:

◆ schedule()

const ore::data::ScheduleData schedule ( ) const

Definition at line 86 of file balanceguaranteedswap.hpp.

86{ return schedule_; }
+ Here is the caller graph for this function:

◆ swap()

const std::vector< ore::data::LegData > & swap ( ) const

Definition at line 87 of file balanceguaranteedswap.hpp.

87{ return swap_; }

◆ fromXML()

void fromXML ( ore::data::XMLNode node)
overridevirtual

Reimplemented from Trade.

Definition at line 217 of file balanceguaranteedswap.cpp.

217 {
218 Trade::fromXML(node);
219 XMLNode* swapNode = XMLUtils::getChildNode(node, "BalanceGuaranteedSwapData");
220 QL_REQUIRE(swapNode, "BalanceGuaranteedSwap::fromXML(): BalanceGuaranteedSwapData not found");
221
222 referenceSecurity_ = XMLUtils::getChildValue(swapNode, "ReferenceSecurity");
223
224 XMLNode* tranchesNode = XMLUtils::getChildNode(swapNode, "Tranches");
225 QL_REQUIRE(tranchesNode, "BalanceGuaranteedSwap::fromXML(): Tranches node not found");
226 tranches_.clear();
227 vector<XMLNode*> trancheNodes = XMLUtils::getChildrenNodes(tranchesNode, "Tranche");
228 for (Size i = 0; i < trancheNodes.size(); ++i) {
229 BGSTrancheData td;
230 td.fromXML(trancheNodes[i]);
231 tranches_.push_back(td);
232 }
233
234 XMLNode* scheduleNode = XMLUtils::getChildNode(tranchesNode, "ScheduleData");
235 schedule_.fromXML(scheduleNode);
236
237 swap_.clear();
238 vector<XMLNode*> nodes = XMLUtils::getChildrenNodes(swapNode, "LegData");
239 for (Size i = 0; i < nodes.size(); ++i) {
240 LegData ld; // we do not allow ORE+ leg types anyway
241 ld.fromXML(nodes[i]);
242 swap_.push_back(ld);
243 }
244}
virtual void fromXML(XMLNode *node) override
Definition: schedule.cpp:179
virtual void fromXML(XMLNode *node) override
Definition: trade.cpp:34
static vector< XMLNode * > getChildrenNodes(XMLNode *node, const string &name)
Returns all the children with a given name.
Definition: xmlutils.cpp:428
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( ore::data::XMLDocument doc) const
overridevirtual

Reimplemented from Trade.

Definition at line 246 of file balanceguaranteedswap.cpp.

246 {
247 XMLNode* node = Trade::toXML(doc);
248 XMLUtils::addChild(doc, node, "ReferenceSecurity", referenceSecurity_);
249
250 XMLNode* tranchesNode = doc.allocNode("Tranches");
251 XMLUtils::appendNode(node, tranchesNode);
252 for (Size i = 0; i < tranches_.size(); ++i) {
253 XMLUtils::appendNode(tranchesNode, tranches_[i].toXML(doc));
254 }
255
256 XMLUtils::appendNode(tranchesNode, schedule_.toXML(doc));
257
258 XMLNode* swapNode = doc.allocNode("BalanceGuaranteedSwapData");
259 XMLUtils::appendNode(node, swapNode);
260 for (Size i = 0; i < swap_.size(); ++i)
261 XMLUtils::appendNode(swapNode, swap_[i].toXML(doc));
262 return node;
263}
virtual ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: schedule.cpp:198
virtual XMLNode * toXML(XMLDocument &doc) const override
Definition: trade.cpp:46
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ underlyingIndices()

std::map< ore::data::AssetClass, std::set< std::string > > underlyingIndices ( const QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > &  ) const
override

Definition at line 97 of file balanceguaranteedswap.hpp.

Member Data Documentation

◆ referenceSecurity_

std::string referenceSecurity_
private

Definition at line 102 of file balanceguaranteedswap.hpp.

◆ tranches_

std::vector<BGSTrancheData> tranches_
private

Definition at line 103 of file balanceguaranteedswap.hpp.

◆ schedule_

ore::data::ScheduleData schedule_
private

Definition at line 104 of file balanceguaranteedswap.hpp.

◆ swap_

std::vector<ore::data::LegData> swap_
private

Definition at line 105 of file balanceguaranteedswap.hpp.